add copyright notice

This commit is contained in:
filifa 2025-07-24 23:08:19 -04:00
parent 5309593e70
commit be77271930
100 changed files with 673 additions and 82 deletions

View File

@ -34,7 +34,10 @@
"\n",
"## Relevant sequences\n",
"* Triangular numbers: [A000217](https://oeis.org/A000217)\n",
"* Multiples of 3 and/or 5: [A281746](https://oeis.org/A281746)"
"* Multiples of 3 and/or 5: [A281746](https://oeis.org/A281746)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -63,7 +63,11 @@
"source": [
"## Relevant sequences\n",
"* Fibonacci numbers: [A000045](https://oeis.org/A000045)\n",
"* Partial sums of even Fibonacci numbers: [A099919](https://oeis.org/A099919)"
"* Partial sums of even Fibonacci numbers: [A099919](https://oeis.org/A099919)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -101,7 +101,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Greatest prime factors: [A006530](https://oeis.org/A006530)"
"* Greatest prime factors: [A006530](https://oeis.org/A006530)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -34,6 +34,16 @@
"three_digit_pairs = combinations(range(100, 1000), 2)\n",
"max(x*y for (x,y) in three_digit_pairs if is_palindrome(x*y))"
]
},
{
"cell_type": "markdown",
"id": "ac68b4da",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -49,7 +49,11 @@
"This formula is only defined for two numbers, but if we want to find an LCM of a set of three or more numbers, we can simply find the LCM of any two numbers in the set, then proceed to find the LCM of that value and another number from the set, repeating until we have used each number. For example, to find the LCM of 5, 8, and 14, you can first find the LCM of 5 and 8 using the above formula (40), then find the LCM of 40 and 14 (280).\n",
"\n",
"## Relevant sequences\n",
"* Least common multiple of $1,2,\\ldots,n$: [A003418](https://oeis.org/A003418)"
"* Least common multiple of $1,2,\\ldots,n$: [A003418](https://oeis.org/A003418)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -21,7 +21,11 @@
"\n",
"## Relevant sequences\n",
"* Triangular numbers: [A000217](https://oeis.org/A000217)\n",
"* Square pyramidal numbers: [A000330](https://oeis.org/A000330)"
"* Square pyramidal numbers: [A000330](https://oeis.org/A000330)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -160,7 +160,11 @@
"source": [
"## Relevant sequences\n",
"* Prime numbers: [A000040](https://oeis.org/A000040)\n",
"* Carmichael numbers: [A002997](https://oeis.org/A002997)"
"* Carmichael numbers: [A002997](https://oeis.org/A002997)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -55,7 +55,11 @@
"id": "4148d160",
"metadata": {},
"source": [
"Their product is 23514624000."
"Their product is 23514624000.\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -84,7 +84,11 @@
"id": "8809ed3b",
"metadata": {},
"source": [
"So our product is $abc=31875000$."
"So our product is $abc=31875000$.\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -66,7 +66,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Partial sums of primes: [A007504](https://oeis.org/A007504)"
"* Partial sums of primes: [A007504](https://oeis.org/A007504)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -77,6 +77,16 @@
"\n",
"print(maximum)"
]
},
{
"cell_type": "markdown",
"id": "8626099f",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -58,7 +58,11 @@
"## Relevant sequences\n",
"* Number of divisors: [A000005](https://oeis.org/A000005)\n",
"* Triangular numbers: [A000217](https://oeis.org/A000217)\n",
"* Number of divisors of triangular numbers: [A063440](https://oeis.org/A063440)"
"* Number of divisors of triangular numbers: [A063440](https://oeis.org/A063440)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -147,6 +147,16 @@
"source": [
"int(str(sum(nums))[:10])"
]
},
{
"cell_type": "markdown",
"id": "dfce30f6",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -68,7 +68,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Collatz chain lengths: [A008908](https://oeis.org/A008908)"
"* Collatz chain lengths: [A008908](https://oeis.org/A008908)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -88,7 +88,11 @@
"source": [
"## Relevant sequences\n",
"* Central binomial coefficients: [A000984](https://oeis.org/A000984)\n",
"* General formula: [A046899](https://oeis.org/A046899)"
"* General formula: [A046899](https://oeis.org/A046899)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -40,7 +40,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Sums of digits of $2^n$: [A001370](https://oeis.org/A001370)"
"* Sums of digits of $2^n$: [A001370](https://oeis.org/A001370)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -119,7 +119,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Number of letters in British numeral: [A362123](https://oeis.org/A362123)"
"* Number of letters in British numeral: [A362123](https://oeis.org/A362123)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -153,6 +153,16 @@
"\n",
"max_path_sum(triangle)"
]
},
{
"cell_type": "markdown",
"id": "1d84d533",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -114,7 +114,11 @@
"id": "83b6e18e",
"metadata": {},
"source": [
"One last note, just for fun: did you know you can learn how to calculate what day of the week any date falls on [in your head](https://en.wikipedia.org/wiki/Doomsday_rule)?"
"One last note, just for fun: did you know you can learn how to calculate what day of the week any date falls on [in your head](https://en.wikipedia.org/wiki/Doomsday_rule)?\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -37,7 +37,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Sum of digits of $n!$: [A004152](https://oeis.org/A004152)"
"* Sum of digits of $n!$: [A004152](https://oeis.org/A004152)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -232,7 +232,11 @@
"source": [
"## Relevant sequences\n",
"* Sums of divisors: [A000203](https://oeis.org/A000203)\n",
"* Amicable numbers: [A063990](https://oeis.org/A063990)"
"* Amicable numbers: [A063990](https://oeis.org/A063990)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -60,6 +60,16 @@
"\n",
"sum(name_score(i, name) for (i, name) in enumerate(names, start=1))"
]
},
{
"cell_type": "markdown",
"id": "7c61f808",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -64,7 +64,11 @@
"source": [
"## Relevant sequences\n",
"* Sums of divisors: [A000203](https://oeis.org/A000203)\n",
"* Numbers that are not the sum of two abundant numbers: [A048242](https://oeis.org/A048242)"
"* Numbers that are not the sum of two abundant numbers: [A048242](https://oeis.org/A048242)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -98,6 +98,16 @@
" lst[i+1:] = lst[i+1:][::-1]\n",
" break"
]
},
{
"cell_type": "markdown",
"id": "cde4b894",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -29,7 +29,11 @@
"Therefore, we want $n=4782$.\n",
"\n",
"## Relevant sequences\n",
"* Fibonacci numbers: [A000045](https://oeis.org/A000045)"
"* Fibonacci numbers: [A000045](https://oeis.org/A000045)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -101,7 +101,11 @@
"As a concrete example of the above, consider $d = 2^4 \\times 5 \\times 63 = 5040$. The decimal representation of $u = \\frac{1}{d}$ is $0.0001(984126)$, where 984126 is the repetend. Therefore $q=4$ and $r=6$. Sure enough, $10^q 10^r u - 10^q u = 1984125$ is an integer; therefore, $10^{10} \\equiv 10^4 \\pmod{5040}$, and $10^6 \\equiv 1 \\pmod{63}$.\n",
"\n",
"## Relevant sequences\n",
"* Periods of reciprocals: [A007732](https://oeis.org/A007732)"
"* Periods of reciprocals: [A007732](https://oeis.org/A007732)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,11 @@
"Side note: this practice of writing the natural numbers in a spiral, combined with marking the prime numbers, has been coined the [Ulam spiral](https://en.wikipedia.org/wiki/Ulam_spiral). Somewhat interestingly, lots of primes appear in vertical, horizontal, and diagonal lines when laid out this way.\n",
"\n",
"## Relevant sequences\n",
"* Numbers on diagonals: [A200975](https://oeis.org/A200975)"
"* Numbers on diagonals: [A200975](https://oeis.org/A200975)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -30,6 +30,16 @@
"source": [
"len({a ** b for a in range(2, 101) for b in range(2, 101)})"
]
},
{
"cell_type": "markdown",
"id": "d7afa770",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -74,7 +74,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Perfect digital invariants: [A252648](https://oeis.org/A252648)"
"* Perfect digital invariants: [A252648](https://oeis.org/A252648)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -235,7 +235,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Number of ways to make change with Euro currency (same values as this problem until $n=500$): [A057537](https://oeis.org/A057537)"
"* Number of ways to make change with Euro currency (same values as this problem until $n=500$): [A057537](https://oeis.org/A057537)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -93,6 +93,16 @@
"source": [
"sum(set(products.values()))"
]
},
{
"cell_type": "markdown",
"id": "04862a57",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -102,6 +102,16 @@
"source": [
"prod(QQ(n/d) for (n, d) in fractions).denominator()"
]
},
{
"cell_type": "markdown",
"id": "1514f872",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -98,7 +98,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Factorions: [A014080](https://oeis.org/A014080)"
"* Factorions: [A014080](https://oeis.org/A014080)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -56,7 +56,11 @@
"Another note - there aren't that many known circular primes, and all of the known ones greater than one million are [repunits](https://en.wikipedia.org/wiki/Repunit).\n",
"\n",
"## Relevant sequences\n",
"* Circular primes: [A068652](https://oeis.org/A068652)"
"* Circular primes: [A068652](https://oeis.org/A068652)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -80,7 +80,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Numbers that are base-2 and base-10 palindromes: [A007632](https://oeis.org/A007632)"
"* Numbers that are base-2 and base-10 palindromes: [A007632](https://oeis.org/A007632)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -222,7 +222,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Two-sided primes: [A020994](https://oeis.org/A020994)"
"* Two-sided primes: [A020994](https://oeis.org/A020994)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -93,6 +93,16 @@
"source": [
"max(pandigitals.values())"
]
},
{
"cell_type": "markdown",
"id": "094c440b",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -140,7 +140,11 @@
"metadata": {},
"source": [
"## Related sequences\n",
"* Number of integer right triangles with perimeter $n$: [A024155](https://oeis.org/A024155)"
"* Number of integer right triangles with perimeter $n$: [A024155](https://oeis.org/A024155)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -42,7 +42,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Digits of Champernowne's constant: [A033307](https://oeis.org/A033307)"
"* Digits of Champernowne's constant: [A033307](https://oeis.org/A033307)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -74,7 +74,11 @@
"source": [
"## Relevant sequences\n",
"* Pandigital numbers: [A352991](https://oeis.org/A352991)\n",
"* Pandigital primes: [A216444](https://oeis.org/A216444)"
"* Pandigital primes: [A216444](https://oeis.org/A216444)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -78,6 +78,16 @@
"triangle_words = {w for w in words if is_triangle_word(w)}\n",
"len(triangle_words)"
]
},
{
"cell_type": "markdown",
"id": "02bf08bf",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -99,7 +99,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Pandigital numbers: [A050278](https://oeis.org/A050278)"
"* Pandigital numbers: [A050278](https://oeis.org/A050278)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -243,7 +243,11 @@
"\n",
"## Relevant sequences\n",
"* Pentagonal numbers: [A000326](https://oeis.org/A000326)\n",
"* Pentagonal numbers which are the sum of two other positive pentagonal numbers: [A136117](https://oeis.org/A136117)"
"* Pentagonal numbers which are the sum of two other positive pentagonal numbers: [A136117](https://oeis.org/A136117)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -46,8 +46,8 @@
{
"data": {
"text/plain": [
"(1/12*(2107560*sqrt(3) + 3650401)^t*(3*sqrt(3) + 5) - 1/12*(-2107560*sqrt(3) + 3650401)^t*(3*sqrt(3) - 5) + 1/6,\n",
" 1/24*sqrt(3)*((2107560*sqrt(3) + 3650401)^t*(3*sqrt(3) + 5) + (-2107560*sqrt(3) + 3650401)^t*(3*sqrt(3) - 5)) + 1/4)"
"(-1/12*(2107560*sqrt(3) + 3650401)^t*(153*sqrt(3) + 265) + 1/12*(-2107560*sqrt(3) + 3650401)^t*(153*sqrt(3) - 265) + 1/6,\n",
" -1/24*sqrt(3)*((2107560*sqrt(3) + 3650401)^t*(153*sqrt(3) + 265) + (-2107560*sqrt(3) + 3650401)^t*(153*sqrt(3) - 265)) + 1/4)"
]
},
"execution_count": 2,
@ -337,7 +337,11 @@
"* [Pell's Equation, II](https://kconrad.math.uconn.edu/blurbs/ugradnumthy/pelleqn2.pdf)\n",
"\n",
"## Relevant sequences\n",
"* Hexagonal pentagonal numbers: [A046180](https://oeis.org/A046180)"
"* Hexagonal pentagonal numbers: [A046180](https://oeis.org/A046180)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -65,7 +65,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Stern numbers (includes all odd numbers, not just composites): [A060003](https://oeis.org/A060003)"
"* Stern numbers (includes all odd numbers, not just composites): [A060003](https://oeis.org/A060003)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -49,7 +49,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Number of distinct prime factors: [A001221](https://oeis.org/A001221)"
"* Number of distinct prime factors: [A001221](https://oeis.org/A001221)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -5,7 +5,7 @@
"id": "e829e539",
"metadata": {},
"source": [
"# [Self Powers](https://projecteuler.net/problem=48)\n",
"## [Self Powers](https://projecteuler.net/problem=48)\n",
"\n",
"Easy with [modular exponentiation](https://en.wikipedia.org/wiki/Modular_exponentiation), which is built into Python."
]
@ -47,7 +47,11 @@
"\n",
"## Relevant sequences\n",
"* $n^n$: [A000312](https://oeis.org/A000312)\n",
"* Partial sums of $n^n$: [A001923](https://oeis.org/A001923)"
"* Partial sums of $n^n$: [A001923](https://oeis.org/A001923)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -111,6 +111,16 @@
" \n",
"p, q, r"
]
},
{
"cell_type": "markdown",
"id": "929e777d",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -130,7 +130,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Primes expressible as the sum of (at least two) consecutive primes in at least 1 way: [A067377](https://oeis.org/A067377)"
"* Primes expressible as the sum of (at least two) consecutive primes in at least 1 way: [A067377](https://oeis.org/A067377)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -159,6 +159,16 @@
"source": [
"min(f)"
]
},
{
"cell_type": "markdown",
"id": "8cc3e0f4",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -40,6 +40,16 @@
" \n",
"n"
]
},
{
"cell_type": "markdown",
"id": "898f292d",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -50,7 +50,11 @@
"$\\log{n!}$ can be computed in a number of ways. You can use the [log-gamma function](https://en.wikipedia.org/wiki/Gamma_function), or you can implement a function yourself, either by applying logarithmic identities again:\n",
"$$\\log{n!} = \\log{1} + \\log{2} + \\log{3} \\cdots + \\log{n}$$\n",
"or by using [Stirling's approximation](https://en.wikipedia.org/wiki/Stirling%27s_approximation):\n",
"$$\\log{n!} \\approx \\left(n + \\frac{1}{2}\\right)\\log{n} - n + \\frac{1}{2}\\log{2\\pi}$$"
"$$\\log{n!} \\approx \\left(n + \\frac{1}{2}\\right)\\log{n} - n + \\frac{1}{2}\\log{2\\pi}$$\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -238,6 +238,16 @@
"wins = [i for (i, (x, y)) in enumerate(hands) if x > y]\n",
"len(wins)"
]
},
{
"cell_type": "markdown",
"id": "dc2baa5b",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -77,7 +77,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Suspected Lychrel numbers: [A023108](https://oeis.org/A023108)"
"* Suspected Lychrel numbers: [A023108](https://oeis.org/A023108)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -46,6 +46,16 @@
"source": [
"max(digit_sum(a^b) for a in range(1, 100) for b in range(1, 100))"
]
},
{
"cell_type": "markdown",
"id": "d6f7d0af",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -147,7 +147,11 @@
"source": [
"## Relevant sequences\n",
"* Numerators of convergents of $\\sqrt{2}$: [A001333](https://oeis.org/A001333)\n",
"* Pell numbers (denominators of convergents of $\\sqrt{2}$): [A000129](https://oeis.org/A000129)"
"* Pell numbers (denominators of convergents of $\\sqrt{2}$): [A000129](https://oeis.org/A000129)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -63,7 +63,11 @@
"source": [
"## Relevant sequences\n",
"* Numbers on diagonals: [A200975](https://oeis.org/A200975)\n",
"* Primes at right-angle turns on the Ulam spiral: [A172979](https://oeis.org/A172979)"
"* Primes at right-angle turns on the Ulam spiral: [A172979](https://oeis.org/A172979)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -183,6 +183,16 @@
"source": [
"sum(plaintext)"
]
},
{
"cell_type": "markdown",
"id": "e8832df2",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -215,6 +215,16 @@
"min_clique = min(cliques, key=sum)\n",
"min_clique"
]
},
{
"cell_type": "markdown",
"id": "07fc52d8",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -206,7 +206,11 @@
"* Pentagonal numbers: [A000326](https://oeis.org/A000326)\n",
"* Hexagonal numbers: [A000384](https://oeis.org/A000384)\n",
"* Heptagonal numbers: [A000566](https://oeis.org/A000566)\n",
"* Octagonal numbers: [A000567](https://oeis.org/A000567)"
"* Octagonal numbers: [A000567](https://oeis.org/A000567)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -89,6 +89,16 @@
"source": [
"min(s)"
]
},
{
"cell_type": "markdown",
"id": "1701dfc7",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -21,7 +21,11 @@
"$$9 + 6 + 5 + 4 + 3 + 3 + 2 + 2 + 2 + 2 + 1 \\times 11 = 49$$\n",
"\n",
"## Relevant sequences\n",
"* Numbers with $k$ digits that are also $k$th powers: [A132722](https://oeis.org/A132722)"
"* Numbers with $k$ digits that are also $k$th powers: [A132722](https://oeis.org/A132722)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -115,7 +115,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Periods of continued fractions of $\\sqrt{n}$: [A003285](https://oeis.org/A003285)"
"* Periods of continued fractions of $\\sqrt{n}$: [A003285](https://oeis.org/A003285)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -116,7 +116,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Numerators of convergents of $e$: [A007676](https://oeis.org/A007676)"
"* Numerators of convergents of $e$: [A007676](https://oeis.org/A007676)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -19,10 +19,10 @@
{
"data": {
"text/plain": [
"[(-sqrt(2)*(2*sqrt(2) + 3)^t + sqrt(2)*(-2*sqrt(2) + 3)^t - 3/2*(2*sqrt(2) + 3)^t - 3/2*(-2*sqrt(2) + 3)^t,\n",
" 3/4*sqrt(2)*(2*sqrt(2) + 3)^t - 3/4*sqrt(2)*(-2*sqrt(2) + 3)^t + (2*sqrt(2) + 3)^t + (-2*sqrt(2) + 3)^t),\n",
" (sqrt(2)*(2*sqrt(2) + 3)^t - sqrt(2)*(-2*sqrt(2) + 3)^t + 3/2*(2*sqrt(2) + 3)^t + 3/2*(-2*sqrt(2) + 3)^t,\n",
" -3/4*sqrt(2)*(2*sqrt(2) + 3)^t + 3/4*sqrt(2)*(-2*sqrt(2) + 3)^t - (2*sqrt(2) + 3)^t - (-2*sqrt(2) + 3)^t)]"
"[(sqrt(2)*(2*sqrt(2) + 3)^t - sqrt(2)*(-2*sqrt(2) + 3)^t + 3/2*(2*sqrt(2) + 3)^t + 3/2*(-2*sqrt(2) + 3)^t,\n",
" -3/4*sqrt(2)*(2*sqrt(2) + 3)^t + 3/4*sqrt(2)*(-2*sqrt(2) + 3)^t - (2*sqrt(2) + 3)^t - (-2*sqrt(2) + 3)^t),\n",
" (-sqrt(2)*(2*sqrt(2) + 3)^t + sqrt(2)*(-2*sqrt(2) + 3)^t - 3/2*(2*sqrt(2) + 3)^t - 3/2*(-2*sqrt(2) + 3)^t,\n",
" 3/4*sqrt(2)*(2*sqrt(2) + 3)^t - 3/4*sqrt(2)*(-2*sqrt(2) + 3)^t + (2*sqrt(2) + 3)^t + (-2*sqrt(2) + 3)^t)]"
]
},
"execution_count": 1,
@ -184,7 +184,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Minimal values of $x$ for solutions to the Pell equation: [A002350](https://oeis.org/A002350)"
"* Minimal values of $x$ for solutions to the Pell equation: [A002350](https://oeis.org/A002350)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -58,6 +58,16 @@
"\n",
"max_path_sum(triangle)"
]
},
{
"cell_type": "markdown",
"id": "f06b0164",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -157,6 +157,16 @@
"source": [
"max((s for s in sols if len(s) == 16), key=int)"
]
},
{
"cell_type": "markdown",
"id": "e5000191",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -51,7 +51,11 @@
"source": [
"## Relevant sequences\n",
"* Totient: [A000010](https://oeis.org/A000010)\n",
"* Primorial numbers: [A002110](https://oeis.org/A002110)"
"* Primorial numbers: [A002110](https://oeis.org/A002110)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -116,7 +116,11 @@
"\n",
"## Relevant sequences\n",
"* All numbers $n$ such that $\\phi(n)$ is a digit permutation: [A115921](https://oeis.org/A115921)\n",
"* Subsequence of A115921 such that $n/\\phi(n)$ is a record low: [A102018](https://oeis.org/A102018)"
"* Subsequence of A115921 such that $n/\\phi(n)$ is a record low: [A102018](https://oeis.org/A102018)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -22,7 +22,11 @@
"Therefore, we just need to find the largest $n$ such that $5 + 7n \\leq 1000000$, which is $n=142856$. This gives us a numerator of 428570.\n",
"\n",
"## Relevant sequences\n",
"* Numerators of Farey sequences: [A007305](https://oeis.org/A007305)"
"* Numerators of Farey sequences: [A007305](https://oeis.org/A007305)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -299,7 +299,11 @@
"source": [
"## Relevant sequences\n",
"* Cardinalities of Farey sequences: [A005728](https://oeis.org/A005728)\n",
"* Partial sums of totient function: [A002088](https://oeis.org/A002088)"
"* Partial sums of totient function: [A002088](https://oeis.org/A002088)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -70,6 +70,16 @@
" \n",
"total"
]
},
{
"cell_type": "markdown",
"id": "192090b1",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -203,7 +203,11 @@
"source": [
"## Relevant sequences\n",
"* Numbers that eventually cycle when summing digit factorials: [A188284](https://oeis.org/A188284)\n",
"* Digit factorial chain lengths: [A303935](https://oeis.org/A303935)"
"* Digit factorial chain lengths: [A303935](https://oeis.org/A303935)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -102,7 +102,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Perimeters with one Pythagorean triple: [A098714](https://oeis.org/A098714)"
"* Perimeters with one Pythagorean triple: [A098714](https://oeis.org/A098714)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -70,7 +70,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Partition numbers: [A000041](https://oeis.org/A000041)"
"* Partition numbers: [A000041](https://oeis.org/A000041)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -86,7 +86,11 @@
"We can see that $x^{71}$ is our first term with a coeffcient over 5000, so our answer is 71.\n",
"\n",
"## Relevant sequences\n",
"* Number of partitions of $n$ into prime parts: [A000607](https://oeis.org/A000607)"
"* Number of partitions of $n$ into prime parts: [A000607](https://oeis.org/A000607)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -89,7 +89,11 @@
"\n",
"## Relevant sequences\n",
"* Partition numbers: [A000041](https://oeis.org/A000041)\n",
"* Generalized pentagonal numbers: [A001318](https://oeis.org/A001318)"
"* Generalized pentagonal numbers: [A001318](https://oeis.org/A001318)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -61,6 +61,16 @@
"\n",
"tuple(ts.static_order())"
]
},
{
"cell_type": "markdown",
"id": "242e35e6",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -81,7 +81,11 @@
"source": [
"If you want to go the extra mile, there are several [algorithms for computing square roots](https://en.wikipedia.org/wiki/Square_root_algorithms) that you can implement yourself, such as Heron's method, which is a special case of [Newton's method](https://en.wikipedia.org/wiki/Newton%27s_method) for solving $x^2 - n = 0$. The method works by starting with an initial estimate $x_0$ (such as $\\frac{n}{2}$), then repeatedly calculating\n",
"$$x_{k+1} = \\frac{1}{2}\\left(x_k + \\frac{n}{x_k}\\right)$$\n",
"until $|x_{k+1} - x_k|$ is sufficiently small. For computing the integer square root, this can be when $|x_{k+1} - x_k| < 1$."
"until $|x_{k+1} - x_k|$ is sufficiently small. For computing the integer square root, this can be when $|x_{k+1} - x_k| < 1$.\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -88,6 +88,16 @@
"source": [
"minimal_path_sum(mat)"
]
},
{
"cell_type": "markdown",
"id": "aff1f323",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -91,6 +91,16 @@
"source": [
"minimal_path_sum(mat)"
]
},
{
"cell_type": "markdown",
"id": "db7b11ca",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -90,6 +90,16 @@
"source": [
"minimal_path_sum(mat)"
]
},
{
"cell_type": "markdown",
"id": "f1685769",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -390,7 +390,11 @@
"id": "1c1cc8aa",
"metadata": {},
"source": [
"This gives our top squares as 10 (JAIL), 15 (R2), and 24 (E3)."
"This gives our top squares as 10 (JAIL), 15 (R2), and 24 (E3).\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -125,7 +125,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Number of rectangles in an $m \\times n$ grid: [A098358](https://oeis.org/A098358)"
"* Number of rectangles in an $m \\times n$ grid: [A098358](https://oeis.org/A098358)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -96,7 +96,11 @@
"source": [
"## Relevant sequences\n",
"* Number of pairs $a,b$ such that $(a+b)^2 + n^2$ is square: [A143714](https://oeis.org/A143714)\n",
"* Partial sums of A143714: [A143715](https://oeis.org/A143715)"
"* Partial sums of A143714: [A143715](https://oeis.org/A143715)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -80,7 +80,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Prime power triples: [A134657](https://oeis.org/A134657)"
"* Prime power triples: [A134657](https://oeis.org/A134657)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -104,7 +104,11 @@
"source": [
"## Relevant sequences\n",
"* Minimal product-sum numbers: [A104173](https://oeis.org/A104173)\n",
"* Set sizes $k$ with a minimal product-sum number of $2k$: [A033179](https://oeis.org/A033179)"
"* Set sizes $k$ with a minimal product-sum number of $2k$: [A033179](https://oeis.org/A033179)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -162,6 +162,16 @@
"\n",
"total"
]
},
{
"cell_type": "markdown",
"id": "109ecfb2",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -116,6 +116,16 @@
"source": [
"len(arrangements)"
]
},
{
"cell_type": "markdown",
"id": "7229398d",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -64,7 +64,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Answers for limits of 0, 1, 2, ...: [A155154](https://oeis.org/A155154)"
"* Answers for limits of 0, 1, 2, ...: [A155154](https://oeis.org/A155154)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -109,7 +109,11 @@
"metadata": {},
"source": [
"## Related sequences\n",
"* Numbers we iterate over: [A009994](https://oeis.org/A009994)"
"* Numbers we iterate over: [A009994](https://oeis.org/A009994)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -133,7 +133,11 @@
"metadata": {},
"source": [
"## Relevant sequences\n",
"* Catalan numbers: [A000108](https://oeis.org/A000108)"
"* Catalan numbers: [A000108](https://oeis.org/A000108)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -29,11 +29,11 @@
{
"data": {
"text/plain": [
"[-1/3*(780*sqrt(3) + 1351)^t*(56*sqrt(3) + 97) + 1/3*(-780*sqrt(3) + 1351)^t*(56*sqrt(3) - 97) - 1/3,\n",
"[-1/3*(780*sqrt(3) + 1351)^t*(4*sqrt(3) + 7) + 1/3*(-780*sqrt(3) + 1351)^t*(4*sqrt(3) - 7) - 1/3,\n",
" -1/3*(780*sqrt(3) + 1351)^t*(56*sqrt(3) + 97) + 1/3*(-780*sqrt(3) + 1351)^t*(56*sqrt(3) - 97) - 1/3,\n",
" -1/3*(780*sqrt(3) + 1351)^t*(780*sqrt(3) + 1351) + 1/3*(-780*sqrt(3) + 1351)^t*(780*sqrt(3) - 1351) - 1/3,\n",
" -1/3*(780*sqrt(3) + 1351)^t*(4*sqrt(3) + 7) + 1/3*(-780*sqrt(3) + 1351)^t*(4*sqrt(3) - 7) - 1/3,\n",
" 1/3*(780*sqrt(3) + 1351)^t*(sqrt(3) + 2) - 1/3*(-780*sqrt(3) + 1351)^t*(sqrt(3) - 2) - 1/3,\n",
" 1/3*(780*sqrt(3) + 1351)^t*(209*sqrt(3) + 362) - 1/3*(-780*sqrt(3) + 1351)^t*(209*sqrt(3) - 362) - 1/3,\n",
" 1/3*(780*sqrt(3) + 1351)^t*(sqrt(3) + 2) - 1/3*(-780*sqrt(3) + 1351)^t*(sqrt(3) - 2) - 1/3,\n",
" 1/3*(780*sqrt(3) + 1351)^t*(15*sqrt(3) + 26) - 1/3*(-780*sqrt(3) + 1351)^t*(15*sqrt(3) - 26) - 1/3]"
]
},
@ -169,7 +169,11 @@
"## Relevant sequences\n",
"* Side lengths in the first case: [A103772](https://oeis.org/A103772)\n",
"* Side lengths in the second case: [A103974](https://oeis.org/A103974)\n",
"* The union of the two cases: [A120893](https://oeis.org/A120893)"
"* The union of the two cases: [A120893](https://oeis.org/A120893)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -82,7 +82,11 @@
"\n",
"## Relevant sequences\n",
"* Smallest members of amicable chains: [A003416](https://oeis.org/A003416)\n",
"* The amicable chain containing this problem's answer: [A072890](https://oeis.org/A072890)"
"* The amicable chain containing this problem's answer: [A072890](https://oeis.org/A072890)\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -326,7 +326,11 @@
"\n",
"Algorithm X can be made more efficient by applying a property Knuth named [dancing links](https://en.wikipedia.org/wiki/Dancing_Links). This concept boils down to the fact you can efficiently re-add a previously removed node to a [doubly linked list](https://en.wikipedia.org/wiki/Doubly_linked_list).\n",
"\n",
"By creating a special data structure ([shown here](https://commons.wikimedia.org/wiki/File:Dancing_links.svg)) that takes advantage of this property, you can create a very efficient implementation of Algorithm X. Such an implementation is deemed DLX, and *this* is the default algorithm that SageMath uses in its Sudoku solver."
"By creating a special data structure ([shown here](https://commons.wikimedia.org/wiki/File:Dancing_links.svg)) that takes advantage of this property, you can create a very efficient implementation of Algorithm X. Such an implementation is deemed DLX, and *this* is the default algorithm that SageMath uses in its Sudoku solver.\n",
"\n",
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],

View File

@ -31,6 +31,16 @@
"modulus = 10^10\n",
"(28433 * pow(2, 7830457, modulus) + 1) % modulus"
]
},
{
"cell_type": "markdown",
"id": "0454e1f8",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -268,6 +268,16 @@
"source": [
"max(max_squares.values())"
]
},
{
"cell_type": "markdown",
"id": "69a1b066",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -42,6 +42,16 @@
"logpows = {(x, y): y * log(x) for (x, y) in pairs}\n",
"max(enumerate(logpows, start=1), key=lambda x: logpows[x[1]])"
]
},
{
"cell_type": "markdown",
"id": "6a4a2222",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {

View File

@ -21,10 +21,10 @@
{
"data": {
"text/plain": [
"[(-1/8*(12*sqrt(2) + 17)^t*(sqrt(2) + 2) + 1/8*(-12*sqrt(2) + 17)^t*(sqrt(2) - 2) + 1/2,\n",
" -1/8*sqrt(2)*((12*sqrt(2) + 17)^t*(sqrt(2) + 2) + (-12*sqrt(2) + 17)^t*(sqrt(2) - 2)) + 1/2),\n",
" (-1/8*(12*sqrt(2) + 17)^t*(7*sqrt(2) + 10) + 1/8*(-12*sqrt(2) + 17)^t*(7*sqrt(2) - 10) + 1/2,\n",
"[(-1/8*(12*sqrt(2) + 17)^t*(7*sqrt(2) + 10) + 1/8*(-12*sqrt(2) + 17)^t*(7*sqrt(2) - 10) + 1/2,\n",
" -1/8*sqrt(2)*((12*sqrt(2) + 17)^t*(7*sqrt(2) + 10) + (-12*sqrt(2) + 17)^t*(7*sqrt(2) - 10)) + 1/2),\n",
" (-1/8*(12*sqrt(2) + 17)^t*(sqrt(2) + 2) + 1/8*(-12*sqrt(2) + 17)^t*(sqrt(2) - 2) + 1/2,\n",
" -1/8*sqrt(2)*((12*sqrt(2) + 17)^t*(sqrt(2) + 2) + (-12*sqrt(2) + 17)^t*(sqrt(2) - 2)) + 1/2),\n",
" (1/8*(12*sqrt(2) + 17)^t*(sqrt(2) + 2) - 1/8*(-12*sqrt(2) + 17)^t*(sqrt(2) - 2) + 1/2,\n",
" 1/8*sqrt(2)*((12*sqrt(2) + 17)^t*(sqrt(2) + 2) + (-12*sqrt(2) + 17)^t*(sqrt(2) - 2)) + 1/2),\n",
" (1/8*(12*sqrt(2) + 17)^t*(7*sqrt(2) + 10) - 1/8*(-12*sqrt(2) + 17)^t*(7*sqrt(2) - 10) + 1/2,\n",
@ -198,6 +198,16 @@
"source": [
"b, t"
]
},
{
"cell_type": "markdown",
"id": "10873881",
"metadata": {},
"source": [
"#### Copyright (C) 2025 filifa\n",
"\n",
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."
]
}
],
"metadata": {