login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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}.
1
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,6
COMMENTS
This sequence is a kind of measure of the "amount of information" in an integer. The post at Zhihu wonders whether one can calculate this sequence without using prime decomposition.
FORMULA
a(2) = 0,
a(n) = a(n-1) + 1 if n is an odd prime,
a(n) = max{a(k) : k|n, 1<k<n} otherwise.
EXAMPLE
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.
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
CROSSREFS
For values at primes, see A364332.
Sequence in context: A061358 A025866 A259920 * A048881 A026931 A339823
KEYWORD
nonn
AUTHOR
Steven Lu, Jul 18 2023
STATUS
approved