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.

A379258 a(n) is the number of iterations of the Euler phi function needed to reach 1 starting at the n-th 3-smooth number.

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Dec 19 2024

Keywords

Examples

			a(6) = 4 because the 6th 3-smooth number is A003586(6) = 8, and 4 iterations of phi are needed to reach 1: 8 -> 4 -> 2 -> 1.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Module[{e2 = IntegerExponent[n, 2], e3 = IntegerExponent[n, 3]}, e2 + e3 + 1 + Boole[e2 == 0]]; f[1] = 1; With[{max = 3*10^4}, f /@ Sort[Flatten[Table[2^i*3^j, {i, 0, Log2[max]}, {j, 0, Log[3, max/2^i]}]]]]
  • PARI
    list(lim) = {my(e2, e3); print1(1, ", "); for(k = 2, lim, e2 = valuation(k, 2); e3 = valuation(k, 3); if(k == (1 << e2) * 3^e3, print1(e2 + e3 + 1 + (e2 == 0), ", ")));}

Formula

a(n) = A049108(A003586(n)).
a(n) = valuation(A003586(n), 2) + valuation(A003586(n), 3) + 1 + [valuation(A003586(n), 2) == 0] for n > 1, where [] is the Iverson bracket.
a(n) = A022328(n) + A022329(n) + 1 + [n is in A022330], for n > 1.
a(A022330(n)) = n + 2 for n >= 1.
a(A022331(n)) = n + 1 for n >= 0.
a(A202821(n)) = 2*n + 1, for n >= 0.

A379259 a(n) is the number of iterations that n requires to reach a 3-smooth number under the map x -> phi(x).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 2, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 2, 3, 0, 2, 1, 0, 1, 2, 1, 2, 0, 2, 1, 1, 0, 1, 1, 1, 1, 2, 1, 2, 2, 1, 3, 4, 0, 2, 2, 1, 1, 2, 0, 2, 1, 1, 2, 3, 1, 2, 2, 1, 0, 1, 2, 3, 1, 3, 1, 2, 0, 1, 1, 2, 1, 2, 1, 2, 1, 0, 2, 3, 1, 1, 2, 2
Offset: 1

Views

Author

Amiram Eldar, Dec 19 2024

Keywords

Comments

If k is a 3-smooth number then phi(k) is also a 3-smooth number. Therefore, a(n) counts the numbers that are not 3-smooth numbers in the trajectory from n to a 3-smooth number (including n if it is not a 3-smooth number).
The indices of records, 1, 5, 11, 23, 47, ..., seem to be A246491 except for the first term (checked up to A246491(15)).

Examples

			a(1) = a(2) = a(3) = a(4) = 0 because 1, 2, 3 and 4 are already 3-smooth numbers.
a(5) = 1 because after one iteration 5 -> phi(5) = 4, a 3-smooth number, 4, is reached.
a(23) = 3 because after 3 iterations 23 -> 22 -> 10 -> 4, a 3-smooth number, 4, is reached.
		

Crossrefs

Programs

  • Mathematica
    smQ[n_] := n == Times @@ ({2, 3}^IntegerExponent[n, {2, 3}]); a[n_] := -1 + Length@ NestWhileList[EulerPhi, n, ! smQ[#] &]; Array[a, 100]
  • PARI
    issm(n) = my(m = n >> valuation(n, 2)); m == 3^valuation(m, 3);
    a(n) = {my(c = 0); while(!issm(n), c++; n = eulerphi(n)); c;}

Formula

a(A003586(n)) = 0.
Showing 1-2 of 2 results.