login
Search: a242378 -id:a242378
     Sort: relevance | references | number | modified | created      Format: long | short | data
Permutation of natural numbers: a(n) = A242378(A007814(n), (1+A000265(n))) - 1.
+20
12
1, 2, 3, 4, 5, 8, 7, 6, 9, 14, 11, 24, 13, 26, 15, 10, 17, 20, 19, 34, 21, 44, 23, 48, 25, 32, 27, 124, 29, 80, 31, 12, 33, 74, 35, 54, 37, 62, 39, 76, 41, 38, 43, 174, 45, 134, 47, 120, 49, 50, 51, 64, 53, 98, 55, 342, 57, 104, 59, 624, 61, 242, 63, 16, 65, 56, 67, 244, 69, 224, 71, 90, 73, 68
OFFSET
1,2
COMMENTS
To compute a(n) we shift its binary representation right as many steps k as necessary that the result were an odd number. Then one is added to that odd number, and the prime factorization of the resulting even number is shifted the same k number of steps towards larger primes, whose product is then decremented by one to get the final result.
In the essence, a(n) tells which number in array A246275 is at the same position where n is in the array A135764. As the topmost row in both arrays is A005408 (odd numbers), they are fixed, i.e. a(2n+1) = 2n+1 for all n.
Equally: a(n) tells which number in array A246273 is at the same position where n is in the array A054582, as they are the transposes of above two arrays.
FORMULA
a(n) = A242378(A007814(n), (1+A000265(n))) - 1. [Where 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].
As a composition of related permutations:
a(n) = A246273(A209268(n)).
Other identities:
For all n >= 0, a(A005408(n)) = A005408(n). [Fixes the odd numbers].
EXAMPLE
Consider n=36, "100100" in binary. It has to be shifted two bits right that the result were an odd number 9, "1001" in binary. We see that 9+1 = 10 = 2*5 = p_1 * p_3 [where p_k denotes the k-th prime, A000040(k)], and shifting this two steps towards larger primes results p_3 * p_5 = 5*11 = 55, thus a(36) = 55-1 = 54.
PROG
(PARI)
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of Michel Marcus
A246676(n) = { my(k=0); while(!(n%2), n = n\2; k++); n++; while(k>0, n = A003961(n); k--); n-1; };
for(n=1, 8192, write("b246676.txt", n, " ", A246676(n)));
(Scheme) (define (A246676 n) (+ -1 (A242378bi (A007814 n) (+ 1 (A000265 n))))) ;; Code for A242378bi given in A242378.
CROSSREFS
Inverse: A246675.
Even bisection halved: A246680.
More recursed versions: A246678, A246684.
Other related permutations: A209268, A246273, A246275, A135764, A054582.
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 01 2014
STATUS
approved
"Caves of prime shift" permutation: a(1) = 1, a(n) = A242378(A007814(n), 2*a(A003602(n))) - 1.
+20
9
1, 2, 3, 4, 5, 8, 7, 6, 9, 14, 15, 24, 13, 26, 11, 10, 17, 20, 27, 34, 29, 80, 47, 48, 25, 32, 51, 124, 21, 44, 19, 12, 33, 74, 39, 54, 53, 98, 67, 76, 57, 104, 159, 624, 93, 404, 95, 120, 49, 50, 63, 64, 101, 152, 247, 342, 41, 38, 87, 174, 37, 62, 23, 16, 65, 56, 147, 244, 77, 188, 107, 90, 105, 374, 195, 324, 133, 170, 151, 142, 113, 92
OFFSET
1,2
COMMENTS
See the comments in A246676. This is otherwise similar permutation, except that after having reached an odd number 2m-1 when we have shifted the binary representation of n right k steps, here, in contrary to A246676, we don't shift the primes in the prime factorization of the even number 2m, but instead of an even number (2*a(m)), shifting it the same number (k) of positions towards larger primes, whose product is then decremented by one to get the final result.
From Antti Karttunen, Jan 18 2015: (Start)
This can be viewed as an entanglement or encoding permutation where the complementary pairs of sequences to be interwoven together are even and odd numbers (A005843/A005408) which are entangled with another complementary pair: even numbers in the order they appear in A253885 and odd numbers in their usual order: (A253885/A005408).
From the above follows also that this sequence can be represented as a binary tree. Each child to the left is obtained by doubling the parent and subtracting one, and each child to the right is obtained by applying A253885 to the parent:
1
|
...................2...................
3 4
5......../ \........8 7......../ \........6
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
9 14 15 24 13 26 11 10
17 20 27 34 29 80 47 48 25 32 51 124 21 44 19 12
(End)
FORMULA
a(1) = 1, a(n) = A242378(A007814(n), 2*a(A003602(n))) - 1. [Where 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(1) = 1, a(2n) = A253885(a(n)), a(2n+1) = (2*a(n+1))-1. - Antti Karttunen, Jan 18 2015
As a composition of other permutations:
a(n) = A250243(A249814(n)).
Other identities. For all n >= 1, the following holds:
a(n) = (1+a((2*n)-1))/2. [The odd bisection from a(1) onward with one added and then halved gives the sequence back].
For all n >= 0, the following holds: a(A000051(n)) = A000051(n). [Numbers of the form 2^n + 1 are among the fixed points].
EXAMPLE
Consider n=30, "11110" in binary. It has to be shifted just one bit-position right that the result were an odd number 15, "1111" in binary. As 15 = 2*8-1, we use 2*a(8) = 2*6 = 12 = 2*2*3 = p_1 * p_1 * p_2 [where p_k denotes the k-th prime, A000040(k)], which we shift one step towards larger primes resulting p_2 * p_2 * p_3 = 3*3*5 = 45, thus a(30) = 45-1 = 44.
PROG
(PARI)
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of Michel Marcus
A246684(n) = { my(k=0); if(1==n, 1, while(!(n%2), n = n/2; k++); n = 2*A246684((n+1)/2); while(k>0, n = A003961(n); k--); n-1); };
for(n=1, 8192, write("b246684.txt", n, " ", A246684(n)));
(Scheme, with memoization-macro definec, two implementations)
(definec (A246684 n) (cond ((<= n 1) n) (else (+ -1 (A242378bi (A007814 n) (* 2 (A246684 (A003602 n)))))))) ;; Code for A242378bi given in A242378.
(definec (A246684 n) (cond ((<= n 1) n) ((even? n) (A253885 (A246684 (/ n 2)))) (else (+ -1 (* 2 (A246684 (/ (+ n 1) 2)))))))
CROSSREFS
Inverse: A246683.
Other versions: A246676, A246678.
Similar or related permutations: A005940, A163511, A241909, A245606, A246278, A246375, A249814, A250243.
Differs from A249814 for the first time at n=14, where a(14) = 26, while A249814(14) = 20.
KEYWORD
nonn,tabf,look
AUTHOR
Antti Karttunen, Sep 06 2014
STATUS
approved
a(0) = 2, for n > 0, a(n) = a(n-1)*A242378(n,a(n-1)), where A242378(n,a(n-1)) shifts the prime factorization of a(n-1) n primes towards larger primes with A003961.
+20
7
2, 6, 210, 3573570, 64845819350301990, 28695662573739152697846686144187168109530, 1038300112150956151877699324649731518883355380534272386781875587619359740733888844803014212990
OFFSET
0,1
COMMENTS
Multiplicative encoding of irregular table A053632 (in style of A007188 and A260443).
LINKS
FORMULA
a(0) = 2, for n > 0, a(n) = a(n-1)*A242378(n,a(n-1)).
Other identities. For all n >= 0:
A001222(a(n)) = A000079(n).
A048675(a(n)) = A028362(1+n).
A248663(a(n)) = A068052(n).
A007913(a(n)) = A285102(n).
PROG
(PARI)
A003961(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
A242378(k, n) = { while(k>0, n = A003961(n); k = k-1); n; };
A285101(n) = { if(0==n, 2, A285101(n-1)*A242378(n, A285101(n-1))); };
(Scheme) (definec (A285101 n) (if (zero? n) 2 (* (A285101 (- n 1)) (A242378bi n (A285101 (- n 1)))))) ;; For A242378bi see A242378.
(Python)
from sympy import factorint, prime, primepi
from operator import mul
from functools import reduce
def a003961(n):
f=factorint(n)
return 1 if n==1 else reduce(mul, [prime(primepi(i) + 1)**f[i] for i in f])
def a242378(k, n):
while k>0:
n=a003961(n)
k-=1
return n
l=[2]
for n in range(1, 7):
x=l[n - 1]
l.append(x*a242378(n, x))
print(l) # Indranil Ghosh, Jun 27 2017
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 15 2017
STATUS
approved
Permutation of natural numbers: a(1) = 1, a(2n+1) = 1 + 2*a(n), a(2n) = A242378(A001511(n), (1+A000265(n))) - 1.
+20
6
1, 2, 3, 4, 5, 8, 7, 6, 9, 14, 11, 24, 17, 26, 15, 10, 13, 20, 19, 34, 29, 44, 23, 48, 49, 32, 35, 124, 53, 80, 31, 12, 21, 74, 27, 54, 41, 62, 39, 76, 69, 38, 59, 174, 89, 134, 47, 120, 97, 50, 99, 64, 65, 98, 71, 342, 249, 104, 107, 624, 161, 242, 63, 16, 25, 56, 43, 244, 149, 224, 55, 90, 109, 68, 83
OFFSET
1,2
COMMENTS
See the comments in A246676. This is a similar permutation, except for odd numbers, which are here recursively permuted by the emerging permutation itself. The even bisection halved gives A246680, the odd bisection from a(3) onward with one subtracted and then halved gives this sequence back.
FORMULA
a(1) = 1, a(2n+1) = 1 + 2*a(n), a(2n) = A242378(A001511(n), (1+A000265(n))) - 1. [Where 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].
PROG
(Scheme, with memoization-macro definec)
(definec (A246678 n) (cond ((<= n 1) n) ((odd? n) (+ 1 (* 2 (A246678 (/ (- n 1) 2))))) (else (+ -1 (A242378bi (A007814 n) (+ 1 (A000265 n))))))) ;; Code for A242378bi given in A242378.
CROSSREFS
Inverse: A246677.
Variants: A246676, A246684.
Even bisection halved: A246680.
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 01 2014
STATUS
approved
Transpose of array A242378.
+20
2
0, 0, 1, 0, 1, 2, 0, 1, 3, 3, 0, 1, 5, 5, 4, 0, 1, 7, 7, 9, 5, 0, 1, 11, 11, 25, 7, 6, 0, 1, 13, 13, 49, 11, 15, 7, 0, 1, 17, 17, 121, 13, 35, 11, 8, 0, 1, 19, 19, 169, 17, 77, 13, 27, 9, 0, 1, 23, 23, 289, 19, 143, 17, 125, 25, 10, 0, 1, 29, 29, 361, 23, 221, 19, 343, 49, 21, 11
OFFSET
0,6
COMMENTS
Please see comments at A242378.
PROG
(Scheme) (define (A242379 n) (A242378bi (A025581 n) (A002262 n))) ;; The rest of code as in A242378.
CROSSREFS
Transpose: A242378.
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, May 12 2014
STATUS
approved
Completely multiplicative with a(prime(k)) = prime(k+1).
+10
873
1, 3, 5, 9, 7, 15, 11, 27, 25, 21, 13, 45, 17, 33, 35, 81, 19, 75, 23, 63, 55, 39, 29, 135, 49, 51, 125, 99, 31, 105, 37, 243, 65, 57, 77, 225, 41, 69, 85, 189, 43, 165, 47, 117, 175, 87, 53, 405, 121, 147, 95, 153, 59, 375, 91, 297, 115, 93, 61, 315, 67, 111, 275, 729, 119
OFFSET
1,2
COMMENTS
Meyers (see Guy reference) conjectures that for all r >= 1, the least odd number not in the set {a(i): i < prime(r)} is prime(r+1). - N. J. A. Sloane, Jan 08 2021
Meyers' conjecture would be refuted if and only if for some r there were such a large gap between prime(r) and prime(r+1) that there existed a composite c for which prime(r) < c < a(c) < prime(r+1), in which case (by Bertrand's postulate) c would necessarily be a term of A246281. - Antti Karttunen, Mar 29 2021
a(n) is odd for all n and for each odd m there exists a k with a(k) = m (see A064216). a(n) > n for n > 1: bijection between the odd and all numbers. - Reinhard Zumkeller, Sep 26 2001
a(n) and n have the same number of distinct primes with (A001222) and without multiplicity (A001221). - Michel Marcus, Jun 13 2014
From Antti Karttunen, Nov 01 2019: (Start)
More generally, a(n) has the same prime signature as n, A046523(a(n)) = A046523(n). Also A246277(a(n)) = A246277(n) and A287170(a(n)) = A287170(n).
Many permutations and other sequences that employ prime factorization of n to encode either polynomials, partitions (via Heinz numbers) or multisets in general can be easily defined by using this sequence as one of their constituent functions. See the last line in the Crossrefs section for examples.
(End)
REFERENCES
Richard K. Guy, editor, Problems From Western Number Theory Conferences, Labor Day, 1983, Problem 367 (Proposed by Leroy F. Meyers, The Ohio State U.).
FORMULA
If n = Product p(k)^e(k) then a(n) = Product p(k+1)^e(k).
Multiplicative with a(p^e) = A000040(A000720(p)+1)^e. - David W. Wilson, Aug 01 2001
a(n) = Product_{k=1..A001221(n)} A000040(A049084(A027748(n,k))+1)^A124010(n,k). - Reinhard Zumkeller, Oct 09 2011 [Corrected by Peter Munn, Nov 11 2019]
A064989(a(n)) = n and a(A064989(n)) = A000265(n). - Antti Karttunen, May 20 2014 & Nov 01 2019
A001221(a(n)) = A001221(n) and A001222(a(n)) = A001222(n). - Michel Marcus, Jun 13 2014
From Peter Munn, Oct 31 2019: (Start)
a(n) = A225546((A225546(n))^2).
a(A225546(n)) = A225546(n^2).
(End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} ((p^2-p)/(p^2-nextprime(p))) = 2.06399637... . - Amiram Eldar, Nov 18 2022
EXAMPLE
a(12) = a(2^2 * 3) = a(prime(1)^2 * prime(2)) = prime(2)^2 * prime(3) = 3^2 * 5 = 45.
a(A002110(n)) = A002110(n + 1) / 2.
MAPLE
a:= n-> mul(nextprime(i[1])^i[2], i=ifactors(n)[2]):
seq(a(n), n=1..80); # Alois P. Heinz, Sep 13 2017
MATHEMATICA
a[p_?PrimeQ] := a[p] = Prime[ PrimePi[p] + 1]; a[1] = 1; a[n_] := a[n] = Times @@ (a[#1]^#2& @@@ FactorInteger[n]); Table[a[n], {n, 1, 65}] (* Jean-François Alcover, Dec 01 2011, updated Sep 20 2019 *)
Table[Times @@ Map[#1^#2 & @@ # &, FactorInteger[n] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[n == 1], {n, 65}] (* Michael De Vlieger, Mar 24 2017 *)
PROG
(PARI) a(n)=local(f); if(n<1, 0, f=factor(n); prod(k=1, matsize(f)[1], nextprime(1+f[k, 1])^f[k, 2]))
(PARI) a(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Michel Marcus, May 17 2014
(Haskell)
a003961 1 = 1
a003961 n = product $ map (a000040 . (+ 1) . a049084) $ a027746_row n
-- Reinhard Zumkeller, Apr 09 2012, Oct 09 2011
(MIT/GNU Scheme, with Aubrey Jaffer's SLIB Scheme library)
(require 'factor)
(define (A003961 n) (apply * (map A000040 (map 1+ (map A049084 (factor n))))))
;; Antti Karttunen, May 20 2014
(Perl) use ntheory ":all"; sub a003961 { vecprod(map { next_prime($_) } factor(shift)); } # Dana Jacobsen, Mar 06 2016
(Python)
from sympy import factorint, prime, primepi, prod
def a(n):
f=factorint(n)
return 1 if n==1 else prod(prime(primepi(i) + 1)**f[i] for i in f)
[a(n) for n in range(1, 11)] # Indranil Ghosh, May 13 2017
CROSSREFS
See A045965 for another version.
Row 1 of table A242378 (which gives the "k-th powers" of this sequence), row 3 of A297845 and of A306697. See also arrays A066117, A246278, A255483, A308503, A329050.
Cf. A064989 (a left inverse), A064216, A000040, A002110, A000265, A027746, A046523, A048673 (= (a(n)+1)/2), A108228 (= (a(n)-1)/2), A191002 (= a(n)*n), A252748 (= a(n)-2n), A286385 (= a(n)-sigma(n)), A283980 (= a(n)*A006519(n)), A341529 (= a(n)*sigma(n)), A326042, A049084, A001221, A001222, A122111, A225546, A260443, A245606, A244319, A246269 (= A065338(a(n))), A322361 (= gcd(n, a(n))), A305293.
Cf. A249734, A249735 (bisections).
Cf. A246261 (a(n) is of the form 4k+1), A246263 (of the form 4k+3), A246271, A246272, A246259, A246281 (n such that a(n) < 2n), A246282 (n such that a(n) > 2n), A252742.
Cf. A275717 (a(n) > a(n-1)), A275718 (a(n) < a(n-1)).
Cf. A003972 (Möbius transform), A003973 (Inverse Möbius transform), A318321.
Cf. A300841, A305421, A322991, A250469, A269379 for analogous shift-operators in other factorization and quasi-factorization systems.
Cf. also following permutations and other sequences that can be defined with the help of this sequence: A005940, A163511, A122111, A260443, A206296, A265408, A265750, A275733, A275735, A297845, A091202 & A091203, A250245 & A250246, A302023 & A302024, A302025 & A302026.
A version for partition numbers is A003964, strict A357853.
A permutation of A005408.
Applying the same transformation again gives A357852.
Other multiplicative sequences: A064988, A357977, A357978, A357980, A357983.
A056239 adds up prime indices, row-sums of A112798.
KEYWORD
nonn,mult,nice
AUTHOR
STATUS
approved
Self-inverse permutation of the positive integers induced by partition enumeration in A112798 and partition conjugation.
+10
291
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,2
COMMENTS
Factor n; replace each prime(i) with i, take the conjugate partition, replace parts i with prime(i) and multiply out.
From Antti Karttunen, May 12-19 2014: (Start)
For all n >= 1, A001222(a(n)) = A061395(n), and vice versa, A061395(a(n)) = A001222(n).
Because the partition conjugation doesn't change the partition's total sum, this permutation preserves A056239, i.e., A056239(a(n)) = A056239(n) for all n.
(Similarly, for all n, A001221(a(n)) = A001221(n), because the number of steps in the Ferrers/Young-diagram stays invariant under the conjugation. - Note added Apr 29 2022).
Because this permutation commutes with A241909, in other words, as a(A241909(n)) = A241909(a(n)) for all n, from which follows, because both permutations are self-inverse, that a(n) = A241909(a(A241909(n))), it means that this is also induced when partitions are conjugated in the partition enumeration system A241918. (Not only in A112798.)
(End)
From Antti Karttunen, Jul 31 2014: (Start)
Rows in arrays A243060 and A243070 converge towards this sequence, and also, assuming no surprises at the rate of that convergence, this sequence occurs also as the central diagonal of both.
Each even number is mapped to a unique term of A102750 and vice versa.
Conversely, each odd number (larger than 1) is mapped to a unique term of A070003, and vice versa. The permutation pair A243287-A243288 has the same property. This is also used to induce the permutations A244981-A244984.
Taking the odd bisection and dividing out the largest prime factor results in the permutation A243505.
Shares with A245613 the property that each term of A028260 is mapped to a unique term of A244990 and each term of A026424 is mapped to a unique term of A244991.
Conversely, with A245614 (the inverse of above), shares the property that each term of A244990 is mapped to a unique term of A028260 and each term of A244991 is mapped to a unique term of A026424.
(End)
The Maple program follows the steps described in the first comment. The subprogram C yields the conjugate partition of a given partition. - Emeric Deutsch, May 09 2015
The Heinz number of the partition that is conjugate to the partition with Heinz number n. The Heinz number of a partition p = [p_1, p_2, ..., p_r] is defined as Product(p_j-th prime, j=1...r). Example: a(3) = 4. Indeed, the partition with Heinz number 3 is [2]; its conjugate is [1,1] having Heinz number 4. - Emeric Deutsch, May 19 2015
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) = A000079(A241917(n)) * A003961(a(A052126(n))).
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:
a(n) = A153212(A242419(n)) = A242419(A153212(n)).
a(n) = A241909(A241916(n)) = A241916(A241909(n)).
a(n) = A243505(A048673(n)).
a(n) = A064216(A243506(n)).
Other identities. For all n >= 1, the following holds:
A006530(a(n)) = A105560(n). [The latter sequence gives greatest prime factor of the n-th term].
a(2n)/a(n) = A105560(2n)/A105560(n), which is equal to A003961(A105560(n))/A105560(n) when n > 1.
A243505(n) = A052126(a(2n-1)) = A052126(a(4n-2)).
A066829(n) = A244992(a(n)) and vice versa, A244992(n) = A066829(a(n)).
A243503(a(n)) = A243503(n). [Because partition conjugation does not change the partition size.]
A238690(a(n)) = A238690(n). - per Matthew Vandermast's note in that sequence.
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
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`(j<i, 0, 1), j=l)), i=1..max(l)))(
[seq(numtheory[pi](i[1])$i[2], i=ifactors(n)[2])]):
seq(a(n), n=1..60); # Alois 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[j<i, 0, 1], {j, l}]], {i, 1, Max[l]}]][Flatten[Table[Table[PrimePi[f[[1]]], {f[[2]]}], {f, FactorInteger[n]}]]];
Array[a, 60] (* Jean-François Alcover, Sep 23 2020, after Alois P. Heinz *)
PROG
(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
(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
(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
CROSSREFS
Cf. A088902 (fixed points).
Cf. A112798, A241918 (conjugates the partitions listed in these two tables).
Cf. A243060 and A243070. (Limit of rows in these arrays, and also their central diagonal).
Cf. A319988 (parity of this sequence for n > 1), A336124 (a(n) mod 4).
{A000027, A122111, A241909, A241916} form a 4-group.
{A000027, A122111, A153212, A242419} form also a 4-group.
Cf. also array A350066 [A(i, j) = a(a(i)*a(j))].
KEYWORD
nonn,nice
AUTHOR
STATUS
approved
Prime shift array: Square array read by antidiagonals: A(1,col) = 2*col, and for row > 1, A(row,col) = A003961(A(row-1,col)).
+10
83
2, 4, 3, 6, 9, 5, 8, 15, 25, 7, 10, 27, 35, 49, 11, 12, 21, 125, 77, 121, 13, 14, 45, 55, 343, 143, 169, 17, 16, 33, 175, 91, 1331, 221, 289, 19, 18, 81, 65, 539, 187, 2197, 323, 361, 23, 20, 75, 625, 119, 1573, 247, 4913, 437, 529, 29, 22, 63, 245, 2401, 209, 2873, 391, 6859, 667, 841, 31
OFFSET
2,1
COMMENTS
The array is read by antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
This array can be obtained by taking every second column from array A242378, starting from its column 2.
Permutation of natural numbers larger than 1.
The terms on row n are all divisible by n-th prime, A000040(n).
Each column is strictly growing, and the terms in the same column have the same prime signature.
A055396(n) gives the row number of row where n occurs,
and A246277(n) gives its column number, both starting from 1.
From Antti Karttunen, Jan 03 2015: (Start)
A252759(n) gives their sum minus one, i.e. the Manhattan distance of n from the top left corner.
If we assume here that a(1) = 1 (but which is not explicitly included because outside of the array), then A252752 gives the inverse permutation. See also A246276.
(End)
FORMULA
A(1,col) = 2*col, and for row > 1, A(row,col) = A003961(A(row-1,col)).
As a composition of other similar sequences:
a(n) = A122111(A253561(n)).
a(n) = A249818(A083221(n)).
For all n >= 1, a(n+1) = A005940(1+A253551(n)).
A(n, k) = A341606(n, k) * A355925(n, k). - Antti Karttunen, Jul 22 2022
EXAMPLE
The top left corner of the array:
2, 4, 6, 8, 10, 12, 14, 16, 18, ...
3, 9, 15, 27, 21, 45, 33, 81, 75, ...
5, 25, 35, 125, 55, 175, 65, 625, 245, ...
7, 49, 77, 343, 91, 539, 119, 2401, 847, ...
11, 121, 143, 1331, 187, 1573, 209, 14641, 1859, ...
13, 169, 221, 2197, 247, 2873, 299, 28561, 3757, ...
MATHEMATICA
f[p_?PrimeQ] := f[p] = Prime[PrimePi@ p + 1]; f[1] = 1; f[n_] := f[n] = Times @@ (f[First@ #]^Last@ # &) /@ FactorInteger@ n; Block[{lim = 12}, Table[#[[n - k, k]], {n, 2, lim}, {k, n - 1, 1, -1}] &@ NestList[Map[f, #] &, Table[2 k, {k, lim}], lim]] // Flatten (* Michael De Vlieger, Jan 04 2016, after Jean-François Alcover at A003961 *)
PROG
(Scheme)
(define (A246278 n) (if (<= n 1) n (A246278bi (A002260 (- n 1)) (A004736 (- n 1))))) ;; Square array starts with offset=2, and we have also tacitly defined a(1) = 1 here.
(define (A246278bi row col) (if (= 1 row) (* 2 col) (A003961 (A246278bi (- row 1) col))))
CROSSREFS
First row: A005843 (the even numbers), from 2 onward.
Row 2: A249734, Row 3: A249827.
Column 1: A000040 (primes), Column 2: A001248 (squares of primes), Column 3: A006094 (products of two successive primes), Column 4: A030078 (cubes of primes).
Transpose: A246279.
Inverse permutation: A252752.
One more than A246275.
Arrays obtained by applying a particular function (given in parentheses) to the entries of this array. Cases where the columns grow monotonically are indicated with *: A249822 (A078898), A253551 (* A156552), A253561 (* A122111), A341605 (A017665), A341606 (A017666), A341607 (A006530 o A017666), A341608 (A341524), A341626 (A341526), A341627 (A341527), A341628 (A006530 o A341527), A342674 (A341530), A344027 (* A003415, arithmetic derivative), A355924 (A342671), A355925 (A009194), A355926 (A355442), A355927 (* sigma), A356155 (* A258851), A372562 (A252748), A372563 (A286385), A378979 (* deficiency, A033879), A379008 (* (probably), A294898), A379010 (* A000010, Euler phi), A379011 (* A083254).
Cf. A329050 (subtable).
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Aug 21 2014
EXTENSIONS
Starting offset of the linear sequence changed from 1 to 2, without affecting the column and row indices by Antti Karttunen, Jan 03 2015
STATUS
approved
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).
+10
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
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.
A122111 commutes with this one, that is, a(n) = A122111(a(A122111(n))).
Conjugates between A243051 and A242424 and other rows of A243060 and A243070.
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:
a(1) = 1, a(p_k) = 2^k for primes with index k, otherwise a(n) = (A000040(A001222(n))^(A241917(n)+1)) * A052126(a(A052126(n))).
And the latter formula with this recurrence:
a(1) = 1, and for n>1, if n = 2^k, a(n) = A000040(k), otherwise a(n) = A000040(A001511(n)) * A242378(A007814(n), a(A064989(n))).
[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:
a(1)=1, and for n>1, a(n) = Product_{i=A203623(n-1)+2..A203623(n)+1} A000040(A241918(i)).
For all n >= 1, A001222(a(n)) = A061395(n), and vice versa, A061395(a(n)) = A001222(n).
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
(Scheme, with Antti Karttunen's IntSeq-library)
(definec (A241909 n) (cond ((<= n 1) n) ((prime? n) (A000079 (A049084 n))) (else (* (A052126 (A241909 (A052126 n))) (expt (A000040 (A001222 n)) (+ 1 (A241917 n)))))))
;; Another recursive version:
(definec (A241909 n) (cond ((<= n 2) n) ((pow2? n) (A000040 (A007814 n))) (else (* (A000040 (A001511 n)) (A242378bi (A007814 n) (A241909 (A064989 n))))))) ;; The function A242378bi is given in A242378.
(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
-- Reinhard Zumkeller, Aug 04 2014
(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. also A278220 (= A046523(a(n))), A331280 (its rgs_transform), A331299 (= min(n,a(n))).
{A000027, A122111, A241909, A241916} form a 4-group.
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 03 2014, partly inspired by Marc LeBrun's Jan 11 2006 message on SeqFan mailing list.
EXTENSIONS
Typos in the name corrected by Antti Karttunen, May 31 2014
STATUS
approved
Square array A(n,k) = prime(n+1)^(2^k), read by descending antidiagonals (0,0), (0,1), (1,0), (0,2), (1,1), (2,0), ...; Fermi-Dirac primes (A050376) in matrix form, sorted into rows by their prime divisor.
+10
19
2, 4, 3, 16, 9, 5, 256, 81, 25, 7, 65536, 6561, 625, 49, 11, 4294967296, 43046721, 390625, 2401, 121, 13, 18446744073709551616, 1853020188851841, 152587890625, 5764801, 14641, 169, 17, 340282366920938463463374607431768211456, 3433683820292512484657849089281, 23283064365386962890625, 33232930569601, 214358881, 28561, 289, 19
OFFSET
0,1
COMMENTS
This sequence is a permutation of A050376, so every positive integer is the product of a unique subset, S_factors, of its terms. If we restrict S_factors to be chosen from a subset, S_0, consisting of numbers from specified rows and/or columns of this array, there are notable sequences among those that may be generated. See the examples. Other notable sequences can be generated if we restrict the intersection of S_factors with specific rows/columns to have even cardinality. In any of the foregoing cases, the numbers in the resulting sequence form a group under the binary operation A059897(.,.).
Shares with array A246278 the property that columns grow downward by iterating A003961, and indeed, this array can be obtained from A246278 by selecting its columns 1, 2, 8, 128, ..., 2^((2^k)-1), for k >= 0.
A(n,k) is the image of the lattice point with coordinates X=n and Y=k under the inverse of the bijection f defined in the first comment of A306697. This geometric relationship can be used to construct an isomorphism from the polynomial ring GF(2)[x,y] to a ring over the positive integers, using methods similar to those for constructing A297845 and A306697. See A329329, the ring's multiplicative operator, for details.
FORMULA
A(0,k) = 2^(2^k), and for n > 0, A(n,k) = A003961(A(n-1,k)).
A(n,k) = A182944(n+1,2^k).
A(n,k) = A329332(2^n,2^k).
A(k,n) = A225546(A(n,k)).
A(n,k+1) = A000290(A(n,k)) = A(n,k)^2.
EXAMPLE
The top left 5 X 5 corner of the array:
n\k | 0 1 2 3 4
----+-------------------------------------------------------
0 | 2, 4, 16, 256, 65536, ...
1 | 3, 9, 81, 6561, 43046721, ...
2 | 5, 25, 625, 390625, 152587890625, ...
3 | 7, 49, 2401, 5764801, 33232930569601, ...
4 | 11, 121, 14641, 214358881, 45949729863572161, ...
Column 0 continues as a list of primes, column 1 as a list of their squares, column 2 as a list of their 4th powers, and so on.
Every nonnegative power of 2 (A000079) is a product of a unique subset of numbers from row 0; every squarefree number (A005117) is a product of a unique subset of numbers from column 0. Likewise other rows and columns generate the sets of numbers from sequences:
Row 1: A000244 Powers of 3.
Column 1: A062503 Squares of squarefree numbers.
Row 2: A000351 Powers of 5.
Column 2: A113849 4th powers of squarefree numbers.
Union of rows 0 and 1: A003586 3-smooth numbers.
Union of columns 0 and 1: A046100 Biquadratefree numbers.
Union of row 0 / column 0: A122132 Oddly squarefree numbers.
Row 0 excluding column 0: A000302 Powers of 4.
Column 0 excluding row 0: A056911 Squarefree odd numbers.
All rows except 0: A005408 Odd numbers.
All columns except 0: A000290\{0} Positive squares.
All rows except 1: A001651 Numbers not divisible by 3.
All columns except 1: A252895 (have odd number of square divisors).
If, instead of restrictions on choosing individual factors of the product, we restrict the product to be of an even number of terms from each row of the array, we get A262675. The equivalent restriction applied to columns gives us A268390; applied only to column 0, we get A028260 (product of an even number of primes).
MATHEMATICA
Table[Prime[#]^(2^k) &[m - k + 1], {m, 0, 7}, {k, m, 0, -1}] // Flatten (* Michael De Vlieger, Dec 28 2019 *)
PROG
(PARI)
up_to = 105;
A329050sq(n, k) = (prime(1+n)^(2^k));
A329050list(up_to) = { my(v = vector(up_to), i=0); for(a=0, oo, for(col=0, a, i++; if(i > up_to, return(v)); v[i] = A329050sq(col, a-col))); (v); };
v329050 = A329050list(up_to);
A329050(n) = v329050[1+n];
for(n=0, up_to-1, print1(A329050(n), ", ")); \\ Antti Karttunen, Nov 06 2019
CROSSREFS
Transpose: A329049.
Permutation of A050376.
Rows 1-4: A001146, A011764, A176594, A165425 (after the two initial terms).
Antidiagonal products: A191555.
Subtable of A182944, A242378, A246278, A329332.
A000290, A003961, A225546 are used to express relationship between terms of this sequence.
Related binary operations: A059897, A306697, A329329.
See also the table in the example section.
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen and Peter Munn, Nov 02 2019
EXTENSIONS
Example annotated for clarity by Peter Munn, Feb 12 2020
STATUS
approved

Search completed in 0.019 seconds