A364334 a(2) = 0; a(n) = a(n-1) + 1 if n is an odd prime; otherwise a(n) = max{a(k) : k is divisor of n, 1 < k < n}.
0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 2, 1, 0, 1, 1, 2, 1, 2, 2, 3, 1, 1, 2, 1, 2, 3, 1, 2, 0, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 1, 3, 4, 1, 2, 1, 1, 2, 3, 1, 2, 2, 2, 3, 4, 1, 2, 2, 2, 0, 2, 2, 3, 1, 3, 2, 3, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 2, 3, 2, 1, 3, 3, 2, 3, 1, 2, 3, 2, 4, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 3, 4, 1, 2, 2, 2, 2
Offset: 2
Keywords
Examples
a(238)=2, since a(2)=0, a(7)=2, a(14)=2, a(17)=1, a(34)=1, a(119)=2, and the largest among them is 2. And a(239)=3, since 239 is a prime number, and a(238)=2.
Links
Crossrefs
For values at primes, see A364332.
Programs
-
Mathematica
Nest[Function[list, Module[{n = Length[list] + 1}, Append[list, If[PrimeQ[n], Last[list] + 1, Max[(list[[First[#]]]) & /@ FactorInteger[n]]]]]], {0, 0}, 110]//Rest
Formula
a(2) = 0,
a(n) = a(n-1) + 1 if n is an odd prime,
a(n) = max{a(k) : k|n, 1
Comments