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.

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.

This page as a plain text file.
%I A380787 #12 Mar 04 2025 07:35:12
%S A380787 3,7,11,19,23,27,31,43,47,51,59,67,71,79,83,103,107,119,123,127,131,
%T A380787 139,151,163,167,171,179,187,191,199,211,223,227,239,243,251,263,267,
%U A380787 271,283,287,291,307,311,331,339,343,347,359,363,367,379,383,387,391
%N 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.
%C A380787 Conjecture: All terms are congruent to 3 mod 4 and all primes of this form (A002145) are terms of the sequence.
%H A380787 Robert Israel, <a href="/A380787/b380787.txt">Table of n, a(n) for n = 1..8300</a>
%e A380787 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.
%p A380787 filter:= proc(n) local L,v;
%p A380787   if issqr(n) then return false fi;
%p A380787   L:= map(op, numtheory:-cfrac(sqrt(n),periodic,quotients));
%p A380787   if nops(L)::even then return false fi;
%p A380787   v:=L[(1+nops(L))/2]-floor(sqrt(n));
%p A380787   v = 0 or v = -1
%p A380787 end proc:
%p A380787 select(filter, [seq(i,i=1..500,2); # _Robert Israel_, Mar 03 2025
%t A380787 Select[2Range@200+1,(l=Last@ContinuedFraction@Sqrt[#]; m=l[[Floor[Length@l/2]]];m==Floor@Sqrt@#||m==Floor@Sqrt@#-1)&]
%Y A380787 Cf. A002145, A010335, A308778.
%K A380787 nonn
%O A380787 1,1
%A A380787 _Giorgos Kalogeropoulos_, Feb 03 2025