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.
a(n) is the least k>0 such that triangular(n-1) + k^2 is a triangular number. - Alex Ratushnyak, May 17 2013
LINKS
Shawn A. Broyles, Table of n, a(n) for n = 1..1000
FORMULA
a(n^2) = n. - Michel Marcus, Jun 28 2013
EXAMPLE
a(11)=6 since 11+12+13 = 6^2.
PROG
(PARI) a(n) = {j = 0; while(! issquare(v=sum(k=0, j, n+k)), j++); sqrtint(v); } \\ Michel Marcus, Sep 01 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Charlie Marion, Dec 29 2004
EXTENSIONS
More terms from Michel Marcus, Jun 28 2013
STATUS
approved