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-2 of 2 results.

A380787 Odd positive integers k whose continued fraction for sqrt(k) has a central term equal to either floor(sqrt(k)) or floor(sqrt(k)) - 1.

Original entry on oeis.org

3, 7, 11, 19, 23, 27, 31, 43, 47, 51, 59, 67, 71, 79, 83, 103, 107, 119, 123, 127, 131, 139, 151, 163, 167, 171, 179, 187, 191, 199, 211, 223, 227, 239, 243, 251, 263, 267, 271, 283, 287, 291, 307, 311, 331, 339, 343, 347, 359, 363, 367, 379, 383, 387, 391
Offset: 1

Views

Author

Giorgos Kalogeropoulos, Feb 03 2025

Keywords

Comments

Conjecture: All terms are congruent to 3 mod 4 and all primes of this form (A002145) are terms of the sequence.

Examples

			71 is a term because the central element of CF(sqrt(71)) = [8; 2, 2, 1, 7, 1, 2, 2, 16] is 7 and floor(sqrt(71)) - 1 = 7.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,v;
      if issqr(n) then return false fi;
      L:= map(op, numtheory:-cfrac(sqrt(n),periodic,quotients));
      if nops(L)::even then return false fi;
      v:=L[(1+nops(L))/2]-floor(sqrt(n));
      v = 0 or v = -1
    end proc:
    select(filter, [seq(i,i=1..500,2); # Robert Israel, Mar 03 2025
  • Mathematica
    Select[2Range@200+1,(l=Last@ContinuedFraction@Sqrt[#]; m=l[[Floor[Length@l/2]]];m==Floor@Sqrt@#||m==Floor@Sqrt@#-1)&]

A308780 First element of the periodic part of the continued fraction expansion of sqrt(k), where the period is 2.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 2, 1, 5, 2, 1, 6, 4, 3, 2, 1, 7, 2, 1, 8, 4, 2, 1, 9, 6, 3, 2, 1, 10, 5, 4, 2, 1, 11, 2, 1, 12, 8, 6, 4, 3, 2, 1, 13, 2, 1, 14, 7, 4, 2, 1, 15, 10, 6, 5, 3, 2, 1, 16, 8, 4, 2, 1, 17, 2, 1, 18, 12, 9, 6, 4, 3, 2, 1, 19, 2, 1
Offset: 1

Views

Author

Georg Fischer, Jun 24 2019

Keywords

Examples

			The continued fractions for sqrt(3..8) are:
   3 1;1,2
   4 2 (square)
   5 2;4
   6 2;2,4
   7 2;1,1,1,4
   8 2;1,4
Those for 3, 6 and 8 have a period of 2, therefore the sequence starts with 1, 2, 1.
		

Crossrefs

Programs

  • Maple
    s := proc(n) if not issqr(n) then numtheory[cfrac](sqrt(n), 'periodic', 'quotients')[2]; if nops(%) = 2 then return %[1] fi fi; NULL end:
    seq(s(n), n=1..399); # Peter Luschny, Jul 01 2019
  • Mathematica
    Reap[For[k = 3, k <= 399, k++, If[!IntegerQ[Sqrt[k]], cf = ContinuedFraction[Sqrt[k]]; If[Length[cf[[2]]] == 2, Sow[cf[[2, 1]]]]]]][[2, 1]] (* Jean-François Alcover, May 03 2024 *)
    (* Second program (much simpler): *)
    Table[2 a/b, {a, 1, 20}, {b, Rest@Divisors[2 a]}] // Flatten (* Jean-François Alcover, May 04 2024, after a remark by Kevin Ryde *)
Showing 1-2 of 2 results.