OFFSET
1,2
COMMENTS
Equivalently, smallest k such that n(n+2k-1)/2 is a square, 0 if there is no such square. - Ralf Stephan, Mar 23 2003
a(n)=0 if and only if n has the form 4^e*m with e > 0 and m odd. - Dean Hickerson, Mar 25 2003
a(k) = 1 if k is the index of a square triangular number, i.e., k(k+1)/2 is a square, or if k belongs to A001108. If n is odd then a(n) <= (n+1)/2.
LINKS
Clement Martin, Table of n, a(n) for n = 1..10000
EXAMPLE
a(2) = 4, 4+5 = 9 = 3^2. a(8) = 1, 1+2+3+4+5+6+7+8 = 36 = 6^2.
PROG
(PARI) for(n=1, 100, o=n*(n+1)/2:k=0:while(k<10^5&&!issquare(o+n*k), k=k+1): if(k>=10^5, k=-1):print1(k+1", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Oct 09 2002
EXTENSIONS
More terms from Ralf Stephan, Mar 23 2003
STATUS
approved