A334098 a(n) = A334097(n) - A331410(n), where former is the exponent of the eventual power of 2 reached, and the latter is the number of iterations needed to get there, when starting from n and using the map k -> k + k/p, where p can be any odd prime factor of k, for example, the largest.
0, 1, 1, 2, 1, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 3, 3, 3, 4, 2, 3, 3, 4, 2, 3, 4, 5, 3, 3, 3, 4, 2, 3, 3, 4, 3, 4, 3, 4, 3, 4, 4, 5, 4, 3, 3, 4, 3, 4, 3, 5, 3, 3, 3, 4, 4, 5, 4, 6, 3, 4, 3, 4, 4, 4, 4, 5, 2, 3, 3, 4, 4, 4, 4, 5, 4, 4, 4, 5, 3, 4, 3, 5, 3, 4, 4, 5, 5, 5, 3, 6, 4, 5, 4, 4, 3, 4, 4, 5, 4
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
Mathematica
Array[Log2@ Last[#] - (Length[#] - 1) &@ NestWhileList[# + #/FactorInteger[#][[-1, 1]] &, #, ! IntegerQ@ Log2@ # &] &, 105] (* Michael De Vlieger, Apr 30 2020 *)
-
PARI
A334098(n) = { my(k=0); while(bitand(n,n-1), k++; my(f=factor(n)[, 1]); n += (n/f[2-(n%2)])); (valuation(n,2)-k); };
Comments