cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A206585 The least number s > 1 having exactly n fives in the periodic part of the continued fraction of sqrt(s).

This page as a plain text file.
%I A206585 #8 Jun 10 2017 22:33:32
%S A206585 2,27,67,664,331,6487,1237,6019,1999,6331,3964,23983,4204,22075,9739,
%T A206585 64639,10684,26419,17971,80719,22969,140971,28414,310759,34189,290779,
%U A206585 39181,228691,46099,261691,56884,416707,61429,136579,76651,535375,75916,296839,87151
%N A206585 The least number s > 1 having exactly n fives in the periodic part of the continued fraction of sqrt(s).
%H A206585 Chai Wah Wu, <a href="/A206585/b206585.txt">Table of n, a(n) for n = 0..1000</a>
%t A206585 nn = 50; zeros = nn; t = Table[0, {nn}]; k = 2; While[zeros > 0, If[! IntegerQ[Sqrt[k]], cnt = Count[ContinuedFraction[Sqrt[k]][[2]], 5]; If[cnt <= nn && t[[cnt]] == 0, t[[cnt]] = k; zeros--]]; k++]; Join[{2}, t]
%o A206585 (Python)
%o A206585 from sympy import continued_fraction_periodic
%o A206585 def A206585(n):
%o A206585     i = 2
%o A206585     while True:
%o A206585         s = continued_fraction_periodic(0,1,i)[-1]
%o A206585         if isinstance(s, list) and s.count(5) == n:
%o A206585             return i
%o A206585         i += 1 # _Chai Wah Wu_, Jun 10 2017
%Y A206585 Cf. A206578 (n ones), A206582 (n twos), A206583 (n threes), A206584 (n fours).
%K A206585 nonn
%O A206585 0,1
%A A206585 _T. D. Noe_, Mar 19 2012
%E A206585 Definition clarified by _Chai Wah Wu_, Jun 10 2017