login
A339569
Number of subsets of {1..n} whose cardinality is equal to the root-mean-square of the elements.
0
1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 5, 10, 16, 32, 56, 90, 134, 186, 304, 476, 746, 1308, 2522, 4845, 9129, 17260, 32684, 59908, 106181, 191779, 337793, 596689, 1061991, 1907311, 3518903, 6426672, 12093858, 22777645, 42886411, 81002076, 151575988, 285280108, 529313088
OFFSET
1,9
LINKS
Eric Weisstein's World of Mathematics, Root-Mean-Square
EXAMPLE
a(12) = 10 subsets: {1}, {1, 2, 4, 5, 7, 11}, {1, 3, 5, 6, 8, 9}, {3, 4, 5, 6, 7, 9}, {1, 2, 3, 6, 7, 10, 12}, {2, 3, 4, 5, 8, 9, 12}, {2, 3, 6, 7, 8, 9, 10}, {3, 4, 5, 6, 7, 8, 12}, {1, 2, 5, 6, 9, 10, 11, 12} and {1, 4, 6, 7, 8, 9, 11, 12}.
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def b(n, sos, c):
if n == 0:
if c>0:
if sos==c*c*c: return 1
return 0
return b(n-1, sos, c) + b(n-1, sos+n*n, c+1)
a = lambda n: b(n, 0, 0)
print([a(n) for n in range(1, 44)]) # Michael S. Branicky, Dec 10 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 09 2020
EXTENSIONS
a(24)-a(43) from Michael S. Branicky, Dec 09 2020
STATUS
approved