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.
LINKS
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.
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)
(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
KEYWORD
nonn,base,mult
AUTHOR
Antti Karttunen, Jan 02 2014
STATUS
approved