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.

A190798 Maximum value of k^2 * (n-k).

Original entry on oeis.org

0, 0, 1, 4, 9, 18, 32, 50, 75, 108, 147, 196, 256, 324, 405, 500, 605, 726, 864, 1014, 1183, 1372, 1575, 1800, 2048, 2312, 2601, 2916, 3249, 3610, 4000, 4410, 4851, 5324, 5819, 6348, 6912, 7500, 8125, 8788, 9477, 10206, 10976, 11774, 12615, 13500, 14415, 15376, 16384, 17424, 18513, 19652, 20825, 22050, 23328, 24642, 26011, 27436, 28899, 30420, 32000
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A002620 (max of k * (n-k)).

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); [0,0] cat Coefficients(R!(x^2*(1+x)^2*(1+x^2)/((1-x)^4*(1+x+x^2)^2))); // G. C. Greubel, Aug 13 2018
  • Mathematica
    CoefficientList[Series[x^2*(1+x)^2*(1+x^2)/((1-x)^4*(1+x+x^2)^2), {x, 0, 50}], x] (* G. C. Greubel, Aug 13 2018 *)
  • PARI
    a(n)=my(k=2*n\/3);k^2*(n-k) \\ Charles R Greathouse IV, May 20 2011
    

Formula

a(n) = k^2 * (n-k), where k = round(2*n/3).
a(3*n) = 4*n^3, a(3*n-1) = n*(2*n-1)^2, a(3*n+1) = n*(2*n+1)^2.
O.g.f.: x^2*(1+x)^2*(1+x^2)/((1-x)^4*(1+x+x^2)^2).
a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) - 4*a(n-4) + 2*a(n-5) - a(n-6) + 2*a(n-7) - a(n-8) for n >= 8.
a(-n) = -a(n). - Michael Somos, May 22 2011