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!)
A003995 Sum of (any number of) distinct squares: of form r^2 + s^2 + t^2 + ... with 0 <= r < s < t < ... 28

%I #33 Jun 13 2015 00:48:08

%S 0,1,4,5,9,10,13,14,16,17,20,21,25,26,29,30,34,35,36,37,38,39,40,41,

%T 42,45,46,49,50,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,68,69,70,

%U 71,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,94,95,97

%N Sum of (any number of) distinct squares: of form r^2 + s^2 + t^2 + ... with 0 <= r < s < t < ...

%H T. D. Noe, <a href="/A003995/b003995.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1).

%F Exponents in expansion of (1+x)*(1+x^4)*(1+x^9)*(1+x^16)*(1+x^25)*(1+x^36)*(1+x^49)*(1+x^64)*(1+x^81)*(1+x^100)*(1+x^121)*(1+x^144)*...

%F For n > 98, a(n) = n + 30. - _Charles R Greathouse IV_, Sep 02 2011 (This implies a(n+2) = 2*a(n+1)-a(n) for n > 98.)

%t lim = 10; s = {0}; Do[s = Union[s, s + n^2], {n, lim}]; Select[s, 0 <= # <= lim^2 &] (* _T. D. Noe_, Jul 10 2012 *)

%o (PARI) a(n)=if(n<1,0,n=a(n-1); until(polcoeff(prod(k=1,sqrt(n),1+x^k^2), n), n++); n)

%o (Haskell)

%o a003995 n = a003995_list !! (n-1)

%o a003995_list = filter (p a000290_list) [0..]

%o where p (q:qs) m = m == 0 || q <= m && (p qs (m - q) || p qs m)

%o -- _Reinhard Zumkeller_, Apr 22 2013

%Y Cf. A001983, A033461, A008935. Complement of A001422.

%Y Cf. A000290; subsequences: A004431, A004432, A004433, A004434, A224981, A224982, A224983.

%K nonn,easy,nice

%O 1,3

%A _N. J. A. Sloane_

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 August 8 02:43 EDT 2024. Contains 375018 sequences. (Running on oeis4.)