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.

A331960 Integers whose square root has a continued fraction [b(0);[b(1),...,b(p)]] with a period p > 2 such that b(1)=b(2)=...=b(p-1).

This page as a plain text file.
%I A331960 #31 Apr 24 2020 16:27:47
%S A331960 7,13,32,41,55,58,74,75,130,135,136,180,185,215,269,312,335,346,370,
%T A331960 377,425,427,458,557,560,646,697,711,818,819,880,925,986,987,1064,
%U A331960 1067,1129,1130,1272,1313,1325,1326,1400,1462,1490,1495,1613,1714,1736,1885
%N A331960 Integers whose square root has a continued fraction [b(0);[b(1),...,b(p)]] with a period p > 2 such that b(1)=b(2)=...=b(p-1).
%C A331960 Any periodic continued fraction represents a rational number, in particular [b(0);[c,c,...,c,b(p)]]. An integer requires b(p)=2*b(0). The exclusion of p < 3 makes sense because there should be at least two constant c-terms. Note that, with m=a0, the terms associated with the continued fractions [m;[2m]] (p=1) and [m;[c,2m]] (p=2) are those in A320773.
%C A331960 General aspect: If [m;[c,c,...,c,2m]] is an integer, it belongs to a quadratic subsequence, see link "Special periodic continued fractions".
%C A331960 The four sequences below, see formula, cover 336 of the first 500 terms.
%H A331960 Gerhard Kirchner, <a href="/A331960/a331960_1.pdf">Special periodic continued fractions</a>
%F A331960 Formulas for some quadratic subsequences:
%F A331960 p,c        formula       first term  a(1) thru a(500)
%F A331960                             (k=1)       frequency
%F A331960 4,1   (3k-1)^2 + 4k-1     a(1) =  7        125
%F A331960 5,1   (5k-2)^2 + 6k-2     a(2) = 13         75
%F A331960 3,2   (5k+1)^2 + 4k+1     a(4) = 41         74
%F A331960 4,2   (6k+1)^2 + 5k+1     a(5) = 55         62
%e A331960 7  = [2; [1, 1, 1, 4]]
%e A331960 13 = [3; [1, 1, 1, 1, 6]]
%e A331960 32 = [5; [1, 1, 1, 10]]
%e A331960 41 = [6; [2, 2, 12]]
%e A331960 55 = [7; [2, 2, 2, 14]]
%t A331960 a:={};For[k=0, k<2000, k++, b:=Last[ContinuedFraction[Sqrt[k]]]; p:=Length[b]; If[p>2, For[i=2, i<p&& Extract[b, 1]==Extract[b, i], i++, If[i==p-1, AppendTo[a,k]]]]]; a (* _Stefano Spezia_, Feb 04 2020 *)
%o A331960 (Maxima) block([an: 2,  n: 0,  nmax: 100],
%o A331960 /*transfers the first nmax terms to a file in the current directory*/
%o A331960    fl: openw(concat("terms-A331960-",nmax, ".txt")),
%o A331960     while n<nmax do
%o A331960     (an: an+1, w: sqrt(an), m: floor(w),
%o A331960      if w > m and mod(2*m,an-m^2)>0 then
%o A331960        (a: m, i: 0, x: w, ok: true,
%o A331960         while a<2*m and ok do
%o A331960          (i: i+1, x: 1/(x-floor(x)),
%o A331960           a: floor(x),
%o A331960           if i=1 then c: a
%o A331960           elseif a # c and a<2*m then ok: false),
%o A331960      if ok then(n: n+1, printf( fl, "~d, ", an)))),
%o A331960    close(fl));
%Y A331960 Cf. A320773.
%K A331960 nonn
%O A331960 1,1
%A A331960 _Gerhard Kirchner_, Feb 02 2020