The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A003814 Numbers k such that the continued fraction for sqrt(k) has odd period length. 50
2, 5, 10, 13, 17, 26, 29, 37, 41, 50, 53, 58, 61, 65, 73, 74, 82, 85, 89, 97, 101, 106, 109, 113, 122, 125, 130, 137, 145, 149, 157, 170, 173, 181, 185, 193, 197, 202, 218, 226, 229, 233, 241, 250, 257, 265, 269, 274, 277, 281, 290, 293, 298, 313, 314, 317 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
All primes of the form 4m + 1 are here. - T. D. Noe, Mar 19 2012
These numbers have no prime factors of the form 4m + 3. - Thomas Ordowski, Jul 01 2013
This sequence is a proper subsequence of the so-called 1-happy number products A007969. See the W. Lang link there, eq. (1), with B = 1, C = a(n), also with a table at the end. This is due to the soluble Pell equation R^2 - C*S^2 = -1 for C = a(n). See e.g., Perron, Satz 3.18. on p. 93, and the table on p. 91 with the numbers D of the first column that do not have a number in brackets in the second column (Teilnenner von sqrt(D)). - Wolfdieter Lang, Sep 19 2015
REFERENCES
W. Paulsen, Calkin-Wilf sequences for irrational numbers, Fib. Q., 61:1 (2023), 51-59.
O. Perron, Die Lehre von den Kettenbrüchen, Band I, Teubner Verlagsgesellschaft, Stuttgart, 1954.
Kenneth H. Rosen, Elementary Number Theory and Its Applications, Addison-Wesley, 1984, page 426 (but beware of errors!).
LINKS
Ray Chandler, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
S. R. Finch, Class number theory [Cached copy, with permission of the author]
P. J. Rippon and H. Taylor, Even and odd periods in continued fractions of square roots, Fibonacci Quarterly 42, May 2004, pp. 170-180.
MAPLE
isA003814 := proc(n)
local cf, p ;
if issqr(n) then
return false;
end if;
for p in numtheory[factorset](n) do
if modp(p, 4) = 3 then
return false;
end if;
end do:
cf := numtheory[cfrac](sqrt(n), 'periodic', 'quotients') ;
type( nops(op(2, cf)), 'odd') ;
end proc:
A003814 := proc(n)
option remember;
if n = 1 then
2;
else
for a from procname(n-1)+1 do
if isA003814(a) then
return a;
end if;
end do:
end if;
end proc:
seq(A003814(n), n=1..40) ; # R. J. Mathar, Oct 19 2014
MATHEMATICA
Select[Range[100], ! IntegerQ[Sqrt[#]] && OddQ[Length[ContinuedFraction[Sqrt[#]][[2]]]] &] (* T. D. Noe, Mar 19 2012 *)
PROG
(PARI)
cyc(cf) = {
if(#cf==1, return([])); \\ There is no cycle
my(s=[]);
for(k=2, #cf,
s=concat(s, cf[k]);
if(cf[k]==2*cf[1], return(s)) \\ Cycle found
);
0 \\ Cycle not found
}
select(n->#cyc(contfrac(sqrt(n)))%2==1, vector(400, n, n)) \\ Colin Barker, Oct 19 2014
CROSSREFS
Cf. A031396.
Cf. A206586 (period has positive even length).
Sequence in context: A281292 A145017 A031396 * A003654 A271787 A047617
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Walter Gilbert
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 24 11:32 EDT 2024. Contains 372773 sequences. (Running on oeis4.)