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
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 *)
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.
Original entry on oeis.org
1, 2, 3, 4, 9, 5, 6, 12, 7, 8, 19, 10, 17, 42, 11, 13, 22, 26, 14, 29, 15, 16, 59, 18, 41, 32, 20, 31, 39, 21, 23, 92, 40, 24, 49, 25, 27, 82, 48, 28, 209, 30, 45, 52, 33, 63, 62, 54, 34, 109, 35, 36, 129, 37, 38, 69, 43, 68, 142, 70, 57, 72, 115, 44, 79, 46, 85, 292, 47, 50, 89, 74, 73, 202, 51, 53, 159, 87, 55, 99, 107, 56, 152, 58, 97, 192, 60
Offset: 1
a(5) = 9 because of the following. 2*A064216(5) = 2*4 = 8 = 2^3. We replace the prime factor 2 of 8 with the next prime 3 to get 3^3, then replace 3 with 5 to get 5^3 = 125. The smallest prime factor of 125 is 5. 125 is the 9th term of A084967: 5, 25, 35, 55, 65, 85, 95, 115, 125, ..., thus a(5) = 9.
-
t = PositionIndex[FactorInteger[#][[1, 1]] & /@ Range[10^6]]; f[n_] := Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n; Flatten@ Map[Position[Lookup[t, FactorInteger[#][[1, 1]] ], #] &[f@ f[2 #]] &, Table[Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1], {n, 87}]] (* Michael De Vlieger, Jul 25 2016, Version 10 *)
-
(define (A249746 n) (define (Ainv_of_A007310off0 n) (+ (* 2 (floor->exact (/ n 6))) (/ (- (modulo n 6) 1) 4))) (+ 1 (Ainv_of_A007310off0 (A003961 (+ n n -1)))))
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.
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 2, 0, -1, 0, 6, 0, 4, 0, 1, 0, -4, 0, 11, 0, -4, 4, 3, 0, 3, 0, 25, -1, -7, 0, 20, 0, -7, -1, 12, 0, 7, 0, -2, 4, -8, 0, 44, 0, 0, -2, 0, 0, 36, 0, 22, -2, -13, 0, 23, 0, -12, 8, 90, 0, 0, 0, -5, -2, 4, 0, 77, 0, -16, 4, -3, 0, 4, 0, 55, 28, -19, 0, 41, 0, -19, -4, 15, 0, 43, 0, -2, -3, -20, 0, 155, 0, 12, 5, 24, 0
Offset: 1
For n = 8 = 2*2*2, A003961(8) = 27 (3*3*3), and while 8 is on row 1 and column 4 of A083221, 27 on the next row is in column 5, thus a(8) = 5 - 4 = 1.
For n = 10 = 2*5, A003961(10) = 21 (3*7), and while 10 is on row 1 and column 5 of A083221, 21 on the next row is in column 4, thus a(10) = 4 - 5 = -1.
Cf.
A003961,
A078898,
A083221,
A083140,
A246277,
A249810,
A249817,
A249818,
A249821,
A249822,
A251721,
A251722.
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
Original entry on oeis.org
0, 1, 1, 2, 1, 3, 1, 5, 2, 4, 1, 8, 1, 6, 3, 14, 1, 13, 1, 11, 4, 7, 1, 23, 2, 9, 9, 17, 1, 18, 1, 41, 5, 10, 3, 38, 1, 12, 6, 32, 1, 28, 1, 20, 12, 15, 1, 68, 2, 25, 7, 26, 1, 63, 4, 50, 8, 16, 1, 53, 1, 19, 19, 122, 5, 33, 1, 29, 10, 39, 1, 113, 1, 21, 17, 35, 3, 43, 1, 95, 42, 22, 1, 83, 6, 24, 11, 59, 1, 88, 4, 44, 13, 27, 7, 203
Offset: 1
Cf.
A003961,
A078898,
A246277,
A249817,
A249818,
A249820,
A249821,
A249822,
A251721,
A251722,
A250469,
A250470.
Showing 1-10 of 12 results.
Comments