Original entry on oeis.org
0, 0, 5, 26, 124, 852, 7550, 86125, 1250924, 23748764
Offset: 1
a(3) = 5 since there are 5 ways to express A002110(3) = 30 as (prime(i) + prime(j))/2 with (prime(i) - prime(j))/2 also prime:
(53 + 7)/2 = 30, (53 - 7)/2 = 46/2 = 23
(47 + 13)/2 = 30, (47 - 13)/2 = 34/2 = 17
(43 + 17)/2 = 30, (43 - 17)/2 = 26/2 = 13
(41 + 19)/2 = 30, (41 - 19)/2 = 22/2 = 11
(37 + 23)/2 = 30, (37 - 23)/2 = 14/2 = 7.
- Eric Weisstein's World of Mathematics, Primorial
- Eric Weisstein's World of Mathematics, Totative
-
With[{j = 10^3}, Do[Module[{P = Times @@ Prime@ Range@ n, m}, m = PrimePi@ P; Print@ Total@ Reap[Do[Sow@ Count[Map[{2 P - #, #} &, Prime@ Range[Max[n, k], Min[k + j - 1, m]]], w_ /; And[PrimeQ@ First@ w, PrimeQ[(Subtract @@ w)/2]]], {k, 1, m, j}]][[-1, 1]]], {n, 9}]] (* or *)
Table[Function[P, Count[Map[{2 P - #, #} &, #], w_ /; And[PrimeQ@ First@ w, PrimeQ[(Subtract @@ w)/2]]] &@ Flatten@ Select[Prime@ Range[n + 1, PrimePi[P]], Times @@ Boole@ Map[PrimeQ, {#, P - #}] == 1 &]]@ Product[Prime@ i, {i, n}], {n, 9}] (* Michael De Vlieger, May 03 2017 *)
countOfPrimes = 0
countOfPrimes2 = 0
countOfPrimes3 = 0
Pn10 = 2*3*5*7*11*13*17*19*23*29
PnToUse = Pn10
distanceToCheck = PnToUse
For[i=0,iJamie Morken, May 05 2017 *)
A343119
Number of compositions (ordered partitions) of the n-th primorial into distinct parts.
Original entry on oeis.org
1, 1, 11, 41867, 517934206090276988507, 42635439758725572299058305546953458030363703549127905691758491973278624456679699932948789006991639715987
Offset: 0
-
b:= proc(n) b(n):= `if`(n=0, 1, b(n-1)*ithprime(n)) end:
g:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
`if`(k=0, `if`(n=0, 1, 0), g(n-k, k)+k*g(n-k, k-1)))
end:
a:= n-> add(g(b(n), k), k=0..floor((sqrt(8*b(n)+1)-1)/2)):
seq(a(n), n=0..5);
-
$RecursionLimit = 5000;
b[n_] := If[n == 0, 1, b[n - 1]*Prime[n]];
g[n_, k_] := g[n, k] = If[k < 0 || n < 0, 0,
If[k == 0, If[n == 0, 1, 0], g[n - k, k] + k*g[n - k, k - 1]]];
a[n_] := Sum[g[b[n], k], {k, 0, Floor[(Sqrt[8*b[n] + 1] - 1)/2]}];
Table[a[n], {n, 0, 5}] (* Jean-François Alcover, Apr 14 2022, after Alois P. Heinz *)
Original entry on oeis.org
0, 0, 1, 4, 15, 92, 757, 8899, 125261, 2232782, 51902553, 1327191561, 41351244491, 1452937916515, 54332144724834, 2246960940148460, 105818707666943651, 5595105626396158784, 308241771351984486729, 18772520681296116861073
Offset: 0
a(3) = 4 because there are 4 primes less than A005867(3) = 8: 2, 3, 5 and 7.
-
A372730(n) = primepi(prod(k=1, n, prime(k)-1)); \\ Antti Karttunen, May 22 2024
-
from sympy import prime,primepi
p = 1
l = [0]
for i in range(1,12):
p *= (prime(i) - 1)
l.append(primepi(p))
print(l)
A048980
Difference between number of nonprimes and primes in reduced residue system of primorial numbers.
Original entry on oeis.org
1, 1, 0, -6, -36, -196, -724, 7512, 366838, 11928316, 421130508, 14598816402, 584642184936, 25314953837836, 1128885572358548, 54492272309366314, 2950485568862138250, 213151926413154110951
Offset: 0
n=4, Q(4)=2*3*5*7=210, reduced residue system includes 48 terms:42 primes and 6 composites and 1: a(4)=6-42=-36.
-
Table[Function[P, EulerPhi@ P - 2 # &[PrimePi@ P - n]]@ Product[Prime@ i, {i, n}], {n, 0, 12}] (* Michael De Vlieger, May 08 2017 *)
A065898
Which composite number is the product of first n primes (the n-th primorial number)?: a(n) = k such that A002808(k) = A002110(n), or 0 if A002110(n) is not composite.
Original entry on oeis.org
0, 2, 19, 163, 1966, 26781, 468178, 9053660, 210809338, 6169323433, 192531847119, 7161249384065, 294835346718114, 12720163581273289, 599492054060678551, 31846920298131321838, 1882691381652701947175, 115037118886354670022443, 7718754971134321663159676
Offset: 1
a(3) = 19 because 2*3*5 = 30 = A002808(19) is the 19th composite number.
-
Table[q = Product[ Prime[i], {i, 1, n}]; q - PrimePi[q] - 1, {n, 1, 12}]
-
a(n) = my(m = vecprod(primes(n))); m - primepi(m) - 1; \\ Amiram Eldar, Aug 09 2024
Name clarified and a(13)-a(19) calculated from the data at
A000849 and added by
Amiram Eldar, Aug 09 2024
A066264
Number of composites < primorial(p) with all prime factors > p.
Original entry on oeis.org
0, 0, 0, 5, 141, 2517, 49835, 1012858, 24211837, 721500293, 22627459400, 844130935667, 34729870646917, 1491483322755273, 69890000837179156
Offset: 1
There are 5 composites < primorial(7) or 210 and whose prime factors are all larger than 7: 121 (11*11), 143 (11*13), 169 (13*13), 187 (11*17) and 209 (11*19).
- Eric Weisstein's World of Mathematics, Primorial
-
Array[#1 + EulerPhi@ #2 - PrimePi@ #2 - 1 & @@ {#, Product[Prime@ i, {i, #}]} &, 12] (* Michael De Vlieger, Apr 03 2019 *)
More terms from Dennis Martin (dennis.martin(AT)dptechnology.com), Apr 15 2007
Offset corrected by Charles J. Daniels (chajadan(AT)gmail.com), Dec 06 2009
A106558
a(n)=1+floor(sqrt(Pi/2)*p(n)#).
Original entry on oeis.org
3, 8, 38, 264, 2896, 37638, 639830, 12156759, 279605448, 8108557990, 251365297667, 9300516013674
Offset: 1
A166678
a(n) = pi((sqrt(P(n))+1)^2) - pi(P(n)), where pi(n) = number of primes <= n and P(n) = n-th primorial.
Original entry on oeis.org
2, 2, 3, 6, 14, 34, 110, 384, 1540, 7019, 34501, 183439, 1045196, 6164423, 38285946
Offset: 1
-
a[n_] := Product[Prime[k], {k, 1, n}]; Table[PrimePi[(Sqrt[a[n]] + 1)^2] - PrimePi[a[n]], {n, 1, 12}] (* G. C. Greubel, May 22 2016 *)
-
a(n) = my(P=vecprod(primes(n))); primepi((sqrt(P)+1)^2) - primepi(P); \\ Michel Marcus, Aug 15 2022
A276497
Number of noncomposites in the reduced residue system of n-th primorial number, A002110(n).
Original entry on oeis.org
1, 2, 8, 43, 339, 3243, 42325, 646022, 12283523, 300369787, 8028643000, 25948875073, 9414916809083, 362597750396727, 15397728527812844, 742238179058722876, 40068968501510691878
Offset: 1
-
Primorial[n_] := Product[Prime[j], {j, 1, n}];
Table[PrimePi[Primorial[n]] - n + 1, {n, 1, 12}]
-
a(n) = primepi(prod(k=1,n,prime(k))) - n + 1; \\ Michel Marcus, Oct 03 2016
Definition aligned with formulas and data by
Peter Munn, Sep 06 2023
A286424
Number of partitions of p_n# into parts (q, k) both coprime to p_n#, with q prime and k nonprime, where p_n# = A002110(n).
Original entry on oeis.org
0, 0, 1, 1, 4, 110, 1432, 23338, 397661, 8193828, 212858328, 5941706227
Offset: 0
a(0) = 0 by definition. A002110(0) = 1; 1 is coprime to all numbers; the only possible totative pair is (1,1) and this does not include both a prime and a nonprime.
a(1) = 0 since, of the floor(A005867(1)/2) = 1 totative pair (1,1) of A002110(1) = 2, none include a both a prime and a nonprime.
a(2) = 1 since, the only totative pair (1,5) of A002110(1) = 6 includes both a prime and a nonprime.
a(3) = 1 since only (1,29) includes both a prime and a nonprime.
a(4) = 4 since (23,187), (41,169), (67,143), (89,121) include a both a prime and a nonprime.
- C. K. Caldwell, The Prime Glossary, Primorial.
- Eric Weisstein's World of Mathematics, Totative.
-
Table[Function[P, Count[Prime@ Range[n + 1, PrimePi[P]], q_ /; ! PrimeQ[P - q]]]@ Product[Prime@ i, {i, n}], {n, 0, 9}] (* Michael De Vlieger, May 08 2017 *)
Comments