|
|
A086882
|
|
a(n) is the period of the imaginary continued fraction expansion of sqrt(-n).
|
|
0
|
|
|
0, 0, 2, 2, 0, 4, 4, 5, 4, 0, 6, 6, 6, 10, 8, 6, 0, 8, 8, 10, 8, 10, 12, 11, 8, 0, 10, 10, 12, 16, 10, 17, 11, 12, 14, 10, 0, 12, 12, 12, 12, 16, 12, 16, 16, 16, 26, 17, 12, 0, 14, 14, 16, 22, 16, 16, 14, 16, 20, 18, 16, 36, 20, 14, 0, 16, 16, 22, 16, 26, 18, 27, 16, 30, 20, 17, 26, 22
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Numbers n for which a(n) is odd seem to be a subset of numbers n for which A003285(n) is a multiple of 4. - Thomas Baruchel, Jul 03 2007
|
|
LINKS
|
|
|
EXAMPLE
|
a(7) = 5 because sqrt(-7) = [2i, -2i, {-3i, -2i, -2i, -2i, -3i},...].
|
|
PROG
|
(PARI) complex_period(n)= { local(a, b, c, d, k, oa, oc, i, s); s=sqrtint(n); if(issquare(c=n), 0, until(c==oc, oc=c; oa=a; if((a = (n-b^2)/c) == oa, return(2*i)); i += (k = (s-b)\a); d = a*k+b; c = (n-d^2)/a; b = (s+d)%c-s); 2*i-k); }
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|