cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-20 of 21 results. Next

A285905 a(n) = A275768(A002110(n)).

Original entry on oeis.org

0, 0, 5, 26, 124, 852, 7550, 86125, 1250924, 23748764
Offset: 1

Views

Author

Michael De Vlieger and Jamie Morken, May 03 2017

Keywords

Comments

The number of ways to express primorial p_n# = A002110(n) as (prime(i) + prime(j))/2 when (prime(i) - prime(j))/2 also is prime.
Let p_n < q <= prime(pi(p_n#)), with pi(p_n#) = A000849(n). All such primes q are coprime to primorial p_n# since they are larger than the greatest prime factor of p_n#. One of the two primes counted by a(n) must be a prime q, the other a prime r = (2p_n# - q). Further, (r - q) must be prime to be counted by a(n). Therefore an efficient method of computing a(n) begins with generating the range of prime totatives prime(n + 1) <= q <= prime(pi(p_n#)) of primorial p_n#, the number of which is given by A048862(n).
a(n) < A048862(n) < A000849(n) for n > 2.

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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

Views

Author

Alois P. Heinz, Apr 09 2021

Keywords

Comments

All terms are odd.

Crossrefs

Programs

  • Maple
    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);
  • Mathematica
    $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 *)

Formula

a(n) = A032020(A002110(n)).

A372730 Number of primes <= A005867(n).

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

Views

Author

Alexandre Herrera, May 11 2024

Keywords

Examples

			a(3) = 4 because there are 4 primes less than A005867(3) = 8: 2, 3, 5 and 7.
		

Crossrefs

Programs

  • PARI
    A372730(n) = primepi(prod(k=1, n, prime(k)-1)); \\ Antti Karttunen, May 22 2024
  • Python
    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)
    

Formula

a(n) = A000720(A005867(n)).

Extensions

a(9)-a(11) from Antti Karttunen, May 22 2024
a(12)-a(16) from Amiram Eldar, May 22 2024
a(17)-a(18) from Chai Wah Wu, Jun 04 2024
a(19) from Chai Wah Wu, Jun 05 2024

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

Views

Author

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    Table[Function[P, EulerPhi@ P - 2 # &[PrimePi@ P - n]]@ Product[Prime@ i, {i, n}], {n, 0, 12}] (* Michael De Vlieger, May 08 2017 *)

Formula

a(n) = A048863(n) - A048862(n) = A048866(A002110(n)).
a(n) = A005867(n) - 2*A000849(n) + 2*n.

Extensions

Corrected and extended by Max Alekseyev, Feb 22 2016

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

Views

Author

Labos Elemer, Nov 28 2001

Keywords

Examples

			a(3) = 19 because 2*3*5 = 30 = A002808(19) is the 19th composite number.
		

Crossrefs

Programs

  • Mathematica
    Table[q = Product[ Prime[i], {i, 1, n}]; q - PrimePi[q] - 1, {n, 1, 12}]
  • PARI
    a(n) = my(m = vecprod(primes(n))); m - primepi(m) - 1; \\ Amiram Eldar, Aug 09 2024

Formula

a(n) = A002110(n) - A000849(n) - 1. - Amiram Eldar, Aug 09 2024

Extensions

More terms from Robert G. Wilson v, Nov 29 2001
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

Views

Author

Patrick De Geest, Dec 10 2001

Keywords

Comments

There is a simple relationship between this sequence and the number of primes < primorial(p), as given by A000849 and sequence A005867 which gives the number of composites in primorial(p+1) having (p+1) as their lowest prime factor: a(n) = n + A005867(n) - A000849(n) - 1. - Dennis Martin (dennis.martin(AT)dptechnology.com), Apr 15 2007

Examples

			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).
		

Crossrefs

Programs

  • Mathematica
    Array[#1 + EulerPhi@ #2 - PrimePi@ #2 - 1 & @@ {#, Product[Prime@ i, {i, #}]} &, 12] (* Michael De Vlieger, Apr 03 2019 *)

Formula

a(n) = n + A005867(n) - A000849(n) - 1. - Michael De Vlieger, Apr 03 2019, citing Dennis Martin's comment above.

Extensions

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
a(14)-a(15) from Donovan Johnson, May 03 2010

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

Views

Author

Pierre CAMI, May 09 2005

Keywords

Comments

a(n) is an approximation to the number of primes less than p(n+1)#

Crossrefs

Cf. A000849.

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

Views

Author

Daniel Tisdale, Oct 18 2009, Oct 23 2009

Keywords

Comments

Conjecture: pi((sqrt(P(n))+1)^2) - pi(P(n)) >= n.

Crossrefs

Cf. A000720 (pi), A002110 (primorials), A000849 (pi(primorials)).

Programs

  • Mathematica
    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 *)
  • PARI
    a(n) = my(P=vecprod(primes(n))); primepi((sqrt(P)+1)^2) - primepi(P); \\ Michel Marcus, Aug 15 2022

Extensions

a(13)-a(15) from Ray Chandler, May 10 2010
Name edited by 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

Views

Author

Andres Cicuttin, Sep 29 2016

Keywords

Crossrefs

Programs

  • Mathematica
    Primorial[n_] := Product[Prime[j], {j, 1, n}];
    Table[PrimePi[Primorial[n]] - n + 1, {n, 1, 12}]
  • PARI
    a(n) = primepi(prod(k=1,n,prime(k))) - n + 1; \\ Michel Marcus, Oct 03 2016

Formula

a(n) = pi(primorial(n)) - n + 1, n > 0.
a(n) = A000849(n) - n + 1, n > 0.
a(n) = A048862(n) + 1. - Michel Marcus, Oct 03 2016

Extensions

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

Views

Author

Michael De Vlieger, May 08 2017

Keywords

Comments

Number of totative pairs (q, k) such that prime q + k nonprime = p_n# and both gcd(q, p_n#) = 1 and gcd(k, p_n#) = 1, with p_n < q <= pi(p_n#), where pi(p_n#) = A000849(n) - n = A048862(n).
Primes p_n < q <= pi(p_n#) are greater than the greatest prime factor of p_n# = p_n, and are thus coprime to p_n#. By the definition of primorial, we need not consider p >= p_n, as these p are divisors of p_n#, i.e., gcd(p, p_n#) = p. Since the totatives of m can be paired such that a + b = m, we need only determine if (p_n# - q) is not prime in order to count pairs (q, k).
a(n) < floor(A005867(n)/2).
a(n) <= A048862(n).
The totative pair (q,1) = (p_n# - 1, 1) is counted by a(n) for n in A057704, with (p_n# - 1) appearing in A057705.

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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 *)

Formula

a(n) = (A000010(A002110(n)) - A048863(n)) - 2*A117929(A002110(n))
= (A005867(n) - A048863(n)) - 2*A117929(A002110(n))
= A048862(n) - 2*A117929(A002110(n)).

Extensions

a(11) from Giovanni Resta, May 09 2017
Previous Showing 11-20 of 21 results. Next