OFFSET
1,3
COMMENTS
The Pell equation x^2 - D(n)*y^2 = -4 has (infinitely many integer) solutions if and only if a(n) is odd.
REFERENCES
O. Perron, "Die Lehre von den Kettenbruechen, Bd.I", Teubner, 1954, 1957 (Sec. 30, Satz 3.35, p. 109).
EXAMPLE
a(6)=4 because the (periodic) continued fraction for (sqrt(D(6))+1)/2 = (sqrt(33)+1)/2 = 3.372281324... is [3, periodic(2, 1, 2, 5,)] with period length 4. Because these continued fractions are always of the form [b(0),periodic(b(1),b(2),...,b(2),b(1),2*b(0)-1,)] with the symmetric piece b(1),b(2),..., b(2),b(1), Perron op. cit. writes for this b(0),b(1),b(2),...,(b(k/2)) if the period length k is even and b(0),b(1),b(2),...,b((k-1)/2) if the period length is odd. In this example: k=4 and Perron writes 3,2,(1). Another example: D(8)= A077425(8)=41 leads to Perron's 3,1,2 standing for [3,periodic(1,2,2,1,5,)], the continued fraction for (sqrt(41)+1)/2 which has odd period length a(8)=5.
a(4)=2 is even and D(4)=A077425(4)=21, hence x^2 - 21*y^2 = -4 has no nontrivial integer solution.
a(8)=5 is odd and D(8)=A077425(8)=41, hence x^2 - 41*y^2 = -4 is solvable (with nontrivial integers) as well as x^2 - 41*y^2 = +4.
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wolfdieter Lang, Nov 29 2002
STATUS
approved