login
A101159
Let j be the smallest integer for which n+(n+1)+...+(n+j) is a square; then a(n) = n+j.
4
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,2
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.
LINKS
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
EXAMPLE
a(11)=13 since j=13 is the smallest integer such that 11+...+j=6^2=36 is a perfect square.
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Charlie Marion, Dec 29 2004
EXTENSIONS
More terms from Michel Marcus, Jun 28 2013
STATUS
approved