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.

A377403 For n >= 2, a(n) is the number of iterations needed for the map: x -> x / A085392(x) if A085392(x) > 1, otherwise x -> x + A151800(x), to (the first occurrence of) 2.

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Oct 27 2024

Keywords

Comments

Also a(2*k + 1) = A001222(2*k + 1) + 2 + s, where s >= 1 for k = 5, 8, 14, 20, 21, 23, 26, 29, 30, 35, 36, 39, 48, 50, 51, ...

Examples

			n = 3: 3 -> 8 -> 4 -> 2, 3 iterations needed to reach 2, thus a(3) = 3.
n = 9: 9 -> 3 -> 8 -> 4 -> 2, 4 iterations needed to reach 2, thus a(9) = 4.
n = 11: 11 -> 24 -> 8 -> 4 - > 2, 4 iterations needed to reach 2, thus a(11) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[2] = 0; a[n_] := -1 + Length@ NestWhileList[If[CompositeQ[#], #/FactorInteger[#][[-1, 1]], # + NextPrime[#]] &, n, # > 2 &]; Array[a, 120, 2] (* Amiram Eldar, Oct 27 2024 *)

Formula

For n even: a(n) = A001222(n) - 1.
For n odd: a(n) = A001222(n) - 1 + A001222(A013634(A020639(n))).