%I #10 Nov 06 2020 17:30:39
%S 0,0,0,1,1,1,0,2,2,2,3,4,0,1,5,3,3,6,0,7,1,2,2,8,4,4,9,3,1,10,0,4,5,6,
%T 11,5,5,12,13,14,0,15,0,1,3,0,7,16,6,6,17,4,2,5,8,18,6,0,7,9,0,10,19,
%U 7,7,20,1,21,2,8,3,22,1,3,11,1,9,12,13,23
%N Number of integers less than n with the same period of continued fraction for square root as n.
%H Robert Israel, <a href="/A338629/b338629.txt">Table of n, a(n) for n = 1..3000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PeriodicContinuedFraction.html">Periodic Continued Fraction</a>
%F a(n) = |{j < n : A003285(j) = A003285(n)}|.
%e a(11) = 3 because A003285(11) = 2 and also A003285(3) = A003285(6) = A003285(8) = 2.
%e More specifically,
%e sqrt(3) = 1 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + ...)))),
%e sqrt(6) = 2 + 1/(2 + 1/(4 + 1/(2 + 1/(4 + ...)))),
%e sqrt(8) = 2 + 1/(1 + 1/(4 + 1/(1 + 1/(4 + ...)))),
%e sqrt(11) = 3 + 1/(3 + 1/(6 + 1/(3 + 1/(6 + ...)))).
%p f:= proc(n) if issqr(n) then 0 else nops(numtheory:-cfrac(sqrt(n),periodic,quotients)[2]) fi end proc:
%p V:= map(f, [$1..200]):
%p seq(numboccur(V[n], V[1..n-1]),n=1..200); # _Robert Israel_, Nov 06 2020
%t Table[Length[Select[Range[n - 1], Module[{s = Sqrt[#]}, If[IntegerQ[s], 0, Length[ContinuedFraction[s][[2]]]]] == Module[{s = Sqrt[n]}, If[IntegerQ[s], 0, Length[ContinuedFraction[s][[2]]]]] &]], {n, 80}]
%Y Cf. A003285.
%K nonn,look
%O 1,8
%A _Ilya Gutkovskiy_, Nov 04 2020
|