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.

A031509 Numbers k such that the continued fraction for sqrt(k) has even period and if the last term of the periodic part is deleted the central term is 11.

Original entry on oeis.org

123, 127, 131, 139, 151, 163, 167, 488, 512, 520, 544, 608, 640, 672, 1095, 1167, 1383, 1455, 1515, 1944, 2008, 2136, 2264, 2456, 2648, 2696, 3035, 3115, 3215, 3235, 3415, 3515, 3635, 3715, 3735, 3835, 3935, 4115, 4135, 4215, 4368, 4944, 5496, 5943, 5971
Offset: 1

Views

Author

Keywords

Examples

			The c.f. expansion of sqrt(127) is 11, [3, 1, 2, 2, 7, 11, 7, 2, 2, 1, 3, 22], [3, 1, 2, 2, 7, 11, 7, 2, 2, 1, 3, 22], ... If the 22 is deleted from the periodic part the central term is 11. - _N. J. A. Sloane_, Aug 17 2021
		

Programs

  • Maple
    # Maple 2016 or later.
    filter:= proc(n) uses NumberTheory; local R;
      if issqr(n) then return false fi;
      R:= Term(ContinuedFraction(sqrt(n)),periodic)[2];
      nops(R)::even and R[nops(R)/2] = 11
    end proc:
    select(filter, [$2..10000]); # Robert Israel, Jun 07 2019
  • Mathematica
    okQ[k_] := Module[{c, lc}, If[IntegerQ[Sqrt[k]], False,
         c = ContinuedFraction[Sqrt[k]]; lc = Length[c[[2]]];
         EvenQ[lc] && c[[2, lc/2]] == 11]];
    Select[Range[10000], okQ] (* Jean-François Alcover, Jul 09 2021 *)

Extensions

Definitions of A031509-A031598 clarified by N. J. A. Sloane, Aug 17 2021