This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A077427 #5 Mar 31 2012 13:20:11 %S A077427 1,1,3,2,1,4,3,5,2,1,6,3,3,4,9,2,1,7,2,9,3,6,7,7,2,1,10,4,7,4,3,5,8,5, %T A077427 10,2,1,12,5,3,4,15,3,14,4,12,4,16,2,1,9,2,19,2,16,6,3,8,11,5,6,9,15, %U A077427 2,1,10,10,4,6,19,3,4,3,16 %N A077427 Primitive period length of (regular) continued fraction of (sqrt(D(n))+1)/2 for D(n)=A077425(n). %C A077427 The Pell equation x^2 - D(n)*y^2 = -4 has (infinitely many integer) solutions if and only if a(n) is odd. %D A077427 O. Perron, "Die Lehre von den Kettenbruechen, Bd.I", Teubner, 1954, 1957 (Sec. 30, Satz 3.35, p. 109). %e A077427 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. %e A077427 a(4)=2 is even and D(4)=A077425(4)=21, hence x^2 - 21*y^2 = -4 has no nontrivial integer solution. %e A077427 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. %Y A077427 Cf. A077426. %K A077427 nonn,easy %O A077427 1,3 %A A077427 _Wolfdieter Lang_, Nov 29 2002