login
A235027
Reverse the bits of prime divisors of n (with 2 -> 2), and multiply together: a(0)=0, a(1)=1, a(2)=2, a(p) = revbits(p) for odd primes p, a(u*v) = a(u) * a(v) for composites.
13
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 12, 11, 14, 15, 16, 17, 18, 25, 20, 21, 26, 29, 24, 25, 22, 27, 28, 23, 30, 31, 32, 39, 34, 35, 36, 41, 50, 33, 40, 37, 42, 53, 52, 45, 58, 61, 48, 49, 50, 51, 44, 43, 54, 65, 56, 75, 46, 55, 60, 47, 62, 63, 64, 55, 78, 97
OFFSET
0,3
COMMENTS
This is not a permutation of integers: a(25) = 25 = 5*5 = a(19) is the first case which breaks the injectivity. However, the first 24 terms are equal with A057889, which is a GF(2)[X]-analog of this sequence and which in contrary to this, is bijective. This stems from the fact that the set of irreducible GF(2)[X] polynomials (A014580) is closed under bit-reversal (A056539), while primes (A000040) are not.
Sequence A290078 gives the positions n where the ratio a(n)/n obtains new record values.
Note, instead of A056539 we could as well use A057889 to reverse the bits of n, and also A030101 when restricted to odd primes.
FORMULA
Completely multiplicative with a(0)=0, a(1)=1, a(p) = A056539(p) for primes p (which maps 2 to 2, and reverses the binary representation of odd primes), and a(u*v) = a(u) * a(v) for composites.
Equally, after a(0)=0, a(p * q * ... * r) = A056539(p) * A056539(q) * ... * A056539(r), for primes p, q, etc., not necessarily distinct.
a(0)=0, a(1)=1, a(n) = A056539(A020639(n)) * a(n/A020639(n)).
EXAMPLE
a(33) = a(3*11) = a(3) * a(11) = 3 * 13 = 39 (because 3, in binary '11', stays same when reversed, while 11 (eleven), in binary '1011', changes to '1101' = 13).
MATHEMATICA
f[p_, e_] := IntegerReverse[p, 2]^e; f[2, e_] := 2^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100, 0] (* Amiram Eldar, Sep 03 2023 *)
PROG
(Scheme, with Antti Karttunen's IntSeq-library)
(define (A235027 n) (if (< n 2) n (reduce * 1 (map A056539 (ifactor n)))))
(definec (A235027 n) (cond ((< n 2) n) (else (* (A056539 (A020639 n)) (A235027 (/ n (A020639 n)))))))
(PARI) revbits(n) = fromdigits(Vecrev(binary(n)), 2);
a(n) = {my(f = factor(n)); for (k=1, #f~, if (f[k, 1] != 2, f[k, 1] = revbits(f[k, 1]); ); ); factorback(f); } \\ Michel Marcus, Aug 05 2017
CROSSREFS
A235028 gives the fixed points. A235030 numbers such that n <> a(a(n)), or equally A001222(a(n)) > A001222(n). A235145 the number of iterations needed to reach a fixed point or cycle of 2, A235146 its records.
Sequence in context: A333693 A322464 A057889 * A337304 A325402 A110029
KEYWORD
nonn,base,mult
AUTHOR
Antti Karttunen, Jan 02 2014
STATUS
approved