The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A336815 Number of subsets of {1..n} whose sum of squares of elements is a square. 1
1, 2, 3, 4, 6, 7, 10, 12, 17, 26, 37, 69, 120, 233, 417, 781, 1386, 2561, 4638, 8387, 15495, 27709, 51580, 94054, 176266, 330004, 618846, 1174439, 2216002, 4232301, 8041866, 15344759, 29258898, 55850376, 106792759, 204203789, 391147474, 749434144, 1439261966 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
a(n) = 1 + Sum_{k=1..n} A339612(k).
EXAMPLE
a(8) = 17 subsets: {}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {3, 4}, {6, 8}, {1, 4, 8}, {2, 3, 6}, {2, 4, 5, 6}, {1, 2, 4, 6, 8}, {1, 3, 4, 5, 7} and {2, 4, 6, 7, 8}.
PROG
(Python)
from sympy.ntheory.primetest import is_square
from functools import lru_cache
@lru_cache(maxsize=None)
def b(n, sos, c):
if n == 0:
if is_square(sos): 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(40)]) # Michael S. Branicky, Dec 10 2020
CROSSREFS
Sequence in context: A347461 A328172 A239468 * A355979 A119793 A181436
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 09 2020
EXTENSIONS
a(24)-a(38) from Michael S. Branicky, Dec 09 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 23 15:23 EDT 2024. Contains 372763 sequences. (Running on oeis4.)