A251721
Square array of permutations: A(row,col) = A249822(row, A249821(row+1, col)), read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...
Original entry on oeis.org
1, 2, 1, 3, 2, 1, 5, 3, 2, 1, 4, 4, 3, 2, 1, 7, 6, 4, 3, 2, 1, 11, 7, 5, 4, 3, 2, 1, 6, 9, 6, 5, 4, 3, 2, 1, 13, 10, 7, 6, 5, 4, 3, 2, 1, 17, 5, 8, 7, 6, 5, 4, 3, 2, 1, 10, 12, 10, 8, 7, 6, 5, 4, 3, 2, 1, 19, 15, 11, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 13, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 8, 16, 14, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 23, 19, 15, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
Offset: 1
The top left corner of the array:
1, 2, 3, 5, 4, 7, 11, 6, 13, 17, 10, 19, 9, 8, 23, 29, 14, 15, 31, 22, ...
1, 2, 3, 4, 6, 7, 9, 10, 5, 12, 15, 8, 16, 19, 21, 22, 13, 24, 11, 27, ...
1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14, 15, 9, 16, 18, 20, 21, 23, 24, ...
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, ...
...
Inverse permutations can be found from array
A251722.
Cf.
A000027,
A002260,
A004736,
A078898,
A083221,
A246277,
A246278,
A249821,
A249822,
A250473,
A250474.
A251722
Square array of permutations: A(row,col) = A249822(row+1, A249821(row, col)), read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...
Original entry on oeis.org
1, 2, 1, 3, 2, 1, 5, 3, 2, 1, 4, 4, 3, 2, 1, 8, 9, 4, 3, 2, 1, 6, 5, 5, 4, 3, 2, 1, 14, 6, 6, 5, 4, 3, 2, 1, 13, 12, 7, 6, 5, 4, 3, 2, 1, 11, 7, 8, 7, 6, 5, 4, 3, 2, 1, 7, 8, 14, 8, 7, 6, 5, 4, 3, 2, 1, 23, 19, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 10, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 17, 17, 21, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 18, 42, 11, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
Offset: 1
The top left corner of the array:
1, 2, 3, 5, 4, 8, 6, 14, 13, 11, 7, 23, 9, 17, 18, 41, 10, 38, 12, 32, ...
1, 2, 3, 4, 9, 5, 6, 12, 7, 8, 19, 10, 17, 42, 11, 13, 22, 26, 14, 29, ...
1, 2, 3, 4, 5, 6, 7, 8, 14, 9, 10, 21, 11, 12, 13, 15, 33, 16, 25, 17, ...
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 28, 14, 15, 16, 17, 18, 19, ...
...
Inverse permutations can be found from array
A251721.
Cf.
A000027,
A002260,
A004736,
A078898,
A083221,
A246277,
A246278,
A249821,
A249822,
A250473,
A250474.
A250473
Length of the maximal prefix of noncomposite numbers on row n of A249821.
Original entry on oeis.org
3, 4, 8, 13, 27, 35, 56, 66, 92, 138, 153, 209, 252, 271, 316, 395, 472, 503, 592, 657, 686, 791, 865, 978, 1140, 1228, 1269, 1355, 1396, 1495, 1848, 1946, 2110, 2158, 2456, 2513, 2694, 2879, 3006, 3203, 3397, 3472, 3827, 3903, 4046, 4120, 4582, 5060, 5227, 5308, 5473, 5742, 5831, 6268, 6542, 6815, 7106, 7196, 7487, 7685, 7783, 8294, 9028, 9247, 9353, 9567, 10350
Offset: 1
A048673
Permutation of natural numbers: a(n) = (A003961(n)+1) / 2 [where A003961(n) shifts the prime factorization of n one step towards larger primes].
Original entry on oeis.org
1, 2, 3, 5, 4, 8, 6, 14, 13, 11, 7, 23, 9, 17, 18, 41, 10, 38, 12, 32, 28, 20, 15, 68, 25, 26, 63, 50, 16, 53, 19, 122, 33, 29, 39, 113, 21, 35, 43, 95, 22, 83, 24, 59, 88, 44, 27, 203, 61, 74, 48, 77, 30, 188, 46, 149, 58, 47, 31, 158, 34, 56, 138, 365, 60, 98, 36, 86, 73
Offset: 1
For n = 6, as 6 = 2 * 3 = prime(1) * prime(2), we have a(6) = ((prime(1+1) * prime(2+1))+1) / 2 = ((3 * 5)+1)/2 = 8.
For n = 12, as 12 = 2^2 * 3, we have a(12) = ((3^2 * 5) + 1)/2 = 23.
Cf.
A246351 (Numbers n such that a(n) < n.)
Cf.
A246352 (Numbers n such that a(n) >= n.)
Cf.
A246281 (Numbers n such that a(n) <= n.)
Cf.
A246282 (Numbers n such that a(n) > n.),
A252742 (their char. function)
Cf.
A246261 (Numbers n for which a(n) is odd.)
Cf.
A246263 (Numbers n for which a(n) is even.)
Cf.
A246342 (Iterates starting from n=12.)
Cf.
A246344 (Iterates starting from n=16.)
Cf.
A245447 (This permutation "squared", a(a(n)).)
Other permutations whose formulas refer to this sequence:
A122111,
A243062,
A243066,
A243500,
A243506,
A244154,
A244319,
A245605,
A245608,
A245610,
A245612,
A245708,
A246265,
A246267,
A246268,
A246363,
A249745,
A249824,
A249826, and also
A183209,
A254103 that are somewhat similar.
-
a048673 = (`div` 2) . (+ 1) . a045965
-- Reinhard Zumkeller, Jul 12 2012
-
f:= proc(n)
local F,q,t;
F:= ifactors(n)[2];
(1 + mul(nextprime(t[1])^t[2], t = F))/2
end proc:
seq(f(n),n=1..1000); # Robert Israel, Jan 15 2015
-
Table[(Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n, {n, 69}] (* Michael De Vlieger, Dec 18 2014, revised Mar 17 2016 *)
-
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
A048673(n) = (A003961(n)+1)/2; \\ Antti Karttunen, Dec 20 2014
-
A048673(n) = if(1==n,n,if(n%2,A253888(A048673((n-1)/2)),(3*A048673(n/2))-1)); \\ (Not practical, but demonstrates the construction as a binary tree). - Antti Karttunen, Feb 10 2021
-
from sympy import factorint, nextprime, prod
def a(n):
f = factorint(n)
return 1 if n==1 else (1 + prod(nextprime(i)**f[i] for i in f))//2 # Indranil Ghosh, May 09 2017
-
(define (A048673 n) (/ (+ 1 (A003961 n)) 2)) ;; Antti Karttunen, Dec 20 2014
New name and crossrefs to derived sequences added by
Antti Karttunen, Dec 20 2014
A064216
Replace each p^e with prevprime(p)^e in the prime factorization of odd numbers; inverse of sequence A048673 considered as a permutation of the natural numbers.
Original entry on oeis.org
1, 2, 3, 5, 4, 7, 11, 6, 13, 17, 10, 19, 9, 8, 23, 29, 14, 15, 31, 22, 37, 41, 12, 43, 25, 26, 47, 21, 34, 53, 59, 20, 33, 61, 38, 67, 71, 18, 35, 73, 16, 79, 39, 46, 83, 55, 58, 51, 89, 28, 97, 101, 30, 103, 107, 62, 109, 57, 44, 65, 49, 74, 27, 113, 82, 127, 85, 24, 131
Offset: 1
For n=11, the 11th odd number is 2*11 - 1 = 21 = 3^1 * 7^1. Replacing the primes 3 and 7 with the previous primes 2 and 5 gives 2^1 * 5^1 = 10, so a(11) = 10. - _Michael B. Porter_, Jul 25 2016
Cf.
A246361 (numbers n such that a(n) <= n.)
Cf.
A246362 (numbers n such that a(n) > n.)
Cf.
A246371 (numbers n such that a(n) < n.)
Cf.
A246372 (numbers n such that a(n) >= n.)
Cf.
A246373 (primes p such that a(p) >= p.)
Cf.
A246374 (primes p such that a(p) < p.)
Cf.
A246343 (iterates starting from n=12.)
Cf.
A246345 (iterates starting from n=16.)
Cf.
A245448 (this permutation "squared", a(a(n)).)
Cf.
A253894,
A254044,
A254045 (binary width, weight and the number of nonleading zeros in base-2 representation of a(n), respectively).
Here obviously the variant 2,
A151799(n) =
A007917(n-1), of the prevprime function is used.
-
Table[Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1], {n, 69}] (* Michael De Vlieger, Dec 18 2014, revised Mar 17 2016 *)
-
a(n) = {my(f = factor(2*n-1)); for (k=1, #f~, f[k,1] = precprime(f[k,1]-1)); factorback(f);} \\ Michel Marcus, Mar 17 2016
-
from sympy import factorint, prevprime
from operator import mul
def a(n):
f=factorint(2*n - 1)
return 1 if n==1 else reduce(mul, [prevprime(i)**f[i] for i in f]) # Indranil Ghosh, May 13 2017
-
(define (A064216 n) (A064989 (- (+ n n) 1))) ;; Antti Karttunen, May 12 2014
A246277
Column index of n in A246278: a(1) = 0, a(2n) = n, a(2n+1) = a(A064989(2n+1)).
Original entry on oeis.org
0, 1, 1, 2, 1, 3, 1, 4, 2, 5, 1, 6, 1, 7, 3, 8, 1, 9, 1, 10, 5, 11, 1, 12, 2, 13, 4, 14, 1, 15, 1, 16, 7, 17, 3, 18, 1, 19, 11, 20, 1, 21, 1, 22, 6, 23, 1, 24, 2, 25, 13, 26, 1, 27, 5, 28, 17, 29, 1, 30, 1, 31, 10, 32, 7, 33, 1, 34, 19, 35, 1, 36, 1, 37, 9, 38, 3, 39, 1, 40, 8, 41, 1, 42
Offset: 1
Terms of
A348717 halved.
A305897 is the restricted growth sequence transform.
Cf.
A000040,
A001222,
A001358,
A003961,
A055396,
A064989,
A064216,
A243055,
A246272,
A249810,
A249820,
A249735,
A252463.
This sequence is also used in the definition of the following permutations:
A246274,
A246276,
A246675,
A246677,
A246683,
A249815,
A249817 (
A249818),
A249823,
A249825,
A250244,
A250245,
A250247,
A250249.
-
a246277[n_Integer] := Module[{f, p, a064989, a},
f[x_] := Transpose@FactorInteger[x];
p[x_] := Which[
x == 1, 1,
x == 2, 1,
True, NextPrime[x, -1]];
a064989[x_] := Times @@ Power[p /@ First[f[x]], Last[f[x]]];
a[1] = 0;
a[x_] := If[EvenQ[x], x/2, NestWhile[a064989, x, OddQ]/2];
a/@Range[n]]; a246277[84] (* Michael De Vlieger, Dec 19 2014 *)
-
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
A246277(n) = { if(1==n, 0, while((n%2), n = A064989(n)); (n/2)); };
-
A246277(n) = if(1==n, 0, my(f = factor(n), k = primepi(f[1,1])-1); for (i=1, #f~, f[i,1] = prime(primepi(f[i,1])-k)); factorback(f)/2); \\ Antti Karttunen, Apr 30 2022
-
from sympy import factorint, prevprime
from operator import mul
from functools import reduce
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 a(n): return 0 if n==1 else n//2 if n%2==0 else a(a064989(n))
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
-
;; two different variants, the second one employing memoizing definec-macro)
(define (A246277 n) (if (= 1 n) 0 (let loop ((n n)) (if (even? n) (/ n 2) (loop (A064989 n))))))
(definec (A246277 n) (cond ((= 1 n) 0) ((even? n) (/ n 2)) (else (A246277 (A064989 n)))))
A083221
Sieve of Eratosthenes arranged as an array and read by antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...
Original entry on oeis.org
2, 4, 3, 6, 9, 5, 8, 15, 25, 7, 10, 21, 35, 49, 11, 12, 27, 55, 77, 121, 13, 14, 33, 65, 91, 143, 169, 17, 16, 39, 85, 119, 187, 221, 289, 19, 18, 45, 95, 133, 209, 247, 323, 361, 23, 20, 51, 115, 161, 253, 299, 391, 437, 529, 29, 22, 57, 125, 203, 319, 377, 493, 551, 667
Offset: 2
The top left corner of the array:
2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26
3, 9, 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, 75
5, 25, 35, 55, 65, 85, 95, 115, 125, 145, 155, 175, 185
7, 49, 77, 91, 119, 133, 161, 203, 217, 259, 287, 301, 329
11, 121, 143, 187, 209, 253, 319, 341, 407, 451, 473, 517, 583
13, 169, 221, 247, 299, 377, 403, 481, 533, 559, 611, 689, 767
17, 289, 323, 391, 493, 527, 629, 697, 731, 799, 901, 1003, 1037
19, 361, 437, 551, 589, 703, 779, 817, 893, 1007, 1121, 1159, 1273
23, 529, 667, 713, 851, 943, 989, 1081, 1219, 1357, 1403, 1541, 1633
29, 841, 899, 1073, 1189, 1247, 1363, 1537, 1711, 1769, 1943, 2059, 2117
...
Cf.
A002260,
A004736,
A004280,
A020639,
A038179,
A055396,
A078898,
A138511,
A249820,
A249730,
A249735,
A249744,
A250469,
A250470,
A250472,
A250474.
-
lim = 11; a = Table[Take[Prime[n] Select[Range[lim^2], GCD[# Prime@ n, Product[Prime@ i, {i, 1, n - 1}]] == 1 &], lim], {n, lim}]; Flatten[Table[a[[i, n - i + 1]], {n, lim}, {i, n}]] (* Michael De Vlieger, Jan 04 2016, after Yasutoshi Kohmoto at A083140 *)
A249817
Permutation of natural numbers: a(1) = 1, a(n) = A083221(A055396(n),A246277(n)).
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 27, 22, 23, 24, 25, 26, 21, 28, 29, 30, 31, 32, 39, 34, 35, 36, 37, 38, 63, 40, 41, 42, 43, 44, 33, 46, 47, 48, 49, 50, 75, 52, 53, 54, 65, 56, 99, 58, 59, 60, 61, 62, 57, 64, 95, 66, 67, 68, 111, 70, 71, 72, 73, 74, 51, 76, 77, 78, 79, 80, 45, 82, 83, 84, 155, 86, 135
Offset: 1
Other similar or related permutations:
A249815.
Cf.
A000040,
A005843,
A020639,
A055396,
A078898,
A083140,
A083221,
A246277,
A246278,
A246279,
A249821.
Differs from its inverse
A249818 for the first time at n=33, where a(33) = 39, while
A249818(33) = 45.
-
lim = 87; a083221 = Table[Take[Prime[n] Select[Range[Ceiling[lim/2]^2], GCD[# Prime@ n, Product[Prime@ i, {i, 1, n - 1}]] == 1 &], Ceiling[lim/2]], {n, Ceiling[lim/2]}]; a055396[n_] PrimePi[FactorInteger[n][[1, 1]]]; a246277[n_] := Which[n == 1, 0, EvenQ@ n, n/2, True, a246277[Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ Transpose@ FactorInteger@ n, Last@ Transpose@ FactorInteger@ n]]]; Table[a083221[[a055396@ n, a246277@ n]], {n, 2, lim}] (* Michael De Vlieger, Jan 04 2016, after Jean-François Alcover at A055396 and Yasutoshi Kohmoto at A083140 *)
-
(define (A249817 n) (if (= 1 n) n (A083221bi (A055396 n) (A246277 n)))) ;; Code for A083221bi given in A083221
;; Alternative version:
(define (A249817 n) (if (= 1 n) n (A083221bi (A055396 n) (A249821bi (A055396 n) (A078898 n))))) ;; Code for A249821bi given in A249821.
A250474
Number of times prime(n) occurs as the least prime factor among numbers 1 .. prime(n)^3: a(n) = A078898(A030078(n)).
Original entry on oeis.org
4, 5, 9, 14, 28, 36, 57, 67, 93, 139, 154, 210, 253, 272, 317, 396, 473, 504, 593, 658, 687, 792, 866, 979, 1141, 1229, 1270, 1356, 1397, 1496, 1849, 1947, 2111, 2159, 2457, 2514, 2695, 2880, 3007, 3204, 3398, 3473, 3828, 3904, 4047, 4121, 4583, 5061, 5228, 5309, 5474, 5743, 5832, 6269, 6543, 6816, 7107, 7197, 7488, 7686, 7784, 8295, 9029, 9248, 9354, 9568, 10351
Offset: 1
prime(1) = 2 occurs as the least prime factor in range [1,8] for four times (all even numbers <= 8), thus a(1) = 4.
prime(2) = 3 occurs as the least prime factor in range [1,27] for five times (when n is: 3, 9, 15, 21, 27), thus a(2) = 5.
Cf.
A000040,
A000879,
A001248,
A002110,
A005867,
A008683,
A008836,
A020639,
A030078,
A055396,
A078898,
A249821,
A251721,
A251722.
-
f[n_] := Count[Range[Prime[n]^3], x_ /; Min[First /@ FactorInteger[x]] == Prime@ n]; Array[f, 16] (* Michael De Vlieger, Mar 30 2015 *)
-
A250474(n) = 3 + primepi(prime(n)^2) - n; \\ Fast implementation.
for(n=1, 5001, write("b250474.txt", n, " ", A250474(n)));
\\ The following program reflects the given sum formula, but is far from the optimal solution:
allocatemem(234567890);
A002110(n) = prod(i=1, n, prime(i));
A020639(n) = if(1==n,n,vecmin(factor(n)[,1]));
A055396(n) = if(1==n,0,primepi(A020639(n)));
A250474(n) = { my(p2 = prime(n)^2); sumdiv(A002110(n-1), d, moebius(d)*(p2\d)); };
for(n=1, 23, print1(A250474(n),", "));
-
(define (A250474 n) (let loop ((k 2)) (if (not (prime? (A249821bi n k))) k (loop (+ k 1))))) ;; This is even slower. Code for A249821bi given in A249821.
A249822
Square array of permutations: A(row,col) = A078898(A246278(row,col)), read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...
Original entry on oeis.org
1, 2, 1, 3, 2, 1, 4, 3, 2, 1, 5, 5, 3, 2, 1, 6, 4, 9, 3, 2, 1, 7, 8, 4, 14, 3, 2, 1, 8, 6, 12, 4, 28, 3, 2, 1, 9, 14, 5, 21, 4, 36, 3, 2, 1, 10, 13, 42, 5, 33, 4, 57, 3, 2, 1, 11, 11, 17, 92, 5, 45, 4, 67, 3, 2, 1, 12, 7, 19, 33, 305, 5, 63, 4, 93, 3, 2, 1, 13, 23, 6, 25, 39, 455, 5, 80, 4, 139, 3, 2, 1, 14, 9, 59, 6, 43, 61, 944, 5, 116, 4, 154, 3, 2, 1, 15, 17, 7, 144, 6, 52, 70, 1238, 5, 148, 4, 210, 3, 2, 1
Offset: 1
The top left corner of the array:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ...
1, 2, 3, 5, 4, 8, 6, 14, 13, 11, 7, 23, 9, 17, 18, ...
1, 2, 3, 9, 4, 12, 5, 42, 17, 19, 6, 59, 7, 22, 26, ...
1, 2, 3, 14, 4, 21, 5, 92, 33, 25, 6, 144, 7, 32, 39, ...
1, 2, 3, 28, 4, 33, 5, 305, 39, 43, 6, 360, 7, 48, 50, ...
1, 2, 3, 36, 4, 45, 5, 455, 61, 52, 6, 597, 7, 63, 68, ...
1, 2, 3, 57, 4, 63, 5, 944, 70, 76, 6, 1053, 7, 95, 84, ...
1, 2, 3, 67, 4, 80, 5, 1238, 96, 99, 6, 1502, 7, 106, 121, ...
...
Inverse permutations can be found from table
A249821.
Row k+1 is a right-to-left composition of the first k rows of
A251722.
Showing 1-10 of 18 results.
Comments