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

A385744 The number of iterations of the infinitary analog of the totient function A384247 that are required to reach from n to 1.

Original entry on oeis.org

0, 1, 2, 3, 4, 2, 3, 4, 5, 4, 5, 3, 4, 3, 5, 6, 7, 5, 6, 4, 4, 5, 6, 5, 6, 4, 6, 6, 7, 5, 6, 7, 5, 7, 6, 6, 7, 6, 6, 7, 8, 4, 5, 6, 8, 6, 7, 6, 7, 6, 8, 7, 8, 6, 8, 6, 7, 7, 8, 6, 7, 6, 7, 7, 7, 5, 6, 7, 7, 6, 7, 8, 9, 7, 7, 7, 7, 6, 7, 7, 8, 8, 9, 7, 8, 5, 7
Offset: 1

Views

Author

Amiram Eldar, Jul 08 2025

Keywords

Comments

First differs from A049865 at n = 24.

Examples

			  n | a(n) | iterations
  --+------+----------------------
  2 |    1 | 2 -> 1
  3 |    2 | 3 -> 2 -> 1
  4 |    3 | 4 -> 3 -> 2 -> 1
  5 |    4 | 5 -> 4 -> 3 -> 2 -> 1
  6 |    2 | 6 -> 2 -> 1
		

Crossrefs

Similar sequences: A003434, A049865, A225320, A333609.

Programs

  • Mathematica
    f[p_, e_] := p^e*(1 - 1/p^(2^(IntegerExponent[e, 2]))); iphi[1] = 1; iphi[n_] := iphi[n] = Times @@ f @@@ FactorInteger[n];
    a[n_] := Length @ NestWhileList[iphi, n, # != 1 &] - 1; Array[a, 100]
  • PARI
    iphi(n) = {my(f = factor(n)); n * prod(i = 1, #f~, (1 - 1/f[i, 1]^(1 << valuation(f[i, 2], 2))));}
    a(n) = if(n ==  1, 0, 1 + a(iphi(n)));

Formula

a(n) = a(A384247(n)) + 1 for n >= 2.

A333611 Sum of the iterated infinitary totient function iphi (A091732).

Original entry on oeis.org

0, 1, 3, 6, 10, 3, 9, 6, 14, 10, 20, 9, 21, 9, 14, 29, 45, 14, 32, 21, 21, 20, 42, 9, 33, 21, 45, 32, 60, 14, 44, 29, 41, 45, 33, 33, 69, 32, 33, 21, 61, 21, 63, 44, 61, 42, 88, 44, 92, 33, 61, 69, 121, 45, 61, 32, 69, 60, 118, 33, 93, 44, 92, 106, 92, 41, 107
Offset: 1

Views

Author

Amiram Eldar, Mar 28 2020

Keywords

Examples

			a(3) = iphi(3) + iphi(iphi(3)) = 2 + 1 = 3.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^(2^(-1 + Position[Reverse @ IntegerDigits[e, 2], 1])); iphi[1] = 1; iphi[n_] := Times @@ (Flatten@(f @@@ FactorInteger[n]) - 1); a[n_] := Plus @@ NestWhileList[iphi, n, # != 1 &] - n; Array[a, 100]

A333610 Least number that reaches 1 after n iterations of the infinitary totient function A091732.

Original entry on oeis.org

1, 2, 3, 4, 5, 11, 17, 47, 85, 227, 257, 919, 1229, 2459, 4369, 9839, 30865, 101503, 148157, 438499, 828297, 2201671, 3316617, 11055391, 35354993, 140810491, 188991053, 377982107, 848170377, 1704741139, 6933926513
Offset: 0

Views

Author

Amiram Eldar, Mar 28 2020

Keywords

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^(2^(-1 + Position[Reverse @ IntegerDigits[e, 2], 1])); iphi[1] = 1; iphi[n_] := Times @@ (Flatten@(f @@@ FactorInteger[n]) - 1); numiter[n_] := Length @ NestWhileList[iphi, n, # != 1 &] - 1; n = 0; seq = {}; Do[If[numiter[k] == n, AppendTo[seq, k]; n++], {k, 1, 1000}]; seq

Formula

A333609(a(n)) = n.

A362024 The number of iterations of the infinitary totient function iphi (A064380) required to reach from n to 1.

Original entry on oeis.org

1, 2, 3, 4, 3, 4, 4, 5, 5, 6, 5, 6, 5, 6, 7, 8, 7, 8, 7, 6, 6, 7, 6, 7, 8, 8, 9, 10, 7, 8, 8, 7, 7, 8, 9, 10, 7, 9, 8, 9, 9, 10, 9, 8, 11, 12, 8, 9, 9, 10, 10, 11, 7, 10, 9, 9, 11, 12, 8, 9, 9, 10, 9, 10, 8, 9, 11, 10, 9, 10, 8, 9, 9, 8, 10, 10, 10, 11, 11, 12
Offset: 2

Views

Author

Amiram Eldar, Apr 05 2023

Keywords

Examples

			a(6) = 3 since there are 3 iterations from 6 to 1: iphi(6) = 3, iphi(3) = 2 and iphi(2) = 1.
		

Crossrefs

Cf. A064380, A362025 (indices of records).
Similar sequences: A003434, A049865, A333609.

Programs

  • Mathematica
    infCoprimeQ[n1_, n2_] := Module[{g = GCD[n1, n2]}, If[g == 1, True, AllTrue[FactorInteger[g][[;; , 1]], BitAnd @@ IntegerExponent[{n1, n2}, #] == 0 &]]];
    iphi[n_] := Sum[Boole[infCoprimeQ[j, n]], {j, 1, n - 1}];
    a[n_] := Length@ NestWhileList[iphi, n, # > 1 &] - 1;
    Array[a, 100, 2]
  • PARI
    isinfcoprime(n1, n2) = {my(g = gcd(n1, n2), p, e1, e2); if(g == 1, return(1)); p = factor(g)[, 1]; for(i=1, #p, e1 = valuation(n1, p[i]); e2 = valuation(n2, p[i]); if(bitand(e1, e2) > 0, return(0))); 1; }
    iphi(n) = sum(j = 1, n-1, isinfcoprime(j, n));
    a(n) = if(n==2, 1, a(iphi(n)) + 1);

Formula

a(n) = a(A064380(n)) + 1 for n > 2.
Showing 1-4 of 4 results.