A250469
a(1) = 1; and for n > 1, a(n) = A078898(n)-th number k for which A055396(k) = A055396(n)+1, where A055396(n) is the index of smallest prime dividing n.
Original entry on oeis.org
1, 3, 5, 9, 7, 15, 11, 21, 25, 27, 13, 33, 17, 39, 35, 45, 19, 51, 23, 57, 55, 63, 29, 69, 49, 75, 65, 81, 31, 87, 37, 93, 85, 99, 77, 105, 41, 111, 95, 117, 43, 123, 47, 129, 115, 135, 53, 141, 121, 147, 125, 153, 59, 159, 91, 165, 145, 171, 61, 177, 67, 183, 155, 189, 119, 195, 71, 201, 175, 207, 73, 213, 79, 219, 185, 225, 143, 231, 83, 237, 205, 243, 89, 249, 133, 255
Offset: 1
Cf.
A000040,
A003961,
A016945,
A046523,
A055396,
A078898,
A083140,
A083221,
A084967,
A249744,
A249810,
A249820,
A249817,
A249818,
A250471,
A266645,
A280692,
A280693,
A283465.
-
a[1] = 1; a[n_] := If[PrimeQ[n], NextPrime[n], m1 = p1 = FactorInteger[n][[ 1, 1]]; For[k1 = 1, m1 <= n, m1 += p1; If[m1 == n, Break[]]; If[ FactorInteger[m1][[1, 1]] == p1, k1++]]; m2 = p2 = NextPrime[p1]; For[k2 = 1, True, m2 += p2, If[FactorInteger[m2][[1, 1]] == p2, k2++]; If[k1+2 == k2, Return[m2]]]]; Array[a, 100] (* Jean-François Alcover, Mar 08 2016 *)
g[n_] := If[n == 1, 0, PrimePi@ FactorInteger[n][[1, 1]]]; Function[s, MapIndexed[Lookup[s, g[First@ #2] + 1][[#1]] - Boole[First@ #2 == 1] &, #] &@ Map[Position[Lookup[s, g@#], #][[1, 1]] &, Range@ 120]]@ PositionIndex@ Array[g, 10^4] (* Michael De Vlieger, Mar 08 2017, Version 10 *)
A250246
Permutation of natural numbers: a(1) = 1, a(n) = A246278(A055396(n), a(A078898(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, 45, 34, 35, 36, 37, 38, 33, 40, 41, 54, 43, 44, 81, 46, 47, 48, 49, 50, 75, 52, 53, 42, 125, 56, 63, 58, 59, 60, 61, 62, 39, 64, 55, 90, 67, 68, 135, 70, 71, 72, 73, 74, 51, 76, 77, 66, 79, 80, 99, 82, 83
Offset: 1
Cf.
A003961,
A005843,
A020639,
A055396,
A078898,
A246278,
A250470,
A268674,
A278524,
A302042,
A302046.
Differs from the "vanilla version"
A249818 for the first time at n=42, where a(42) = 54, while
A249818(42) = 42.
Differs from
A250250 for the first time at n=73, where a(73) = 73, while
A250250(73) = 103.
-
up_to = 16384;
ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
A020639(n) = if(n>1, if(n>n=factor(n, 0)[1, 1], n, factor(n)[1, 1]), 1); \\ From A020639
A055396(n) = if(1==n,0,primepi(A020639(n)));
v078898 = ordinal_transform(vector(up_to,n,A020639(n)));
A078898(n) = v078898[n];
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
A250246(n) = if(1==n,n,my(k = 2*A250246(A078898(n)), r = A055396(n)); if(1==r, k, while(r>1, k = A003961(k); r--); (k))); \\ Antti Karttunen, Apr 01 2018
(Scheme, with memoizing-macro definec from Antti Karttunen's IntSeq-library, three alternative definitions)
(definec (A250246 n) (cond ((<= n 1) n) (else (A246278bi (A055396 n) (A250246 (A078898 n)))))) ;; Code for A246278bi given in A246278
(definec (A250246 n) (cond ((<= n 1) n) ((even? n) (* 2 (A250246 (/ n 2)))) (else (A003961 (A250246 (A250470 n))))))
(define (A250246 n) (A163511 (A252756 n)))
A249818
Permutation of natural numbers: a(1) = 1, a(n) = A246278(A055396(n),A078898(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, 45, 34, 35, 36, 37, 38, 33, 40, 41, 42, 43, 44, 81, 46, 47, 48, 49, 50, 75, 52, 53, 54, 125, 56, 63, 58, 59, 60, 61, 62, 39, 64, 55, 66, 67, 68, 135, 70, 71, 72, 73, 74, 51, 76, 77, 78, 79, 80, 99, 82, 83, 84, 175, 86, 105
Offset: 1
Other similar or related permutations:
A249816.
Cf.
A000040,
A005843,
A020639,
A055396,
A078898,
A083140,
A083221,
A246277,
A246278,
A246279,
A249822.
Differs from its inverse
A249817 for the first time at n=33, where a(33) = 45, while
A249817(33) = 39.
-
lim = 87; a003961[p_?PrimeQ] := a003961[p] = Prime[PrimePi@ p + 1]; a003961[1] = 1; a003961[n_] := a003961[n] = Times @@ (a003961[First@ #]^Last@ # &) /@ FactorInteger@ n; a055396[n_] := PrimePi[FactorInteger[n][[1, 1]]]; a078898 = Block[{nn = 90, spfs}, spfs = Table[FactorInteger[n][[1, 1]], {n, nn}]; Table[Count[Take[spfs, i], spfs[[i]]], {i, nn}]]; a246278 = NestList[Map[a003961, #] &, Table[2 k, {k, lim}], lim]; Table[a246278[[a055396@ n, a078898[[n]]]], {n, 2, lim}]
(* Michael De Vlieger, Jan 04 2016, after Harvey P. Dale at A055396 and A078898 *)
A268674
a(1) = 1, after which, for odd numbers: a(n) = A078898(n)-th number k for which A055396(k) = A055396(n)-1, and for even numbers: a(n) = a(A000265(n)).
Original entry on oeis.org
1, 1, 2, 1, 3, 2, 5, 1, 4, 3, 7, 2, 11, 5, 6, 1, 13, 4, 17, 3, 8, 7, 19, 2, 9, 11, 10, 5, 23, 6, 29, 1, 12, 13, 15, 4, 31, 17, 14, 3, 37, 8, 41, 7, 16, 19, 43, 2, 25, 9, 18, 11, 47, 10, 21, 5, 20, 23, 53, 6, 59, 29, 22, 1, 27, 12, 61, 13, 24, 15, 67, 4, 71, 31, 26, 17, 35, 14, 73, 3, 28, 37, 79, 8, 33, 41, 30, 7
Offset: 1
Differs from
A250470 for the first time at n=42, where a(42)=8, while
A250470(42) = 10.
-
(* b = A250469 *) b[1] = 1; b[n_] := If[PrimeQ[n], NextPrime[n], m1 = p1 = FactorInteger[n][[1, 1]]; For[ k1 = 1, m1 <= n, m1 += p1; If[m1 == n, Break[]]; If[ FactorInteger[m1][[1, 1]] == p1, k1++]]; m2 = p2 = NextPrime[p1]; For[k2 = 1, True, m2 += p2, If[ FactorInteger[m2][[1, 1]] == p2, k2++]; If[k1 + 2 == k2, Return[m2]]]];
a[1] = a[2] = 1; a[n_?EvenQ] := a[n] = a[n/2]; a[n_] := a[n] = For[k = 1, True, k++, If[b[k] == n, Return[k]]];
Array[a, 100] (* Jean-François Alcover, Mar 14 2016 *)
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, 9, 4, 12, 5, 42, 17, 19, 6, 59, 7, 22, 26, 209, 8, 82, 10, 92, 31, 29, 11, 292, 41, 32, 115, 109, 13, 129, 14, 1042, 40, 39, 48, 409, 15, 49, 45, 459, 16, 152, 18, 142, 180, 52, 20, 1459, 57, 202, 54, 159, 21, 572, 63, 542, 68, 62, 23, 642, 24, 69, 213
Offset: 1
a(4) = 9 because of the following. 2n = 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(4) = 9.
Cf.
A003961,
A048673,
A078898,
A084967,
A243071,
A246278,
A249734,
A249746,
A249826,
A250475,
A275716.
-
t = PositionIndex[FactorInteger[#][[1, 1]] & /@ Range[10^4]]; f[n_] := Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n; Flatten@ Table[Position[Lookup[t, FactorInteger[#][[1, 1]] ], #] &[f@ f[2 n]], {n, 120}] (* Michael De Vlieger, Jul 25 2016, Version 10 *)
-
(define (A249824 n) (A078898 (A003961 (A003961 (* 2 n)))))
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.
A302045
a(1) = 0, for n > 1, a(n) = A001511(A078898(n)); Number of instances of the smallest prime factor A020639(n) in nonstandard factorization of n that is based on the sieve of Eratosthenes (A083221).
Original entry on oeis.org
0, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 3, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 5, 2, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 4, 1, 1, 4, 2, 1, 1, 2, 1, 1, 3, 3, 2, 1, 1, 2, 1, 1, 1, 6, 1, 1, 1, 2, 3, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 4, 2, 1, 1, 2, 2, 1, 1, 3, 1, 1, 3, 2, 5, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1, 3, 2
Offset: 1
-
A020639(n) = { if(1==n,n,vecmin(factor(n)[, 1])); };
A078898(n) = { if(n<=1,n, my(spf=A020639(n),k=1,m=n/spf); while(m>1,if(A020639(m)>=spf,k++); m--); (k)); };
A001511(n) = 1+valuation(n,2);
A302045(n) = if(1==n,0,A001511(A078898(n)));
A250250
Permutation of natural numbers: a(1) = 1, a(n) = A246278(a(A055396(n)),a(A078898(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, 45, 34, 35, 36, 37, 38, 33, 40, 41, 54, 43, 44, 81, 46, 47, 48, 49, 50, 75, 52, 53, 42, 125, 56, 63, 58, 59, 60, 61, 62, 39, 64, 55, 90, 67, 68, 135, 70, 71, 72, 103, 74, 51, 76, 77, 66, 79, 80, 99, 82, 83
Offset: 1
Differs from the "vanilla version"
A249818 for the first time at n=42, where a(42) = 54, while
A249818(42) = 42.
Showing 1-10 of 94 results.
Comments