A100687 Erroneous duplicate of A058044.
1, 2, 2, 2, 2, 18, 48, 46, 80, 130, 74, 120, 118, 136, 174, 132, 168, 198, 190, 130, 176, 234, 358, 102, 354, 364, 336, 324, 486, 442
Offset: 1
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.
Before 7th primorial 510481 is the largest prime. Its distance from 510510 is a(7)=29.
[seq(product(ithprime(j),j=1..n)-prevprime(product(ithprime(j),j=1..n)), n=2..50)];
Map[# - NextPrime[#, -1] &, Rest@ FoldList[Times, Prime@ Range[59]]] (* Michael De Vlieger, Aug 10 2023 *)
a(n) = my(P=vecprod(primes(n))); P-precprime(P-1); \\ Michel Marcus, Aug 11 2023
7th primorial is surrounded by {510529,510481} primes in {19,71} distances of which the smaller is 19=a(7).
with(numtheory): [seq(min(nextprime(product(ithprime(j),j=1..n))-product(ithprime(j),j= >1..n),product(ithprime(j),j=1..n)-prevprime(product(ithprime(j),j=1..n >))), n=3..50)];
dnp[n_]:=Module[{a=NextPrime[n,-1],b=NextPrime[n]},Min[n-a,b-n]]; dnp/@ FoldList[Times,Prime[Range[50]]] (* Harvey P. Dale, Jul 11 2017 *)
For n = 1: prime(1) = 2, 2*prime(1) = 4 is between 3 and 5, their difference is 2 = a(1). For n = 6: prime(6) = 13, 2*prime(6) = 26 is between 23 and 29 and their difference is 6 = a(6).
with(numtheory): [seq(nextprime(2*ithprime(j))-prevprime(2*ithprime(j)),j=1...256)];
dsplp[n_]:=Module[{np=2Prime[n]},NextPrime[np]-NextPrime[np,-1]]; Array[ dsplp,90] (* Harvey P. Dale, Mar 20 2013 *)
a(n) = {my(m = 2*prime(n)); nextprime(m+1) - precprime(m-1);} \\ Amiram Eldar, Feb 08 2025
a(1) = 3, because the prime gap between the consecutive primes 5 < 3# < 7 sets the first record of 2. n gap p1 a(n)# p2 1 2 5 < 3# < 7 2 12 199 < 7# < 211 3 18 30029 < 13# < 30047 4 48 510481 < 17# < 510529 5 80 223092827 < 23# < 223092907 6 102 6469693189 < 29# < 6469693291 7 120 7420738134751 < 37# < 7420738134871
For a(1), there are two contiguous primes {2, 3} with 2 being 2#. The prime gap is 1. However, the two primes do not surround 2#, so a(1) like A340013(2) is undefined. For a(2), the prime gap contains {5, 6, 7}, with 3# = 6 in the middle. The prime gap is 2, therefore a(2) = 1; For a(3), the prime gap contains {29, 30, 31}, with 5# = 30 in the middle. The prime gap is 2, therefore a(3) = 1. For a(4), the prime gap contains {199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211}, with 7# = 205 in the middle. The prime gap is 12, therefore a(4) = 6. etc.
a[n_] := Block[{p = Times @@ Prime@ Range@ n}, (NextPrime[p, 1] - NextPrime[p, -1])/2]; a[1] = 0; Array[a, 60]
Comments