A296338 a(n) = number of partitions of n into consecutive positive squares.
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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1
Offset: 1
Keywords
Examples
1 = 1^2, so a(1) = 1. 4 = 2^2, so a(4) = 1. 5 = 1^2 + 2^2, so a(5) = 1. 9 = 3^2, so a(9) = 1. 13 = 2^2 + 3^2, so a(13) = 1. 14 = 1^2 + 2^2 + 3^2, so a(14) = 1. 16 = 4^2, so a(16) = 1. 25 = 3^2 + 4^2 = 5^2, so a(25) = 2. 29 = 2^2 + 3^2 + 4^2, so a(29) = 1. 30 = 1^2 + 2^2 + 3^2 + 4^2, so a(30) = 1.
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
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 *)
-
Ruby
def A296338(n) m = Math.sqrt(n).to_i ary = Array.new(n + 1, 0) (1..m).each{|i| sum = i * i ary[sum] += 1 i += 1 sum += i * i while sum <= n ary[sum] += 1 i += 1 sum += i * i end } ary[1..-1] end p A296338(100)
Formula
a(A034705(n)) >= 1 for n > 1.
G.f.: Sum_{i>=1} Sum_{j>=i} Product_{k=i..j} x^(k^2). - Ilya Gutkovskiy, Apr 18 2019