|
|
A241909
|
|
Self-inverse permutation of natural numbers: a(1)=1, a(p_i) = 2^i, and if n = p_i1 * p_i2 * p_i3 * ... * p_{ik-1} * p_ik, where p's are primes, with their indexes are sorted into nondescending order: i1 <= i2 <= i3 <= ... <= i_{k-1} <= ik, then a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})). Here k = A001222(n) and ik = A061395(n).
|
|
54
|
|
|
1, 2, 4, 3, 8, 9, 16, 5, 6, 27, 32, 25, 64, 81, 18, 7, 128, 15, 256, 125, 54, 243, 512, 49, 12, 729, 10, 625, 1024, 75, 2048, 11, 162, 2187, 36, 35, 4096, 6561, 486, 343, 8192, 375, 16384, 3125, 50, 19683, 32768, 121, 24, 45, 1458, 15625, 65536, 21, 108, 2401
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
This permutation maps between the partitions as ordered in A112798 and A241918 (the original motivation for this sequence).
For all n > 2, A007814(a(n)) = A055396(n)-1, which implies that this self-inverse permutation maps between primes (A000040) and the powers of two larger than one (A000079(n>=1)), and apart from a(1) & a(2), this also maps each even number to some odd number, and vice versa, which means there are no fixed points after 2.
|
|
LINKS
|
|
|
FORMULA
|
If n is a prime with index i (p_i), then a(n) = 2^i, otherwise when n = p_i1 * p_i2 * p_i3 * ... p_ik, where p_i1, p_i2, p_i3, ..., p_ik are the primes present (not necessarily all distinct) in the prime factorization of n, sorted into nondescending order, a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})).
Equally, if n = 2^k, then a(n) = p_k, otherwise, when n = 2^e1 * 3^e2 * 5^e3 * ... * p_k^{e_k}, i.e., where e1 ... e_k are the exponents (some of them possibly zero, except the last) of the primes 2, 3, 5, ... in the prime factorization of n, a(n) = p_{1+e1} * p_{1+e1+e2} * p_{1+e1+e2+e3} * ... * p_{e1+e2+e3+...+e_k}.
From the equivalence of the above two formulas (which are inverses of each other) it follows that a(a(n)) = n, i.e., that this permutation is an involution. For a proof, please see the attached notes.
The first formula corresponds to this recurrence:
And the latter formula with this recurrence:
[Here A242378(k,n) changes each prime p(i) in the prime factorization of n to p(i+k), i.e., it's the result of A003961 iterated k times starting from n.]
We also have:
For all n > 1, a(2n-1) = 2*a(A064216(n)).
|
|
EXAMPLE
|
For n = 12 = 2 * 2 * 3 = p_1 * p_1 * p_2, we obtain by the first formula 2^(1-1) * 3^(1-1) * 5^(1+(2-1)) = 5^2 = 25. By the second formula, as n = 2^2 * 3^1, we obtain the same result, p_{1+2} * p_{2+1} = p_3 * p_3 = 25, thus a(12) = 25.
Using the product formula over the terms of row n of table A241918, we see, because 9450 = 2*3*3*3*5*5*7 = p_1^1 * p_2^3 * p_3^2 * p_4^1, that the corresponding row in A241918 is {2,5,7,7}, and multiplying p_2 * p_5 * p_7^2 yields 3 * 11 * 17 * 17 = 9537, thus a(9450) = 9537.
Similarly, for 9537, the corresponding row in A241918 is {1,2,2,2,3,3,4}, and multiplying p_1^1 * p_2^3 * p_3^2 * p_4^1, we obtain 9450 back.
|
|
MATHEMATICA
|
Array[If[# == 1, 1, Function[t, Times @@ Prime@ Accumulate[If[Length@ t < 2, {0}, Join[{1}, ConstantArray[0, Length@ t - 2], {-1}]] + ReplacePart[t, Map[#1 -> #2 & @@ # &, #]]]]@ ConstantArray[0, Transpose[#][[1, -1]]] &[FactorInteger[#] /. {p_, e_} /; p > 0 :> {PrimePi@ p, e}]] &, 56] (* Michael De Vlieger, Jan 23 2020 *)
|
|
PROG
|
;; Another recursive version:
(define (pow2? n) (let loop ((n n) (i 0)) (cond ((zero? n) #f) ((odd? n) (and (= 1 n) i)) (else (loop (/ n 2) (1+ i)))))) ;; Gives non-false only when n is a power of two.
(Haskell)
a241909 1 = 1
a241909 n = product $ zipWith (^) a000040_list $ zipWith (-) is (1 : is)
where is = reverse ((j + 1) : js)
(j:js) = reverse $ map a049084 $ a027746_row n
(PARI) A241909(n) = if(1==n||isprime(n), 2^primepi(n), my(f=factor(n), h=1, i, m=1, p=1, k=1); while(k<=#f~, p = nextprime(1+p); i = primepi(f[k, 1]); m *= p^(i-h); h = i; if(f[k, 2]>1, f[k, 2]--, k++)); (p*m)); \\ Antti Karttunen, Jan 17 2020
|
|
CROSSREFS
|
Cf. A203623, A241918, A242378, A007814, A064989, A064216, A001222, A061395, A125976, A243060, A243070.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|