OFFSET
1,1
COMMENTS
This sequence is sorted A146363.
LINKS
Robert Israel, Table of n, a(n) for n = 1..1500
MAPLE
g:= proc(n) local c;
c:= NumberTheory:-ContinuedFraction((1+sqrt(n))/2);
nops(Term(c, periodic)[2]);
end proc:
R:= NULL: S:= {}: count:= 0:
p:= 1:
while count < 100 do
p:= nextprime(p);
v:= g(p);
if not member(v, S) then
R:= R, p; count:= count+1; S:= S union {v};
if count mod 20 = 0 then printf("%d %d\n", count, p) fi
fi
od:
R; # Robert Israel, Jun 14 2024
MATHEMATICA
$MaxExtraPrecision = 300; s = 10; aa = {}; Do[k = ContinuedFraction[(1 + Sqrt[n])/2, 1000]; If[Length[k] < 190, AppendTo[aa, 0], m = 1; While[k[[s ]] != k[[s + m]] || k[[s + m]] != k[[s + 2 m]] || k[[s + 2 m]] != k[[s + 3 m]] || k[[s + 3 m]] != k[[s + 4 m]], m++ ]; s = s + 1; While[k[[s ]] != k[[s + m]] || k[[s + m]] != k[[s + 2 m]] || k[[s + 2 m]] != k[[s + 3 m]] || k[[s + 3 m]] != k[[s + 4 m]], m++ ]; AppendTo[aa, m]], {n, 1, 1200}]; Print[aa]; bb = {}; Do[k = 1; yes = 0&&PeimeQ[k]; Do[If[aa[[k]] == n && yes == 0, AppendTo[bb, k]; yes = 1], {k, 1, Length[aa]}], {n, 1, 22}]; Sort[bb] (*Artur Jasinski*)
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Oct 30 2008
EXTENSIONS
More terms from Robert Israel, Jun 14 2024
STATUS
approved