OFFSET
0,1
COMMENTS
It appears that only the odd-numbered terms 3 and 7 are prime; all other primes occur at even-numbered terms 0, 4, 6, 12, 16, 22, 28, 30, 34, ... In terms 0 to 1000, there are 268 primes and 632 semiprimes.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..10000 (terms 0..1000 from T. D. Noe)
MATHEMATICA
nn = 50; zeros = nn; t = Table[0, {nn}]; k = 2; While[zeros > 0, If[! IntegerQ[Sqrt[k]], cnt = Count[ContinuedFraction[Sqrt[k]][[2]], 1]; If[cnt <= nn && t[[cnt]] == 0, t[[cnt]] = k; zeros--]]; k++]; Join[{2}, t]
PROG
(Python)
from sympy import continued_fraction_periodic
def A206578(n):
m = 1
while True:
s = continued_fraction_periodic(0, 1, m)[-1]
if isinstance(s, list) and s.count(1) == n:
return m
m += 1 # Chai Wah Wu, Jun 12 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Feb 24 2012
STATUS
approved