

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

Table of n, a(n) for n=0..77.


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 = (nb^2)/c) == oa, return(2*i)); i += (k = (sb)\a); d = a*k+b; c = (nd^2)/a; b = (s+d)%cs); 2*ik); }


CROSSREFS

Cf. A003285.
Sequence in context: A307076 A342472 A308720 * A341415 A328141 A168587
Adjacent sequences: A086879 A086880 A086881 * A086883 A086884 A086885


KEYWORD

easy,nonn


AUTHOR

Thomas Baruchel, Aug 22 2003


EXTENSIONS

Edited by Don Reble, Jul 31 2006


STATUS

approved



