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

A342866 The number of elements in the continued fraction for phi(n)/n, where phi is the Euler totient function (A000010).

Original entry on oeis.org

1, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 4, 2, 3, 2, 3, 3, 4, 3, 3, 2, 3, 3, 3, 3, 3, 4, 3, 2, 6, 3, 5, 2, 3, 3, 6, 3, 3, 3, 3, 3, 4, 3, 3, 2, 3, 3, 6, 3, 3, 2, 5, 3, 6, 3, 3, 4, 3, 3, 4, 2, 7, 4, 3, 3, 6, 4, 3, 2, 3, 3, 4, 3, 6, 3, 3, 3, 3, 3, 3, 3, 4, 3, 6
Offset: 1

Views

Author

Amiram Eldar, Mar 27 2021

Keywords

Examples

			a(2) = 2 since the continued fraction of phi(2)/2 = 1/2 = 0 + 1/2 has 2 elements: {0, 2}.
a(3) = 3 since the continued fraction of phi(3)/3 = 2/3 = 0 + 1/(1 + 1/2) has 3 elements: {0, 1, 2}.
a(15) = 4 since the continued fraction of phi(15)/15 = 8/15 = 0 + 1/(1 + 1/(1 + 1/7)) has 4 elements: {0, 1, 1, 7}.
		

Crossrefs

Cf. A071862 (similar, with sigma(n)/n).

Programs

  • Mathematica
    a[n_] := Length @ ContinuedFraction[EulerPhi[n]/n]; Array[a, 100]
  • PARI
    a(n) = #contfrac(eulerphi(n)/n); \\ Michel Marcus, Mar 30 2021

Formula

a(n) = 2 if and only if n is in A007694.
a(p) = 3 for an odd prime p.
Showing 1-1 of 1 results.