login
A077426
Nonsquare integers k such that the continued fraction (sqrt(k)+1)/2 has odd period length.
10
5, 13, 17, 29, 37, 41, 53, 61, 65, 73, 85, 89, 97, 101, 109, 113, 125, 137, 145, 149, 157, 173, 181, 185, 193, 197, 229, 233, 241, 257, 265, 269, 277, 281, 293, 313, 317, 325, 337, 349, 353, 365, 373, 389, 397, 401, 409, 421, 425, 433, 445, 449, 457, 461, 481, 485
OFFSET
1,1
COMMENTS
Nonsquare integers k for which Pell equation x^2 - k*y^2 = -4 has infinitely many integer solutions. The smallest solutions are given in A078356 and A078357.
REFERENCES
O. Perron, "Die Lehre von den Kettenbruechen, Bd.I", Teubner, 1954, 1957 (Sec. 30, table p. 108).
LINKS
Wikipedia, Pell's equation
MAPLE
isOddPrim := proc(n::integer)
local cf;
cf := numtheory[cfrac]((sqrt(n)+1)/2, 'periodic', 'quotients') ;
if nops(op(2, cf)) mod 2 =1 then
RETURN(true) ;
else
RETURN(false) ;
fi ;
end:
notA077426 := proc(n::integer)
if issqr(n) then
RETURN(true) ;
elif not isOddPrim(n) then
RETURN(true) ;
else
RETURN(false) ;
fi ;
end:
A077426 := proc(n::integer)
local resul, i ;
resul := 5 ;
i := 1 ;
while i < n do
resul := resul+4 ;
while notA077426(resul) do
resul := resul+4 ;
od ;
i:= i+1 ;
od ;
RETURN(resul) ;
end:
for n from 1 to 61 do print(A077426(n)) ; od : # R. J. Mathar, Apr 25 2006
MATHEMATICA
fQ[n_] := !IntegerQ@ Sqrt@ n && OddQ@ Length@ ContinuedFraction[(Sqrt@ n + 1)/2][[2]]; Select[Range@ 500, fQ] (* Robert G. Wilson v, Nov 17 2012 *)
PROG
(Python)
from itertools import count
from sympy.solvers.diophantine.diophantine import diop_DN
def A077426_gen(startvalue=3): # generator of terms >= startvalue
return filter(lambda n: len(diop_DN(n, -1)), count(max(startvalue+(startvalue&1^1), 3), 2)) # Chai Wah Wu, Dec 21 2025
CROSSREFS
A subsequence of A077425.
Odd elements of A003814.
Sequence in context: A359151 A191218 A279857 * A231754 A387595 A175768
KEYWORD
nonn,easy
AUTHOR
Wolfdieter Lang, Nov 29 2002
EXTENSIONS
Edited and extended by Max Alekseyev, Mar 03 2010
Edited by Max Alekseyev, Mar 05 2010
STATUS
approved