A122111 Self-inverse permutation of the positive integers induced by partition enumeration in A112798 and partition conjugation.
1, 2, 4, 3, 8, 6, 16, 5, 9, 12, 32, 10, 64, 24, 18, 7, 128, 15, 256, 20, 36, 48, 512, 14, 27, 96, 25, 40, 1024, 30, 2048, 11, 72, 192, 54, 21, 4096, 384, 144, 28, 8192, 60, 16384, 80, 50, 768, 32768, 22, 81, 45, 288, 160, 65536, 35, 108, 56, 576, 1536, 131072, 42
Offset: 1
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1024 terms from Antti Karttunen)
- Antti Karttunen, A few notes on A122111, A241909 & A241916.
- Index entries for sequences that are permutations of the natural numbers
Crossrefs
Cf. A088902 (fixed points).
Cf. also A080576, A036036, A001221, A001222, A061395, A243503, A056239, A052126, A003961, A064989, A071178, A241917, A241919, A242378, A242424, A006530, A105560, A070003, A102750, A066829, A028260, A026424, A244990, A244991, A244992, A108951, A181815, A181819, A181820, A238745, A238690, A242421.
Other related permutations: A048673-A064216, A244981-A244982, A244983-A244984, A243287-A243288, A243505-A243506, A245613-A245614, A075157, A075158, A129594, A069799, A242415, A245451, A245452, A245454, also A336321 & A336322 (composed with A225546).
Cf. also array A350066 [A(i, j) = a(a(i)*a(j))].
Programs
-
Maple
with(numtheory): c := proc (n) local B, C: B := proc (n) local pf: pf := op(2, ifactors(n)): [seq(seq(pi(op(1, op(i, pf))), j = 1 .. op(2, op(i, pf))), i = 1 .. nops(pf))] end proc: C := proc (P) local a: a := proc (j) local c, i: c := 0; for i to nops(P) do if j <= P[i] then c := c+1 else end if end do: c end proc: [seq(a(k), k = 1 .. max(P))] end proc: mul(ithprime(C(B(n))[q]), q = 1 .. nops(C(B(n)))) end proc: seq(c(n), n = 1 .. 59); # Emeric Deutsch, May 09 2015 # second Maple program: a:= n-> (l-> mul(ithprime(add(`if`(jAlois P. Heinz, Sep 30 2017
-
Mathematica
A122111[1] = 1; A122111[n_] := Module[{l = #, m = 0}, Times @@ Power @@@ Table[l -= m; l = DeleteCases[l, 0]; {Prime@Length@l, m = Min@l}, Length@Union@l]] &@Catenate[ConstantArray[PrimePi[#1], #2] & @@@ FactorInteger@n]; Array[A122111, 60] (* JungHwan Min, Aug 22 2016 *) a[n_] := Function[l, Product[Prime[Sum[If[jJean-François Alcover, Sep 23 2020, after Alois P. Heinz *)
-
PARI
A122111(n) = if(1==n,n,my(f=factor(n), es=Vecrev(f[,2]),is=concat(apply(primepi,Vecrev(f[,1])),[0]),pri=0,m=1); for(i=1, #es, pri += es[i]; m *= prime(pri)^(is[i]-is[1+i])); (m)); \\ Antti Karttunen, Jul 20 2020
-
Python
from sympy import factorint, prevprime, prime, primefactors from operator import mul def a001222(n): return 0 if n==1 else a001222(n/primefactors(n)[0]) + 1 def a064989(n): f=factorint(n) return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f]) def a105560(n): return 1 if n==1 else prime(a001222(n)) def a(n): return 1 if n==1 else a105560(n)*a(a064989(n)) [a(n) for n in range(1, 101)] # Indranil Ghosh, Jun 15 2017
-
Scheme
;; Uses Antti Karttunen's IntSeq-library. (definec (A122111 n) (if (<= n 1) n (* (A000040 (A001222 n)) (A122111 (A064989 n))))) ;; Antti Karttunen, May 12 2014
-
Scheme
;; Uses Antti Karttunen's IntSeq-library. (definec (A122111 n) (if (<= n 1) n (* (A000079 (A241917 n)) (A003961 (A122111 (A052126 n)))))) ;; Antti Karttunen, May 12 2014
-
Scheme
;; Uses Antti Karttunen's IntSeq-library. (definec (A122111 n) (if (<= n 1) n (* (expt (A000040 (A071178 n)) (A241919 n)) (A242378bi (A071178 n) (A122111 (A051119 n)))))) ;; Antti Karttunen, May 12 2014
Formula
From Antti Karttunen, May 12-19 2014: (Start)
a(1) = 1, a(p_i) = 2^i, and for other cases, if n = p_i1 * p_i2 * p_i3 * ... * p_{k-1} * p_k, where p's are primes, not necessarily distinct, sorted into nondescending order so that i1 <= i2 <= i3 <= ... <= i_{k-1} <= ik, then a(n) = 2^(ik-i_{k-1}) * 3^(i_{k-1}-i_{k-2}) * ... * p_{i_{k-1}}^(i2-i1) * p_ik^(i1).
This can be implemented as a recurrence, with base case a(1) = 1,
and then using any of the following three alternative formulas:
a(n) = A105560(n) * a(A064989(n)) = A000040(A001222(n)) * a(A064989(n)). [Cf. the formula for A242424.]
a(n) = (A000040(A071178(n))^A241919(n)) * A242378(A071178(n), a(A051119(n))). [Here ^ stands for the ordinary exponentiation, and the bivariate function 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.]
a(n) = 1 + A075157(A129594(A075158(n-1))). [Follows from the commutativity with A241909, please see the comments section.]
(End)
From Antti Karttunen, Jul 31 2014: (Start)
As a composition of related permutations:
Other identities. For all n >= 1, the following holds:
A238745(n) = a(A181819(n)) and a(A238745(n)) = A181819(n). - per Matthew Vandermast's note in A238745.
A181815(n) = a(A181820(n)) and a(A181815(n)) = A181820(n). - per Matthew Vandermast's note in A181815.
(End)
a(n) = A181819(A108951(n)). [Prime shadow of the primorial inflation of n] - Antti Karttunen, Apr 29 2022
Comments