login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A096493
Number of distinct primes in continued fraction period of square root of n.
5
0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 1, 1, 1, 0, 0, 0, 1, 2, 1, 1, 2, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 1, 2, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 3, 0, 1, 1, 2, 1, 1, 0, 0, 2, 2, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 0, 3, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0
OFFSET
1,19
LINKS
EXAMPLE
n=127: the period={3,1,2,2,7,11,7,2,2,1,3,22},
distinct-primes={2,3,7,11}, so a[127]=4;
MATHEMATICA
{te=Table[0, {m}], u=1}; Do[s=Count[PrimeQ[Union[Last[ContinuedFraction[n^(1/2)]]]], True]; te[[u]]=s; u=u+1, {n, 1, m}]; te
dpcf[n_]:=Module[{s=Sqrt[n]}, If[IntegerQ[s], 0, Count[Union[ ContinuedFraction[ s][[2]]], _?PrimeQ]]]; Array[dpcf, 110] (* Harvey P. Dale, Mar 18 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jun 29 2004
STATUS
approved