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.

Showing 1-7 of 7 results.

A014237 a(n) = (n-th prime) - (n-th nonprime).

Original entry on oeis.org

1, -1, -1, -1, 2, 3, 5, 5, 8, 13, 13, 17, 20, 21, 23, 28, 33, 34, 39, 41, 41, 46, 49, 54, 61, 63, 64, 67, 67, 69, 82, 85, 89, 90, 99, 100, 105, 109, 112, 117, 122, 123, 131, 131, 134, 135, 146, 157, 159, 160, 163, 167, 167, 176, 181, 186, 191, 191, 196
Offset: 1

Views

Author

Keywords

Comments

a(n) = A000040(n) - A018252(n). - Reinhard Zumkeller, Apr 30 2014

Crossrefs

Programs

  • Haskell
    a014237 n = a000040 n - a018252 n  -- Reinhard Zumkeller, Apr 30 2014
    
  • Mathematica
    nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n+PrimePi@n];
    Table[Prime[n] - nonPrime[n], {n, 1, 70}] (* G. C. Greubel, Jun 22 2019 *)
  • Python
    from sympy import prime, composite
    def A014237(n):
        return 1 if n == 1 else prime(n)-composite(n-1) # Chai Wah Wu, Dec 27 2018

A067563 Product of n-th prime number and n-th composite number.

Original entry on oeis.org

8, 18, 40, 63, 110, 156, 238, 285, 368, 522, 620, 777, 902, 1032, 1175, 1378, 1593, 1708, 2010, 2272, 2409, 2686, 2905, 3204, 3686, 3939, 4120, 4494, 4796, 5085, 5842, 6288, 6713, 6950, 7599, 7852, 8478, 8965, 9352, 9861, 10382, 10860, 11842, 12159
Offset: 1

Views

Author

Rick L. Shepherd, Jan 29 2002

Keywords

Examples

			E.g. a(4)=63 because the fourth prime is 7 and the fourth composite is 9.
		

Crossrefs

Programs

  • Haskell
    a067563 n = a000040 n * a002808 n  -- Reinhard Zumkeller, Apr 30 2014
    
  • Mathematica
    Module[{nn=50,prs,comps,len},prs=Prime[Range[nn]];comps=Complement[ Range[ 4,3nn],prs];len=Min[nn,Length[comps]];Times@@@Thread[ {Take[ prs,len], Take[comps,len]}]](* Harvey P. Dale, Sep 02 2015 *)
  • Python
    from sympy import prime, composite
    def A067563(n):
        return prime(n)*composite(n) # Chai Wah Wu, Dec 27 2018

Formula

a(n) = prime(n) * composite(n).

A066277 Primes p(m) such that a prime number q exists so that p(m)-q = c(m), the m-th composite number.

Original entry on oeis.org

2, 3, 5, 7, 17, 23, 29, 31, 41, 43, 67, 89, 97, 131, 139, 157, 281, 311, 313, 331, 353, 379, 401, 431, 449, 499, 569, 571, 607, 631, 683, 733, 743, 751, 787, 829, 881, 883, 947, 967, 983, 1033, 1091, 1117, 1123, 1151, 1301, 1303, 1327, 1373, 1543, 1559
Offset: 1

Views

Author

Labos Elemer, Dec 10 2001

Keywords

Comments

Number of terms < 10^k: 4, 13, 41, 177, 1119, 6963, 48647, 359109, 2766164, ..., . - Robert G. Wilson v, Dec 11 2017

Examples

			p(25) = A000040(25) = 97; 97 - 61 = A002808(25) = c(25) = 38 and 61 is prime.
		

Crossrefs

Programs

  • Mathematica
    Composite[n_Integer] := FixedPoint[n + PrimePi@# +1 &, n + PrimePi@n +1]; fQ[n_] := PrimeQ[Prime@n - Composite@n]; Prime@ Select[ Range@250, fQ] (* Robert G. Wilson v, Dec 11 2017 *)

Formula

a(n) = prime(A060253(n)) or A000040(A060253(n)). - Michel Marcus, Dec 11 2017

A060253 Numbers n such that difference between n-th prime and n-th composite number is prime.

Original entry on oeis.org

1, 2, 3, 4, 7, 9, 10, 11, 13, 14, 19, 24, 25, 32, 34, 37, 60, 64, 65, 67, 71, 75, 79, 83, 87, 95, 104, 105, 111, 115, 124, 130, 132, 133, 138, 145, 152, 153, 161, 163, 166, 174, 182, 187, 188, 190, 212, 213, 217, 220, 243, 246, 251, 255, 257, 264, 275, 279, 281
Offset: 1

Views

Author

Robert G. Wilson v, Mar 22 2001

Keywords

Examples

			n=10: p(10)=29, c(10)=18, c(10)-p(10)=11, so 10=a(7) is here.
		

Crossrefs

Numbers n such that A038529(n) is prime. Cf. A000040, A002808.

Programs

  • Mathematica
    f[ n_Integer ] := Block[ {k = n + PrimePi[ n ] + 1}, While[ k - PrimePi[ k ] - 1 != n, k++ ]; k ]; Select[ Range[ 500 ], PrimeQ[ Prime[ # ] - f[ # ] ] & ]
    Module[{nn=2000,pr,cm,len,th},pr=Prime[Range[PrimePi[nn]]];cm=Select[ Range[ nn],CompositeQ];len=Min[Length[pr],Length[cm]];th=Thread[{Take[ pr,len],Take[ cm,len]}];Position[th,?(PrimeQ[Abs[#[[1]]-#[[2]]]]&)]]// Quiet//Flatten (* _Harvey P. Dale, Jun 29 2020 *)

Formula

Values of n such that A000040(n)-A002808(n)=p(n)-c(n) is a prime number.

A065870 n-th prime - n-th semiprime.

Original entry on oeis.org

-2, -3, -4, -3, -3, -2, -4, -3, -2, 3, -2, 3, 6, 5, 8, 7, 10, 10, 12, 14, 15, 17, 18, 20, 23, 24, 21, 22, 23, 26, 36, 38, 43, 44, 43, 40, 42, 45, 48, 52, 57, 58, 62, 60, 63, 58, 69, 80, 82, 83, 78, 81, 82, 90, 91, 94, 92, 93, 94, 96, 96, 99, 106, 109, 110, 112, 125, 128, 134, 135, 138, 142, 149, 154, 158, 157, 154, 160, 154, 160
Offset: 1

Views

Author

Robert A. Stump (bee_ess107(AT)yahoo.com), Dec 07 2001

Keywords

Examples

			Prime_1 - semiprime_1 = 2 - 4 = -2, prime_2 - semiprime_2 = 3 - 6 = -3, prime_3 - semiprime_3 = 5 - 9 = -4, etc.
		

Crossrefs

Cf. A000040, A001358, A038529 (n-th prime - n-th composite).

Programs

  • Mathematica
      nn=250;Module[{pr=Prime[Range[nn]],sp=Select[Range[nn],PrimeOmega[ #]==2&],len}, len=Min[nn,Length[sp]];#[[1]]-#[[2]]&/@ Thread[ {Take[ pr,len],Take[sp,len]}]](* Harvey P. Dale, Aug 14 2013 *)
  • PARI
    m=0; for (n=4, 250, if (bigomega(n) == 2, m = m + 1; print1(prime(m) - n,",")))
    
  • PARI
    n=m=0; for (k=1, 10^9, if (bigomega(k) != 2, next); m = m + 1; write("b065870.txt", n++, " ", prime(m) - k); if (n==1000, return) ) \\ Harry J. Smith, Nov 02 2009

Formula

a(n) = A000040(n) - A001358(n). - Zak Seidov, Apr 29 2015

Extensions

More terms from Rick L. Shepherd, Mar 09 2002

A071261 Smallest k such that |p(k)-c(k)| is an n-digit number where p(k) is the k-th prime and c(k) is the k-th composite number.

Original entry on oeis.org

1, 10, 37, 206, 1401, 10626, 85316, 712597, 6117420, 53593619, 476889480, 4295913223, 39084524707, 358521889961, 3311439169717, 30765562102926, 287282165065268, 2694418859703791, 25368958219747617
Offset: 1

Views

Author

Amarnath Murthy, May 30 2002

Keywords

Crossrefs

Cf. A038529.

Extensions

Corrected and extended by Gabriel Cunningham (gcasey(AT)mit.edu), Apr 08 2003
More terms from Sean A. Irvine, Nov 30 2009
a(12)-a(15) from Donovan Johnson, Dec 30 2010
a(16)-a(19) from Chai Wah Wu, Apr 17 2018

A072476 Difference between the sum of first n prime numbers and the sum of first n composite numbers.

Original entry on oeis.org

-2, -5, -8, -10, -9, -8, -5, -1, 6, 17, 28, 44, 63, 82, 104, 131, 163, 196, 233, 272, 312, 357, 405, 458, 517, 579, 642, 707, 772, 840, 921, 1004, 1092, 1181, 1279, 1378, 1481, 1589, 1700, 1816, 1937, 2058, 2187, 2317, 2450, 2584, 2729, 2884, 3042, 3201, 3362, 3527, 3693, 3868, 4048
Offset: 1

Views

Author

Amarnath Murthy, Jun 20 2002

Keywords

Crossrefs

Cf. A071411.
Partial sums of A038529.

Programs

  • Mathematica
    Composite[n_Integer] := FixedPoint[n + PrimePi[ # ] + 1 &, n + PrimePi[n] + 1]; Table[ Sum[ Prime[i] - Composite[i], {i, 1, n}], {n, 1, 55}]
    Module[{nn=60,pr,cm},pr=Prime[Range[nn]];cm=Take[Select[Range[2nn], CompositeQ], nn]; Accumulate[ pr-cm]](* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 08 2017 *)

Extensions

Edited by Robert G. Wilson v, Jun 21 2002
Showing 1-7 of 7 results.