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.

A101159 Let j be the smallest integer for which n+(n+1)+...+(n+j) is a square; then a(n) = n+j.

Original entry on oeis.org

1, 4, 7, 4, 13, 16, 19, 22, 9, 28, 13, 13, 37, 40, 43, 16, 49, 22, 55, 58, 28, 64, 67, 25, 25, 28, 79, 82, 85, 88, 91, 40, 97, 100, 40, 36, 44, 112, 49, 41, 121, 124, 47, 130, 53, 58, 49, 142, 49, 148, 151, 69, 67, 160, 163, 166, 64, 67, 175, 61
Offset: 1

Views

Author

Charlie Marion, Dec 29 2004

Keywords

Comments

Basis for sequence is shortest arithmetic sequence with initial term n and difference 1 that sums to a perfect square. Cf. A100251, A100252, A100253, A100254.

Examples

			a(11)=13 since j=13 is the smallest integer such that 11+...+j=6^2=36 is a perfect square.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(j = 0); while(! issquare(sum(k=0, j, n+k)), j++); n+j;} \\ Michel Marcus, May 02 2018
    
  • PARI
    a(n) = my(s = n, t = 0); while(!issquare(s), s += n + t++); n + t \\ David A. Corneth, May 05 2018

Formula

n+(n+1)+...+(n+A101160(n)) = n+(n+1)+...+a(n) = A101157(n)^2 = A101158(n).
a(n^2) = n^2. - Michel Marcus, Jun 28 2013
a(n) <= 3*n - 2. - David A. Corneth, May 03 2018

Extensions

More terms from Michel Marcus, Jun 28 2013