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

%I #24 May 19 2018 09:49:52

%S 1,4,7,4,13,16,19,22,9,28,13,13,37,40,43,16,49,22,55,58,28,64,67,25,

%T 25,28,79,82,85,88,91,40,97,100,40,36,44,112,49,41,121,124,47,130,53,

%U 58,49,142,49,148,151,69,67,160,163,166,64,67,175,61

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

%C 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.

%H Shawn A. Broyles, <a href="/A101159/b101159.txt">Table of n, a(n) for n = 1..1000</a>

%F n+(n+1)+...+(n+A101160(n)) = n+(n+1)+...+a(n) = A101157(n)^2 = A101158(n).

%F a(n^2) = n^2. - _Michel Marcus_, Jun 28 2013

%F a(n) <= 3*n - 2. - _David A. Corneth_, May 03 2018

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

%o (PARI) a(n) = {my(j = 0); while(! issquare(sum(k=0, j, n+k)), j++); n+j;} \\ _Michel Marcus_, May 02 2018

%o (PARI) a(n) = my(s = n, t = 0); while(!issquare(s), s += n + t++); n + t \\ _David A. Corneth_, May 05 2018

%Y Cf. A101157, A101158, A101160, A108269.

%K nonn

%O 1,2

%A _Charlie Marion_, Dec 29 2004

%E More terms from _Michel Marcus_, Jun 28 2013