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

A000230 a(0)=2; for n>=1, a(n) = smallest prime p such that there is a gap of exactly 2n between p and next prime, or -1 if no such prime exists.

Original entry on oeis.org

2, 3, 7, 23, 89, 139, 199, 113, 1831, 523, 887, 1129, 1669, 2477, 2971, 4297, 5591, 1327, 9551, 30593, 19333, 16141, 15683, 81463, 28229, 31907, 19609, 35617, 82073, 44293, 43331, 34061, 89689, 162143, 134513, 173359, 31397, 404597, 212701, 188029, 542603, 265621, 461717, 155921, 544279, 404851, 927869, 1100977, 360653, 604073
Offset: 0

Views

Author

Keywords

Comments

p + 1 = A045881(n) starts the smallest run of exactly 2n-1 successive composite numbers. - Lekraj Beedassy, Apr 23 2010
Weintraub gives upper bounds on a(252), a(255), a(264), a(273), and a(327) based on a search from 1.1 * 10^16 to 1.1 * 10^16 + 1.5 * 10^9, probably performed on a 1970s microcomputer. - Charles R Greathouse IV, Aug 26 2022

Examples

			The following table, based on a very much larger table in the web page of Tomás Oliveira e Silva (see link) shows, for each gap g, P(g) = the smallest prime such that P(g)+g is the smallest prime number larger than P(g);
* marks a record-holder: g is a record-holder if P(g') > P(g) for all (even) g' > g, i.e., if all prime gaps are smaller than g for all primes smaller than P(g); P(g) is a record-holder if P(g') < P(g) for all (even) g' < g.
This table gives rise to many sequences: P(g) is A000230, the present sequence; P(g)* is A133430; the positions of the *'s in the P(g) column give A100180, A133430; g* is A005250; P(g*) is A002386; etc.
   -----
   g P(g)
   -----
   1* 2*
   2* 3*
   4* 7*
   6* 23*
   8* 89*
   10 139*
   12 199*
   14* 113
   16 1831*
   18* 523
   20* 887
   22* 1129
   24 1669
   26 2477*
   28 2971*
   30 4297*
   32 5591*
   34* 1327
   36* 9551*
   ........
The first time a gap of 4 occurs between primes is between 7 and 11, so a(2)=7 and A001632(2)=11.
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A001632(n) = 2n + a(n) = nextprime(a(n)).
Cf. A100964 (least prime number that begins a prime gap of at least 2n).

Programs

Formula

a(n) = A000040(A038664(n)). - Lekraj Beedassy, Sep 09 2006

Extensions

a(29)-a(37) from Jud McCranie, Dec 11 1999
a(38)-a(49) from Robert A. Stump (bee_ess107(AT)yahoo.com), Jan 11 2002
"or -1 if ..." added to definition at the suggestion of Alexander Wajnberg by N. J. A. Sloane, Feb 02 2020

A073051 Least k such that Sum_{i=1..k} (prime(i) + prime(i+2) - 2*prime(i+1)) = 2n + 1.

Original entry on oeis.org

1, 3, 8, 23, 33, 45, 29, 281, 98, 153, 188, 262, 366, 428, 589, 737, 216, 1182, 3301, 2190, 1878, 1830, 7969, 3076, 3426, 2224, 3792, 8027, 4611, 4521, 3643, 8687, 14861, 12541, 15782, 3384, 34201, 19025, 17005, 44772, 23282, 38589, 14356
Offset: 1

Views

Author

Robert G. Wilson v, Aug 15 2002

Keywords

Comments

Also, least k such that 2n = A001223(k-1) = prime(k+1) - prime(k), where prime(k) = A001223(n). - Alexander Adamchuk, Jul 30 2006
Also the least number k>0 such that the k-th maximal run of composite numbers has length 2n-1. For example, the 8th such run (24,25,26,27,28) is the first of length 2(3)-1, so a(3) = 8. Also positions of first appearances in A176246 (A046933 without first term). - Gus Wiseman, Jun 12 2024

Examples

			a(3) = 8 because 1+0+2-2+2-2+2+2 = 5 and (5+1)/2 = 3.
		

Crossrefs

Position of first appearance of 2n+1 in A176246.
For nonsquarefree runs we have a bisection of A373199.
A000040 lists the primes, first differences A001223.
A002808 lists the composite numbers, differences A073783, sums A053767.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.

Programs

  • Mathematica
    NextPrim[n_Integer] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = Table[0, {50}]; s = 0; k = 1; p = 0; q = 2; r = 3; While[k < 10^6, p = q; q = r; r = NextPrim[q]; s = s + p + r - 2q; If[s < 101 && a[[(s + 1)/2]] == 0, a[[(s + 1)/2]] = k]; k++ ]; a
  • PARI
    a001223(n) = prime(n+1) - prime(n);
    a(n) = {my(k = 1); while(2*n != A001223(k+1), k++); k;} \\ Michel Marcus, Nov 20 2016

Formula

a(n) = A038664(n) - 1. - Filip Zaludek, Nov 19 2016

A271211 Composite integers sandwiched between primes p, q with q-p = 4.

Original entry on oeis.org

8, 9, 10, 14, 15, 16, 20, 21, 22, 38, 39, 40, 44, 45, 46, 68, 69, 70, 80, 81, 82, 98, 99, 100, 104, 105, 106, 110, 111, 112, 128, 129, 130, 164, 165, 166, 194, 195, 196, 224, 225, 226, 230, 231, 232, 278, 279, 280, 308, 309, 310, 314, 315, 316, 350, 351, 352, 380
Offset: 1

Views

Author

Michel Marcus, Apr 02 2016

Keywords

Examples

			The composite number 8 is sandwiched between primes 7 and 11, and 11-7=4, so 8 is a member of the sequence.
		

Crossrefs

Programs

  • Mathematica
    Range[#[[1]]+1,#[[2]]-1]&/@Select[Partition[Prime[Range[100]],2,1],#[[2]]- #[[1]] == 4&]//Flatten (* Harvey P. Dale, Oct 12 2019 *)
  • PARI
    lista(nn) = {forcomposite(c=4, nn, if ((p=precprime(c)) && ((nextprime(c)-p)==4), print1(c, ", ")););}

A075067 Start of the first run of exactly n consecutive odd composite numbers.

Original entry on oeis.org

9, 25, 91, 141, 201, 115, 1833, 525, 889, 1131, 1671, 2479, 2973, 4299, 5593, 1329, 9553, 30595, 19335, 16143, 15685, 81465, 28231, 31909, 19611, 35619, 82075, 44295, 43333, 34063, 89691, 162145, 134515, 173361, 31399, 404599, 212703
Offset: 1

Views

Author

Amarnath Murthy, Sep 08 2002

Keywords

Comments

More precisely, a(n)-2 and a(n) + 2n are two consecutive primes and are the smallest successive prime pair with a difference 2(n+1).

Crossrefs

This is a trivial variation of A000230 and A045881.
See A189118 for another version.

Extensions

More terms from Matthew Conroy, Sep 10 2002

A271232 Composite integers sandwiched between primes p, q with q-p = 6.

Original entry on oeis.org

24, 25, 26, 27, 28, 32, 33, 34, 35, 36, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 62, 63, 64, 65, 66, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 132, 133, 134, 135, 136, 152, 153, 154, 155, 156, 158, 159, 160, 161, 162, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178
Offset: 1

Views

Author

Michel Marcus, Apr 02 2016

Keywords

Examples

			The composite number 24 is sandwiched between consecutive primes 23 and 29, and 29-23=6, so 24 is a member of the sequence.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {forcomposite(c=4, nn, if ((p=precprime(c)) && ((nextprime(c)-p)==6), print1(c, ", ")););}

A340735 a(n) is the smallest positive integer that begins a run of exactly 2*n-1 consecutive integers having at least 4 divisors each.

Original entry on oeis.org

6, 14, 32, 90, 140, 200, 294, 1832, 1070, 888, 1130, 2180, 2478, 2972, 4298, 5592, 1328, 9552, 30594, 19334, 16142, 15684, 81464, 28230, 31908, 19610, 35618, 82074, 44294, 43332, 34062, 89690, 162144, 134514, 173360, 31398, 404598, 212702, 188030, 542604, 265622
Offset: 1

Views

Author

Jon E. Schoenfield, Jan 17 2021

Keywords

Comments

If "integers having at least 4 divisors each" in this sequence's definition were replaced with "integers having at least 3 divisors each" (i.e., composite numbers), the resulting sequence would be A045881.
A045881(n) = a(n) except when the run of 2*n-1 consecutive composite numbers beginning with A045881(n) includes a number with exactly 3 divisors (i.e., the square of a prime). The first six such exceptions are as follows:
.
n A045881(n) a(n) 3-divisor number
-- ---------- ---- ----------------
1 4 6 4 = 2^2
2 8 14 9 = 3^2
3 24 32 25 = 5^2
7 114 294 121 = 11^2
9 524 1070 529 = 23^2
12 1670 2180 1681 = 41^2
.
There are no other exceptions among the first 672 terms of A045881 (see the b-file there). Can it be proved that there are no other exceptions?

Examples

			a(1)=6 because 6=2*3 (which has 4 divisors, {1,2,3,6}) is the first isolated number that has at least 4 divisors.
a(2)=14 because 14 is the first number that begins a run of exactly 2*2-1=3 consecutive integers having at least 4 divisors each: tau(14)=tau(2*7)=4; tau(15)=tau(3*5)=4; tau(16)=tau(2^4)=5.
a(3)=32 because 32 is the first number that begins a run of exactly 2*3-1=5 consecutive integers having at least 4 divisors each: tau(32)=tau(2^5)=6; tau(33)=tau(3*11)=4; tau(34)=tau(2*17)=4; tau(35)=tau(5*7)=4; tau(36)=tau(2^2*3^2)=9.
		

Crossrefs

Cf. A045881.

A271233 Composite integers sandwiched between primes p, q with q-p = 8.

Original entry on oeis.org

90, 91, 92, 93, 94, 95, 96, 360, 361, 362, 363, 364, 365, 366, 390, 391, 392, 393, 394, 395, 396, 402, 403, 404, 405, 406, 407, 408, 450, 451, 452, 453, 454, 455, 456, 480, 481, 482, 483, 484, 485, 486, 492, 493, 494, 495, 496, 497, 498, 684, 685, 686, 687, 688, 689, 690
Offset: 1

Views

Author

Michel Marcus, Apr 02 2016

Keywords

Examples

			The composite number 90 is sandwiched between consecutive primes 89 and 97, and 97-89=8, so 90 is a member of the sequence.
		

Crossrefs

Programs

  • Mathematica
    Range[#[[1]]+1,#[[2]]-1]&/@Select[Partition[Prime[Range[150]],2,1],#[[2]]-#[[1]] == 8&]//Flatten (* Harvey P. Dale, May 15 2022 *)
  • PARI
    lista(nn) = {forcomposite(c=4, nn, if ((p=precprime(c)) && ((nextprime(c)-p)==8), print1(c, ", ")););}

A343729 a(n) is the smallest number that starts a run of exactly n consecutive integers that are neither primes nor semiprimes.

Original entry on oeis.org

8, 27, 98, 342, 242, 6092, 3174, 2870, 2522, 16023, 26604, 114359, 41780, 74492, 39344, 463162, 104660, 248408, 517422, 923723, 506510, 1930824, 584214, 2560178, 4036968, 4570412, 4552364, 7879254, 4417814, 27841052, 5167588, 13683035, 9725108, 47735343
Offset: 1

Views

Author

Jon E. Schoenfield, May 22 2021

Keywords

Examples

			a(5) = 242 because 241 is a prime, 247=13*19 is a semiprime, none of the 5 consecutive integers between them are primes or semiprimes (242 = 2*11^2, 243 = 3^5, 244 = 2^2*61, 245 = 5*7^2, and 246 = 2*3*41), and there is no smaller run of exactly 5 consecutive integers that are neither prime nor semiprime.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=48*10^6,lst},lst=Table[Which[PrimeQ[n],1,PrimeOmega[n]==2,1,True,0],{n,nn}]; Flatten[Table[SequencePosition[lst,Join[{1},PadRight[{},n,0],{1}],1],{n,34}],1]][[;;,1]]+1 (* Harvey P. Dale, May 30 2024 *)

Extensions

Corrected by Harvey P. Dale, May 30 2024
Showing 1-8 of 8 results.