# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a031509 Showing 1-1 of 1 %I A031509 #20 Aug 19 2021 23:27:59 %S A031509 123,127,131,139,151,163,167,488,512,520,544,608,640,672,1095,1167, %T A031509 1383,1455,1515,1944,2008,2136,2264,2456,2648,2696,3035,3115,3215, %U A031509 3235,3415,3515,3635,3715,3735,3835,3935,4115,4135,4215,4368,4944,5496,5943,5971 %N 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. %H A031509 Robert Israel, Table of n, a(n) for n = 1..1000 %e A031509 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 %p A031509 # Maple 2016 or later. %p A031509 filter:= proc(n) uses NumberTheory; local R; %p A031509 if issqr(n) then return false fi; %p A031509 R:= Term(ContinuedFraction(sqrt(n)),periodic)[2]; %p A031509 nops(R)::even and R[nops(R)/2] = 11 %p A031509 end proc: %p A031509 select(filter, [$2..10000]); # _Robert Israel_, Jun 07 2019 %t A031509 okQ[k_] := Module[{c, lc}, If[IntegerQ[Sqrt[k]], False, %t A031509 c = ContinuedFraction[Sqrt[k]]; lc = Length[c[[2]]]; %t A031509 EvenQ[lc] && c[[2, lc/2]] == 11]]; %t A031509 Select[Range[10000], okQ] (* _Jean-François Alcover_, Jul 09 2021 *) %K A031509 nonn %O A031509 1,1 %A A031509 _David W. Wilson_ %E A031509 Definitions of A031509-A031598 clarified by _N. J. A. Sloane_, Aug 17 2021 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE