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.

A100251 The square root of A100252; the index of the least square number greater than 1 that is also an n-gonal number, or 0 if none exists.

Original entry on oeis.org

6, 2, 99, 35, 9, 15, 3, 0, 14, 8, 6, 21, 55, 4, 133, 10, 22, 0, 51, 27, 261, 15, 5, 85, 161, 9, 35, 451, 21, 33, 69, 14, 124, 6, 44, 715, 28, 24, 7421, 217, 34, 16, 23001, 54, 1065, 36, 7, 76, 156, 0, 245
Offset: 3

Views

Author

Charlie Marion, Nov 21 2004

Keywords

Comments

Let j be the smallest integer for which 1 + (1+1*n) + (1+2*n) + ... + (1+j*n) = k^2 = s. Then a(n)=k; if no such j exists, then a(n)=0. Basis for sequence is shortest arithmetic series with initial term 1 and difference n that sums to a perfect square.

Examples

			a(3)=99 since 1 + 4 + 7 + ... + (1+80*3) = 99^2 = 9801 and no other arithmetic series with initial term 1, difference 3 and fewer terms sums to a perfect square.
		

Crossrefs

Programs

  • Mathematica
    NgonIndex[n_, v_] := (-4 + n + Sqrt[16 - 8*n + n^2 - 16*v + 8*n*v])/(n - 2)/2; Table[k = 2; While[sqr = k^2; i = NgonIndex[n, sqr]; k < 25000 && ! IntegerQ[i], k++]; If[k == 25000, k = sqr = i = 0]; k, {n, 3, 64}] (* T. D. Noe, Apr 19 2011 *)

Formula

a(n)^2 = 1 + (1+1*n) + (1+2*n) + ... + (1+A100254(n)*n) = 1 + (1+1*n) +(1+2*n) + ... + A100253(n).
a(n)^2 = A100252(n).