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.

A074979 Primes for which the two closest primes are smaller.

Original entry on oeis.org

113, 139, 181, 199, 241, 283, 293, 317, 467, 509, 523, 577, 619, 661, 773, 829, 839, 863, 887, 953, 1021, 1039, 1069, 1129, 1237, 1307, 1327, 1381, 1459, 1499, 1583, 1627, 1637, 1669, 1699, 1759, 1789, 1879, 1913, 1951, 2003, 2039, 2089, 2113, 2143
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Examples

			The two closest primes to 113 are 109 (difference = 4) and 107 (difference = 6). Both 109 and 107 are smaller than 113, so 113 is in the list.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; ps = {0, 0, 0, 1}; Do[ps = Drop[ps, 1]; ps = Append[ps, NextPrim[ ps[[ -1]]]]; If[ ps[[ -1]] - ps[[ -2]] > ps[[ -2]] - ps[[1]], Print[ ps[[ -2]]]], {n, 1, 330}]
    Select[Partition[Prime[Range[400]],4,1],#[[3]]-#[[1]]<#[[4]]-#[[3]]&][[All,3]] (* Harvey P. Dale, Aug 11 2021 *)

Extensions

Edited by Robert G. Wilson v, Oct 11 2002

A074982 Primes for which the three closest primes are smaller.

Original entry on oeis.org

113, 199, 317, 467, 829, 863, 887, 1129, 1307, 1327, 1637, 1669, 1879, 1951, 2089, 2251, 2311, 2477, 2557, 2803, 2971, 3229, 3259, 3271, 3373, 3469, 3739, 3947, 4027, 4139, 4297, 4463, 4523, 4733, 5023, 5119, 5237, 5351, 5449, 5483, 5531, 5591, 5659
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Examples

			The three closest primes to 113 are 109 (difference = 4), 107 (difference = 6) and 103 (difference = 10). 109, 107 and 103 are all smaller than 113, so 113 is in the list.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; ps = {0, 0, 0, 0, 1}; Do[ps = Drop[ps, 1]; ps = Append[ps, NextPrim[ ps[[ -1]]]]; If[ ps[[ -1]] - ps[[ -2]] > ps[[ -2]] - ps[[1]], Print[ ps[[ -2]]]], {n, 1, 756}]
    Select[Partition[Prime[Range[800]],5,1],#[[4]]-#[[1]]<#[[5]]-#[[4]]&][[All,4]] (* Harvey P. Dale, Mar 14 2018 *)

Extensions

Edited by Robert G. Wilson v, Oct 11 2002

A075038 Primes for which the six closest primes are smaller.

Original entry on oeis.org

1327, 14563, 15683, 19609, 22307, 25471, 31397, 33647, 35617, 39251, 43801, 44293, 49559, 69263, 69499, 76003, 79699, 81569, 82073, 85853, 88681, 88819, 89689, 95819, 102701, 118931, 124367, 132547, 132763, 140009, 142993, 143833
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Examples

			The six closest primes to 1327 are 1321 (difference = 6), 1319 (difference = 8), 1307 (different = 20), 1303 (difference = 24), 1301 (difference =26) and 1297 (difference = 30). 1321, 1319, 1307, 1303, 1301 and 1297 are all smaller than 1327, so 1327 is in the list.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; ps = {0, 0, 0, 0, 0, 0, 0, 1}; Do[ps = Drop[ps, 1]; ps = Append[ps, NextPrim[ ps[[ -1]]]]; If[ ps[[ -1]] - ps[[ -2]] > ps[[ -2]] - ps[[1]], Print[ ps[[ -2]]]], {n, 1, 13872}]
    Select[Prime[Range[15000]],#-NextPrime[#,-6]Harvey P. Dale, Nov 21 2019 *)

Extensions

Edited by Robert G. Wilson v, Oct 11 2002

A075043 Primes for which the seven closest primes are smaller.

Original entry on oeis.org

15683, 25471, 31397, 43801, 44293, 69499, 89689, 102701, 124367, 142993, 155921, 162293, 166871, 172441, 183527, 193891, 196201, 198859, 203461, 206827, 212701, 221101, 225167, 225383, 248909, 256219, 259033, 265621, 282713, 288583, 290249
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Comments

If 9 consecutive primes are p1, p2, p3 ... p9, p8 is included in the sequence if p8-p1 is less than p9-p8. - Harvey P. Dale, Mar 25 2013

Examples

			The seven closest primes to 15683 are 15679 (difference = 4), 15671 (difference = 12), 15667 (difference = 16), 15661 (difference = 22), 15649 (difference = 34) and 15647 (difference = 36). These are all smaller than 15683 so 15683 is in the list.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; ps = {0, 0, 0, 0, 0, 0, 0, 0, 1}; Do[ps = Drop[ps, 1]; ps = Append[ps, NextPrim[ ps[[ -1]]]]; If[ ps[[ -1]] - ps[[ -2]] > ps[[ -2]] - ps[[1]], Print[ ps[[ -2]]]], {n, 1, 26185}]
     Transpose[Select[Partition[Prime[Range[25000]],9,1],#[[8]]-#[[1]]<#[[9]]- #[[8]]&]][[8]](* Harvey P. Dale, Mar 25 2013 *)

Extensions

Edited and extended by Robert G. Wilson v, Oct 11 2002

A075050 Primes for which the eight closest primes are smaller.

Original entry on oeis.org

15683, 31397, 43801, 44293, 89689, 221101, 248909, 265621, 282713, 341357, 349423, 370261, 396733, 399283, 404851, 440581, 492113, 517639, 520451, 542603, 544031, 561109, 566453, 566567, 576791, 604073, 626629, 639757, 673669, 678659
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Examples

			The eight closest primes to 15683 are 15679 (difference = 4), 15671 (difference = 12), 15667 (difference = 16), 15661 (difference = 22), 15649 (difference = 34), 15647 (difference = 36), 15643 (difference = 40) and 15641 (difference = 42). These are all smaller than 15683 so 15683 is in the list.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; ps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; Do[ps = Drop[ps, 1]; ps = Append[ps, NextPrim[ ps[[ -1]]]]; If[ ps[[ -1]] - ps[[ -2]] > ps[[ -2]] - ps[[1]], Print[ ps[[ -2]]]], {n, 1, 58393}]
    Select[Partition[Prime[Range[55000]],10,1],#[[9]]-#[[1]]<#[[10]]-#[[9]]&][[All,9]] (* Harvey P. Dale, Feb 20 2022 *)

Extensions

Edited and extended by Robert G. Wilson v, Oct 11 2002

A075030 Primes for which the four closest primes are smaller.

Original entry on oeis.org

113, 1327, 2557, 2803, 2971, 3271, 3469, 4027, 4297, 4523, 5119, 5449, 5531, 5591, 7253, 7883, 8389, 9013, 9439, 9551, 10111, 10909, 11177, 11839, 12119, 12163, 12853, 12923, 13187, 13339, 13729, 13933, 14563, 15683, 15823, 16073, 16141
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Examples

			The four closest primes to 1327 are 1321 (difference = 6), 1319 (difference = 8), 1307 (different = 20) and 1303 (difference =24). 1321, 1319, 1307 and 1303 are all smaller than 1327, so 1327 is in the list.
		

Crossrefs

Programs

  • Mathematica
    #[[5]]&/@Select[Partition[Prime[Range[2500]], 6, 1], #[[5]]-#[[1]]<#[[6]]-#[[5]]&] (* Harvey P. Dale *)

Extensions

Edited by Robert G. Wilson v, Oct 11 2002

A075051 Smallest prime for which the n closest primes are smaller.

Original entry on oeis.org

3, 113, 113, 113, 1327, 1327, 15683, 15683, 248909, 265621, 492113, 492113, 3851459, 7743233, 18640103, 18640103, 18640103, 435917249, 435917249, 435917249, 649580171, 649580171, 19187736221, 19187736221, 19187736221, 94746870541, 94746870541, 673420121333, 1975675658371
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Comments

It is surprising that few of the above entries are at the beginning of a prime gap in A000230 or A002386.

Examples

			The smallest prime number for which the three closest primes to itself are all smaller than itself is 113 (the closest primes being 109, 107 and 103). So a(3)=113.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; k = 1; Do[ps = Table[0, {n + 1}]; ps = Append[ps, Max[k, 1]]; While[ps = Drop[ps, 1]; ps = Append[ps, NextPrim[ ps[[ -1]]]]; ps[[ -1]] - ps[[ -2]] <= ps[[ -2]] - ps[[1]], ]; Print[ ps[[ -2]]]; k = PrevPrim[ ps[[1]]], {n, 1, 30}]

Extensions

Edited and extended by Robert G. Wilson v, Oct 12 2002
a(23)-a(29) from Donovan Johnson, Jun 19 2008
Showing 1-7 of 7 results.