A299173 a(n) is the maximum number of squared consecutive positive integers into which the integer n can be partitioned.
1, 0, 0, 1, 2, 0, 0, 0, 1, 0, 0, 0, 2, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 4, 5, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 2, 4, 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 1
Examples
25 = 5^2 = 3^2 + 4^2 and no such partition is longer, so a(25) = 2. 30 = 1^2 + 2^2 + 3^2 + 4^2 and no such partition is longer, so a(30) = 4. 2018 = 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2 + 13^2 + 14^2 + 15^2 + 16^2 + 17^2 + 18^2 and no such partition is longer, so a(2018) = 12. (This special example is due to _Seiichi Manyama_.) - _Jean-François Alcover_, Feb 05 2018
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
N:= 200: # to get a(1)..a(N) A:= Vector(N): S:= n -> n*(n+1)*(2*n+1)/6: M:= floor(sqrt(N)): for d from 1 to M do for b from d to M do s:= S(b) - S(b-d); if s > N then break fi; A[s]:= d od od: convert(A,list); # Robert Israel, Feb 04 2018
-
Mathematica
terms = 100; jmax = Ceiling[Sqrt[terms]]; kmax = Ceiling[(3*terms)^(1/3)]; Clear[a]; a[_] = 0; Do[r = Range[j, j + k - 1]; n = r . r; If[k > a[n], a[n] = k], {j, jmax}, {k, kmax}]; Array[a, terms]
Comments