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.
LINKS
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
KEYWORD
nonn
AUTHOR
Steven Lu, Jul 18 2023
STATUS
approved