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!)
A296338 a(n) = number of partitions of n into consecutive positive squares. 6

%I #72 Apr 18 2019 22:04:30

%S 1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,2,0,0,0,1,1,0,0,0,0,

%T 0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,

%U 0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,0,1,1

%N a(n) = number of partitions of n into consecutive positive squares.

%H Seiichi Manyama, <a href="/A296338/b296338.txt">Table of n, a(n) for n = 1..10000</a>

%F a(A034705(n)) >= 1 for n > 1.

%F G.f.: Sum_{i>=1} Sum_{j>=i} Product_{k=i..j} x^(k^2). - _Ilya Gutkovskiy_, Apr 18 2019

%e 1 = 1^2, so a(1) = 1.

%e 4 = 2^2, so a(4) = 1.

%e 5 = 1^2 + 2^2, so a(5) = 1.

%e 9 = 3^2, so a(9) = 1.

%e 13 = 2^2 + 3^2, so a(13) = 1.

%e 14 = 1^2 + 2^2 + 3^2, so a(14) = 1.

%e 16 = 4^2, so a(16) = 1.

%e 25 = 3^2 + 4^2 = 5^2, so a(25) = 2.

%e 29 = 2^2 + 3^2 + 4^2, so a(29) = 1.

%e 30 = 1^2 + 2^2 + 3^2 + 4^2, so a(30) = 1.

%t nMax = 100; t = {0}; Do[k = n; s = 0; While[s = s + k^2; s <= nMax, AppendTo[t, s]; k++], {n, 1, nMax}]; tt = Tally[t]; a[_] = 0; Do[a[tt[[i, 1]]] = tt[[i, 2]], {i, 1, Length[tt]}]; Table[a[n], {n, 1, nMax}] (* _Jean-François Alcover_, Feb 04 2018, using _T. D. Noe_'s program for A034705 *)

%o (Ruby)

%o def A296338(n)

%o m = Math.sqrt(n).to_i

%o ary = Array.new(n + 1, 0)

%o (1..m).each{|i|

%o sum = i * i

%o ary[sum] += 1

%o i += 1

%o sum += i * i

%o while sum <= n

%o ary[sum] += 1

%o i += 1

%o sum += i * i

%o end

%o }

%o ary[1..-1]

%o end

%o p A296338(100)

%Y Cf. A000290, A001227, A034705, A130052, A234304, A297199, A298467, A299173.

%K nonn

%O 1,25

%A _Seiichi Manyama_, Jan 14 2018

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 April 19 14:10 EDT 2024. Contains 371792 sequences. (Running on oeis4.)