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.

Showing 1-1 of 1 results.

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).

Original entry on oeis.org

7, 13, 32, 41, 55, 58, 74, 75, 130, 135, 136, 180, 185, 215, 269, 312, 335, 346, 370, 377, 425, 427, 458, 557, 560, 646, 697, 711, 818, 819, 880, 925, 986, 987, 1064, 1067, 1129, 1130, 1272, 1313, 1325, 1326, 1400, 1462, 1490, 1495, 1613, 1714, 1736, 1885
Offset: 1

Views

Author

Gerhard Kirchner, Feb 02 2020

Keywords

Comments

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.
General aspect: If [m;[c,c,...,c,2m]] is an integer, it belongs to a quadratic subsequence, see link "Special periodic continued fractions".
The four sequences below, see formula, cover 336 of the first 500 terms.

Examples

			7  = [2; [1, 1, 1, 4]]
13 = [3; [1, 1, 1, 1, 6]]
32 = [5; [1, 1, 1, 10]]
41 = [6; [2, 2, 12]]
55 = [7; [2, 2, 2, 14]]
		

Crossrefs

Cf. A320773.

Programs

  • Mathematica
    a:={};For[k=0, k<2000, k++, b:=Last[ContinuedFraction[Sqrt[k]]]; p:=Length[b]; If[p>2, For[i=2, iStefano Spezia, Feb 04 2020 *)
  • Maxima
    block([an: 2,  n: 0,  nmax: 100],
    /*transfers the first nmax terms to a file in the current directory*/
       fl: openw(concat("terms-A331960-",nmax, ".txt")),
        while n m and mod(2*m,an-m^2)>0 then
           (a: m, i: 0, x: w, ok: true,
            while a<2*m and ok do
             (i: i+1, x: 1/(x-floor(x)),
              a: floor(x),
              if i=1 then c: a
              elseif a # c and a<2*m then ok: false),
         if ok then(n: n+1, printf( fl, "~d, ", an)))),
       close(fl));

Formula

Formulas for some quadratic subsequences:
p,c formula first term a(1) thru a(500)
(k=1) frequency
4,1 (3k-1)^2 + 4k-1 a(1) = 7 125
5,1 (5k-2)^2 + 6k-2 a(2) = 13 75
3,2 (5k+1)^2 + 4k+1 a(4) = 41 74
4,2 (6k+1)^2 + 5k+1 a(5) = 55 62
Showing 1-1 of 1 results.