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-5 of 5 results.

A038822 Number of primes between 100n and 100n+99.

Original entry on oeis.org

25, 21, 16, 16, 17, 14, 16, 14, 15, 14, 16, 12, 15, 11, 17, 12, 15, 12, 12, 13, 14, 10, 15, 15, 10, 11, 15, 14, 12, 11, 12, 10, 11, 15, 11, 14, 13, 12, 11, 11, 15, 9, 16, 9, 11, 12, 12, 12, 8, 15, 12, 11, 10, 10, 13, 13, 12, 10, 16, 7, 12, 11, 13, 15, 8, 11, 10, 12, 12, 13, 9, 10
Offset: 0

Views

Author

Keywords

Comments

The number k first occurs in century A186311(k).

Examples

			a(3) = 16 because there are 16 primes between 300 and 399 (namely, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397).
a(4) = 17 because there are 17 primes between 400 and 499 (401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499).
		

References

  • George P. Loweke, The Lore of Prime Numbers. New York: Vantage Press (1982): 91.

Crossrefs

Cf. A028505.
Cf. A181098 (centuries without primes).
Cf. A186393-A186408 (centuries having 1 to 16 primes), A186509 (17 primes).

Programs

  • Maple
    with(numtheory); A038822 := n->pi(100*n+99)-pi(100*n); seq(A038822(k), k=0..100); # Wesley Ivan Hurt, Oct 03 2013
  • Mathematica
    Table[PrimePi[100n + 99] - PrimePi[100n], {n, 0, 71}]
    Differences[PrimePi[100 Range[0,100]]] (* Harvey P. Dale, Feb 18 2021 *)
  • PARI
    a(n)=sum(i=100*n,100*n+99,isprime(i)) \\ Charles R Greathouse IV, Apr 28 2015
    
  • PARI
    a(n)= my(r=0, p=100*n, q=p+99); while((p=nextprime(p+1))<=q, r+=isprime(p)); r; \\ Ruud H.G. van Tol, Nov 17 2024

Formula

a(n) = pi(100n+99) - pi(100n). - Wesley Ivan Hurt, Oct 03 2013

Extensions

Edited, corrected and extended by Robert G. Wilson v, Jan 29 2003

A038800 Number of primes between 10n and 10n+9.

Original entry on oeis.org

4, 4, 2, 2, 3, 2, 2, 3, 2, 1, 4, 1, 1, 3, 1, 2, 2, 2, 1, 4, 0, 1, 3, 2, 1, 2, 2, 2, 2, 1, 1, 3, 0, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 3, 2, 1, 3, 1, 1, 2, 2, 0, 2, 0, 2, 1, 2, 2, 1, 2, 2, 3, 0, 1, 3, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 4, 1, 0, 3, 1, 1, 3, 0, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1
Offset: 0

Views

Author

Keywords

Comments

If n runs through the primes, the subsequence 2, 2, 2, 3, 1, 3, 2, 4, 2, 1, 3, 2, 1, 3, 1, 0, 2, 3, 2,... is created. - R. J. Mathar, Jul 19 2012
Since 431, 433, and 439 are all prime, a(43)=3. - Bobby Jacobs, Sep 25 2016

Crossrefs

Positions of 4's: {0} U A007811.
Cf. A098592.

Programs

  • Mathematica
    Table[Count[Range[10 n, 10 n + 9], p_ /; PrimeQ@ p], {n, 0, 105}] (* Michael De Vlieger, Sep 25 2016 *)
    Table[PrimePi[10n+9]-PrimePi[10n],{n,0,120}] (* Harvey P. Dale, May 04 2025 *)
  • PARI
    a(n) = primepi(10*n+9) - primepi(10*n); \\ Michel Marcus, Sep 26 2016

Extensions

a(43) corrected by Bobby Jacobs, Sep 25 2016
a(101) and a(104) corrected by Michael De Vlieger, Sep 25 2016

A094892 a(n) is the number of primes between n*210 and (n+1)*210.

Original entry on oeis.org

46, 35, 33, 32, 30, 29, 27, 31, 27, 27, 26, 25, 30, 26, 22, 27, 26, 27, 24, 24, 26, 23, 26, 26, 22, 24, 26, 27, 20, 25, 23, 25, 23, 24, 22, 23, 26, 21, 21, 24, 21, 26, 24, 23, 25, 22, 25, 20, 25, 22, 21, 22, 21, 22, 21, 18, 26, 22, 21, 26, 23, 24, 22, 19, 21, 24, 21, 17, 23
Offset: 0

Views

Author

Labos Elemer, Jun 16 2004

Keywords

Comments

Arbitrarily long subsequences of consecutive 0's occur. a(n) is always <= 46. All values below 34 occur (see A095391); does 34?

Examples

			a(0) = 46 because there are 46 primes between 0*210 and 1*210.
a(1) = 35 because there are 35 primes between 1*210 and 2*210.
		

Crossrefs

Programs

  • Magma
    [46] cat [#PrimesInInterval(210*n, 210*(n+1)): n in [1..80]]; // Vincenzo Librandi, Jul 08 2018
    
  • Mathematica
    a[n_]:=PrimePi[210 (n + 1)] - PrimePi[210 n]; Table[a[n], {n, 0, 100}] (* Vincenzo Librandi, Jul 08 2018 *)
  • PARI
    a(n) = primepi(210*(n+1)) - primepi(210*n); \\ Ruud H.G. van Tol, Oct 27 2024
    
  • PARI
    a(n) = my(res = 0); forprime(p = n*210, (n+1)*210, isprime(p) && res++); res \\ David A. Corneth and Ruud H.G. van Tol, Oct 27 2024

Extensions

Edited by Don Reble, Jun 16 2004
Examples corrected by Matthew Vandermast, Jun 17 2004

A098591 a(k) contains primality information for the numbers in the interval (k*30,...,(k+1)*30) packed into one byte using the fact that only numbers == 1, 7, 11, 13, 17, 19, 23, 29 mod 30 can be prime.

Original entry on oeis.org

223, 239, 126, 182, 219, 61, 249, 213, 79, 30, 243, 234, 166, 237, 158, 230, 12, 211, 211, 59, 221, 89, 165, 106, 103, 146, 189, 120, 30, 166, 86, 86, 227, 173, 45, 222, 42, 76, 85, 217, 163, 240, 159, 3, 84, 161, 248, 46, 253, 68, 233, 102, 246, 19, 58, 184, 76
Offset: 1

Views

Author

Hugo Pfoertner, Sep 16 2004

Keywords

Comments

This sequence illustrates an efficient method for storing all prime numbers up to some moderate limit. With this method all prime numbers < 2^31 can be stored in a 70-MByte file.
Because of divisibility by 7, 254 appears only as the zeroth term, and 127 and 255 do not appear at all. All other single-byte numbers (0..255) appear. 247 is the last to appear, first appearing as the 22621st term.
0 and at least one nonzero term must both appear infinitely often. (Probably every number 0..126 and 128..253 appears infinitely often, but this may be hard to prove.) - Keith F. Lynch, Sep 09 2018

Examples

			a(1)=223: From the list of prime candidates between 30 and 60 only the number 49 is composite. Therefore
a(1) =   2^0 (representing 30 +  1)
       + 2^1 (representing 30 +  7)
       + 2^2 (representing 30 + 11)
       + 2^3 (representing 30 + 13)
       + 2^4 (representing 30 + 17)
       + 2^6 (representing 30 + 23)
       + 2^7 (representing 30 + 29)
     = 1 + 2 + 4 + 8 + 16 + 64 + 128 = 223.
a(17): There are 2 primes in the interval (17*30, 17*30 + 30) = (510,540): 521 == 11 (mod 30) and 523 == 13 (mod 30). Therefore a(17) = 2^2 (representing 510 + 11) + 2^3 (representing 510 + 13) = 4 + 8 = 12.
a(360) = 0 (1st occurrence), no primes between 360*30 = 10800 and 10830. - _Frank Ellermann_, Apr 03 2020
		

Crossrefs

Cf. A000040 (prime numbers), A006880 (number of primes < 10^n), A098592 (number of primes in intervals (30*k, 30*(k+1))), A005867 (primorial sieving candidates), A007775 (7-rough numbers, corresponding to the bits).

Programs

  • Mathematica
    With[{s = Select[Range@ 30, CoprimeQ[#, 30] &]}, Array[Total[2^(Position[30 # + s, ?PrimeQ][[All, 1]] - 1) ] &, 57]] (* _Michael De Vlieger, Sep 10 2018 *)
  • PARI
    a(k) = {vec = [1, 7, 11, 13, 17, 19, 23, 29]; return (sum(i=1, length(vec), isprime(30*k+vec[i])*(1 << (i-1))));} \\ Michel Marcus, Jan 31 2013
    
  • Python
    from sympy import isprime
    v = [1, 7, 11, 13, 17, 19, 23, 29]
    def a(n): return sum(2**k for k, vk in enumerate(v) if isprime(n*30+vk))
    print([a(n) for n in range(1, 58)]) # Michael S. Branicky, Oct 10 2021

Formula

a(n) = Sum_{k=0..7} (2^k)*isprime(30*n + offset(k)), where isprime(x)=1 for x prime, otherwise 0, and offset(k) = {1, 7, 11, 13, 17, 19, 23, 29} for k=0..7.

A385124 Numbers k such that there are exactly 7 primes between 30*k and 30*k+30.

Original entry on oeis.org

1, 2, 49, 62, 79, 89, 188, 6627, 9491, 18674, 22621, 31982, 34083, 38226, 38520, 41545, 48713, 53887, 89459, 103205, 114731, 123306, 139742, 140609, 149125, 168237, 175125, 210554, 223949, 229269, 237794, 240007, 267356, 288467, 321451, 364921, 368248, 373370, 391701
Offset: 1

Views

Author

Jianglin Luo, Jun 18 2025

Keywords

Comments

The count of primes in 30*k..30*k+30 is less than 8 for k >= 1.
It appears that this sequence has infinitely many terms.

Examples

			1 is a term since there are 7 primes in 30..60: 31, 37, 41, 43, 47, 53, 59.
2 is a term since there are 7 primes in 60..90: 61, 67, 71, 73, 79, 83, 89.
3 is not a term since there are only 6 primes in 90..120: 97, 101, 103, 107, 109, 113.
49 is a term since there are 7 primes in 30*49..30*50: 1471, 1481, 1483, 1487, 1489, 1493, 1499.
		

Crossrefs

Programs

  • Mathematica
    ArrayPlot[Table[Boole@PrimeQ[i*30+j],{i,0,399},{j,30}],Mesh->True]
    index=1;Do[If[Length@(*PrimeRange=*) Select[Range[30*k+1,30*k+30,2],PrimeQ]==7,Print[index++," ",k]],{k,1,10^9}]
  • PARI
    [n|n<-[1..10^6],#primes([30*n,30*n+30])==7]

Formula

{k | A098592(k) = pi(30*k+30) - pi(30*k) = 7}. - Michael S. Branicky, Jun 24 2025
Showing 1-5 of 5 results.