login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the least number k such that the continued fraction for phi(k)/k contains exactly n elements.
1

%I #11 May 06 2022 13:13:51

%S 1,2,3,15,35,33,65,215,221,551,455,2001,3417,3621,11523,16705,16617,

%T 69845,107545,157285,324569,358883,1404949,1569295,3783970,3106285,

%U 7536065,12216295,10589487,24038979,57759065,51961945,177005465,131462695,741703701,1467144445

%N a(n) is the least number k such that the continued fraction for phi(k)/k contains exactly n elements.

%C a(n) is the least number k such that A342866(k) = n.

%C All the terms above 3 are composite numbers.

%F a(2) = 2 since 2 is the least number k such that A342866(k) = 2.

%t f[n_] := Length @ ContinuedFraction[EulerPhi[n]/n]; seq[max_] := Module[{s = Table[0, {max}], c = 0, n = 1, i}, While[c < max, i = f[n]; If[i <= max && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[20]

%o (PARI) a(n) = my(k=1); while (#contfrac(eulerphi(k)/k) != n, k++); k; \\ _Michel Marcus_, Mar 30 2021

%Y Cf. A000010, A007694, A076512, A109395, A342866.

%Y Cf. A071865 (similar, with sigma(k)/k).

%K nonn

%O 1,2

%A _Amiram Eldar_, Mar 27 2021