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

A385747 Least number that reaches 1 after exactly n iterations of the infinitary analog of the totient function A384247.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 16, 17, 41, 73, 101, 197, 467, 829, 1109, 2761, 4849, 7831, 12401, 26189, 52379, 85853, 139589, 237007, 395533, 947043, 1967027, 3446033, 5396427, 9510437, 17502533, 35005067, 71202449, 90187609, 164664701, 395199461, 705113873, 1265735729, 1803553457
Offset: 0

Views

Author

Amiram Eldar, Jul 08 2025

Keywords

Comments

a(n) is the least number k such that A385744(k) = n.
Also, indices of records of A385744.

Examples

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

Crossrefs

Similar sequences: A003271, A005424, A007755, A333610.

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];
    numiter[n_] := Length @ NestWhileList[iphi, n, # != 1 &] - 1;
    seq[len_] := Module[{s = {}, k = 0, i = 0}, While[Length[s] < len, k++; If[numiter[k] == i, AppendTo[s, k]; i++]]; s]; seq[25]
  • PARI
    iphi(n) = {my(f = factor(n)); n * prod(i = 1, #f~, (1 - 1/f[i, 1]^(1 << valuation(f[i, 2], 2))));}
    numiter(n) = if(n ==  1, 0, 1 + numiter(iphi(n)));
    list(len) = {my(k = 0, i = 0, c = 0); while(c < len, k++; if(numiter(k) == i, c++; print1(k, ", "); i++));}

A362025 a(n) is the least number that reaches 1 after n iterations of the infinitary totient function A064380.

Original entry on oeis.org

2, 3, 4, 5, 9, 11, 16, 17, 28, 29, 46, 47, 99, 145, 167, 205, 314, 397, 437, 793, 851, 1137, 1693, 2453, 2771, 2989, 3701, 5099, 6801, 9299, 12031, 15811, 16816, 21520, 21521, 29547, 39685, 62077, 83191, 103473, 112117, 149535, 157159, 196049, 200267, 303022
Offset: 1

Views

Author

Amiram Eldar, Apr 05 2023

Keywords

Crossrefs

Cf. A064380.
Indices of records of A362024.
Similar sequences: A003271, A007755, A333610.

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}];
    numiter[n_] := Length@ NestWhileList[iphi, n, # > 1 &] - 1;
    seq[kmax_] := Module[{v = {}, n = 1}, Do[If[numiter[k] == n, AppendTo[v, k]; n++], {k, 2, kmax}]; v]; seq[1000]
  • 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));
    numiter(n) = if(n==2, 1, numiter(iphi(n)) + 1);
    lista(kmax) = {my(n = 1); for(k = 2, kmax, if(numiter(k) == n, print1(k, ", "); n++)); }

Formula

A362024(a(n)) = n, and A362024(k) < n for all k < a(n).
Showing 1-2 of 2 results.