cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A299173 a(n) is the maximum number of squared consecutive positive integers into which the integer n can be partitioned.

Original entry on oeis.org

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

Views

Author

Jean-François Alcover, Feb 04 2018

Keywords

Comments

a(k^2)>=1, the inequality being strict if k is in A097812.

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
		

Crossrefs

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]