Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

%I #60 Sep 03 2023 08:44:36

%S 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,

%T 22,27,28,23,30,31,32,39,34,35,36,41,50,33,40,37,42,53,52,45,58,61,48,

%U 49,50,51,44,43,54,65,56,75,46,55,60,47,62,63,64,55,78,97

%N 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.

%C 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.

%C Sequence A290078 gives the positions n where the ratio a(n)/n obtains new record values.

%C Note, instead of A056539 we could as well use A057889 to reverse the bits of n, and also A030101 when restricted to odd primes.

%H Antti Karttunen, <a href="/A235027/b235027.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>.

%H <a href="/index/Di#divseq">Index to divisibility sequences</a>.

%F 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.

%F Equally, after a(0)=0, a(p * q * ... * r) = A056539(p) * A056539(q) * ... * A056539(r), for primes p, q, etc., not necessarily distinct.

%F a(0)=0, a(1)=1, a(n) = A056539(A020639(n)) * a(n/A020639(n)).

%e 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).

%t 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 *)

%o (Scheme, with _Antti Karttunen_'s IntSeq-library)

%o (define (A235027 n) (if (< n 2) n (reduce * 1 (map A056539 (ifactor n)))))

%o (definec (A235027 n) (cond ((< n 2) n) (else (* (A056539 (A020639 n)) (A235027 (/ n (A020639 n)))))))

%o (PARI) revbits(n) = fromdigits(Vecrev(binary(n)), 2);

%o 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

%Y 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.

%Y Cf. also A010051, A020639, A030101, A056539, A057889, A074832, A098957, A091214, A204219, A290078.

%K nonn,base,mult

%O 0,3

%A _Antti Karttunen_, Jan 02 2014