|
|
A235145
|
|
a(n) = Number of steps to reach a fixed point or 2-cycle, when iterating A235027 starting from value n.
|
|
8
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,140
|
|
COMMENTS
|
Or in other words, how many times are needed to repeatedly factorize the number, to reverse the bits of each odd prime factor (with A056539) and factorize and bit-reverse the reversed factors again, until the number of prime divisors no more grows, meaning that we have found either a fixed point or entered a cycle of two.
|
|
LINKS
|
|
|
FORMULA
|
a(2n) = a(n), and in general, for composite values a(u * v) = max(a(u),a(v)).
For composite n, a(n) = Max_{p|n} a(p). [The above reduces to this: select the maximal value from all values a(p) computed for primes p dividing n]
For prime p, a(p) = 0 if A056539(p) is also prime (p is 2 or in A074832), otherwise a(p) = 1+a(A056539(p)).
|
|
EXAMPLE
|
19, '10011' in binary, when reversed, yields '11001' = 25, when factored, yields 5 * 5, ('101' * '101' in binary), which divisors stay same when reversed, thus it took one iteration step to reach a point where the number of prime divisors no more grows. Thus a(19)=1.
|
|
PROG
|
(Scheme, two alternative definitions using memoizing definec-macro from Antti Karttunen's IntSeq-library)
(PARI) revbits(n) = fromdigits(Vecrev(binary(n)), 2);
a235027(n) = {f = factor(n); for (k=1, #f~, if (f[k, 1] != 2, f[k, 1] = revbits(f[k, 1]); ); ); factorback(f); }
find(v, newn) = {for (k=1, #v, if (v[#v -k + 1] == newn, return (k)); ); return (0); }
a(n) = {ok = 0; v = [n]; while (! ok, newn = a235027(n); ind = find(v, newn); if (ind, ok = 1, v = concat(v, newn); n = newn); ); #v - ind; } \\ Michel Marcus, Aug 06 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|