OFFSET
1,2
COMMENTS
The ansatz n*(n+1)/2+i=s^2 can be transformed into (2*n+1)^2-2*(2*s)^2 =1-8*i.
A necessary condition for solutions to this Diophantine equation is that D=2 is a quadratic residue of the squarefree part of 8*i-1 (see A057126).
A sufficient condition is then available by a sequence of tests on the continued fractions of a quadratic surd that originates from a solution of this congruence.
See Mollin and Matthews for details. - R. J. Mathar, Nov 16 2009
LINKS
R. A. Mollin, Simple continued fraction solutions for Diophantine Equations, Exposit. Mathem. 19 (2001) 55-73.
Keith Matthews, The Diophantine equation x^2-Dy^2=N,D >0, Exposit. Mathem. 18 (4) (2000) 323-331 [MR1788328].
MATHEMATICA
Take[Rest[Ceiling[Sqrt[#]]^2-#&/@Accumulate[Range[1000]]//Union], 70] (* Harvey P. Dale, Sep 07 2019 *)
PROG
(PARI) is(n)=#bnfisintnorm(bnfinit(z^2-8), -8*n+1) /* Ralf Stephan, Oct 14 2013 */
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Ctibor O. Zizka, Nov 10 2009
EXTENSIONS
Extended by R. J. Mathar, Nov 26 2009
STATUS
approved