A334097 a(n) is the exponent of the eventual power of 2 reached 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, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 6, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 7, 7, 6, 7, 7, 7, 6, 7, 7, 7, 7, 6, 6, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 8, 7, 7, 7, 8, 7, 8, 7, 8, 8, 7, 7, 7, 7, 8, 7, 7, 7, 8, 8, 8, 8, 7, 7, 8
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Crossrefs
Programs
-
Mathematica
Array[Log2@ NestWhile[# + #/FactorInteger[#][[-1, 1]] &, #, !IntegerQ@ Log2@ # &] &, 105] (* Michael De Vlieger, Apr 30 2020 *)
-
PARI
A334097(n) = if(!bitand(n,n-1),valuation(n,2),my(f=factor(n)[, 1]); A334097(n+(n/f[2-(n%2)])));
-
PARI
A334097(n) = if(!bitand(n,n-1),valuation(n,2),A334097(n+(n/vecmax(factor(n)[, 1]))));
-
PARI
A334097(n) = { my(f=factor(n)); sum(k=1,#f~,if(2==f[k,1],f[k,2],f[k,2]*A334097(1+f[k,1]))); };