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

A065978 For even k >= 4, let f(k) = A066285(k/2) be the minimal difference between primes p and q whose sum is k. Such a k is in the sequence if f(k) > f(m) for all even m with 4 <= m < k.

Original entry on oeis.org

4, 8, 16, 44, 92, 242, 256, 272, 292, 476, 530, 572, 682, 688, 1052, 1808, 2228, 3382, 3472, 3502, 3562, 4952, 6194, 7102, 10262, 17008, 20684, 37052, 45128, 49552, 80144, 137414, 251806, 349826, 362534, 742856, 1655152, 1872236, 2108282, 2319728, 2707118
Offset: 1

Views

Author

Jon Perry, Dec 09 2001

Keywords

Comments

The values of f(a(n)) (given in A066286) appear to be divisible by 6, except the first two.

Examples

			4 = 2+2; the gap is 0. 6=3+3 (0). 8=3+5; the gap is 2, and this is the largest gap to date, so 8 is in the sequence.
10=5+5 (0), 12=5+7 (2), 14=7+7 (0), 16=5+11 (6), so 16 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := For[p=n/2, True, p--, If[PrimeQ[p]&&PrimeQ[n-p], Return[n-2p]]]; For[n=4; max=-1, True, n+=2, If[f[n]>max, Print[n]; max=f[n]]]

Extensions

More terms from Robert G. Wilson v and Dean Hickerson, Dec 10 2001
Changed offset to 1 (this is a list). - N. J. A. Sloane, Sep 07 2013

A066286 For even n>=4, let f(n)=A066285(n/2) be the minimal difference between primes p and q whose sum is n. This sequence contains the successive maxima of f.

Original entry on oeis.org

0, 2, 6, 18, 30, 36, 42, 54, 66, 78, 84, 90, 96, 150, 174, 186, 234, 240, 270, 276, 336, 366, 420, 456, 600, 666, 738, 786, 906, 1050, 1242, 1440, 1620, 1692, 2172, 2562, 2610, 3030, 3180, 3234, 3444, 3588, 3666, 3702, 4020, 4128, 4170, 4224, 4434, 4704, 5508, 5568, 6678, 6858, 8790, 8976, 10782
Offset: 0

Views

Author

Dean Hickerson, Dec 12 2001

Keywords

Comments

All terms appear to be divisible by 6, except for the first two.

Crossrefs

The corresponding values of n are in A065978.

Programs

  • Mathematica
    f[n_] := For[p=n/2, True, p--, If[PrimeQ[p]&&PrimeQ[n-p], Return[n-2p]]]; For[n=4; max=-1, True, n+=2, If[f[n]>max, Print[max=f[n]]]]

Extensions

a(51)-a(55) from Gilmar Rodriguez (Gilmar.Rodriguez(AT)nwfwmd.state.fl.us), Jun 16 2005
a(56) from Robert G. Wilson v, Jun 27 2005

A107926 The least number k such that there are primes p and q with p - q = 2*n, p + q = k, and p the least such prime >= k/2.

Original entry on oeis.org

4, 8, 18, 16, 54, 48, 50, 108, 102, 44, 234, 444, 98, 228, 174, 92, 414, 432, 242, 516, 582, 256, 1182, 672, 406, 612, 846, 272, 1038, 984, 442, 1776, 1902, 292, 1074, 636, 1054, 3312, 1122, 476, 1398, 1464, 530, 1728, 2730, 572, 2706, 3348, 682, 2844, 3342
Offset: 0

Views

Author

Gilmar J. Rodriguez (Gilmar.Rodriguez(AT)nwfwmd.state.fl.us) and Robert G. Wilson v, Jun 16 2005

Keywords

Comments

From the Goldbach conjecture.
A107926 = 2*A103147 by definition.
a(3n)> a(3n-2), a(3n-1), a(3n+1) & a(3n+2) for all n > 0 except for n = 1, 2, 12, 19, 20 or 41.
Of those values found so far a(3n+2) > a(3n+1) by ~8%. - Robert G. Wilson v, Nov 03 2013
Except for 1, all indices, i, not congruent to 0 (mod 3), a(i) is congruent to 0 (mod 6) and for all indices, i, congruent to 0 (mod 3), a(i) is not congruent to 0 (mod 6). Of those not congruent to 0 (mod 6), those congruent to 2 outnumber those congruent to 4, about 8 to 7. Robert G. Wilson v, Nov 03 2013

Examples

			a(0) = 4 because 4=2+2 and 2-2=0.
a(1) = 8 because 8 is the least number with 8=p+q and p-q=2 for primes p and q.
a(2) = 18 because 18=7+11 and the primes 7 and 11 have difference 4.
		

Crossrefs

Cf. A066285, A103147, records in A065978 and A066286.

Programs

  • Mathematica
    f[n_] := For[p = n/2, True, p--, If[PrimeQ[p] && PrimeQ[n - p], Return[n/2 - p]]]; nn=101; t=Table[0,{nn}]; cnt=0; n=1; While[cnt
    				

A325142 a(n) = k if (n - k, n + k) is the centered Goldbach partition of 2n if it exists and -1 otherwise.

Original entry on oeis.org

-1, -1, 0, 0, 1, 0, 1, 0, 3, 2, 3, 0, 1, 0, 3, 2, 3, 0, 1, 0, 3, 2, 9, 0, 5, 6, 3, 4, 9, 0, 1, 0, 9, 4, 3, 6, 5, 0, 9, 2, 3, 0, 1, 0, 3, 2, 15, 0, 5, 12, 3, 8, 9, 0, 7, 12, 3, 4, 15, 0, 1, 0, 9, 4, 3, 6, 5, 0, 15, 2, 3, 0, 1, 0, 15, 4, 3, 6, 5, 0, 9, 2, 15, 0
Offset: 0

Views

Author

Peter Luschny, May 02 2019

Keywords

Comments

Let N = 2*n = p + q where p and q are primes. We call such a pair (p, q) a Goldbach partition of N. A centered Goldbach partition is the Goldbach partition of the form (n - k, n + k) where k >= 0 is minimal. If N has a centered Goldbach partition then a(n) is this k and otherwise -1.
According to Goldbach's conjecture, any even N = 2n > 2 has a Goldbach partition, which is necessarily of the form p = n - k, q = n + k: namely, with n = (p+q)/2 and k = (q-p)/2. - M. F. Hasler, May 02 2019

Examples

			a(162571) = 78 because 325142 = 162493 + 162649 and there is no k, 0 <= k < 78, such that (162571 - k, 162571 + k) is a Goldbach partition of 325142.
		

Crossrefs

Programs

  • Maple
    a := proc(n) local k; for k from 0 to n do
    if isprime(n + k) and isprime(n - k) then return k fi od: -1 end:
    seq(a(n), n=0..83);
  • Mathematica
    a[n_] := Module[{k}, For[k = 0, k <= n, k++, If[PrimeQ[n+k] && PrimeQ[n-k], Return[k]]]; -1]; Table[a[n], {n, 0, 83}] (* Jean-François Alcover, Jul 06 2019, from Maple *)
  • PARI
    a(n) = for(k=0, n, if(ispseudoprime(n+k) && ispseudoprime(n-k), return(k))); -1 \\ Felix Fröhlich, May 02 2019
    
  • PARI
    apply( A325142(n)=-!forprime(p=n,2*n, isprime(n*2-p)&&return(p-n)), [0..99]) \\ M. F. Hasler, May 02 2019

Formula

a(n) = n - A112823(n) = A234345(n) - n (= n - A002374(n) for n > 2). - M. F. Hasler, May 02 2019
a(n) = A047160(n) = A066285(n)/2 for n >= 2. - Alois P. Heinz, Jun 01 2020

A303603 a(n) is the maximum distance between primes in Goldbach partitions of 2n, or 2n if there are no Goldbach partitions of 2n.

Original entry on oeis.org

0, 0, 0, 2, 4, 2, 8, 10, 8, 14, 16, 14, 20, 18, 16, 26, 28, 26, 24, 34, 32, 38, 40, 38, 44, 42, 40, 50, 48, 46, 56, 58, 56, 54, 64, 62, 68, 70, 68, 66, 76, 74, 80, 78, 76, 86, 84, 82, 60, 94, 92, 98, 100, 98, 104, 106, 104, 110, 108, 106, 96, 102, 100, 90, 124, 122, 128, 126, 124, 134, 136, 134, 132
Offset: 1

Views

Author

Marcin Barylski, Apr 26 2018

Keywords

Comments

The Goldbach Strong Conjecture is true if and only if a(n) = 2n for some n.
Terms are always even numbers because primes present in Goldbach partitions of n > 4 are odd and n = 4 has just one partition (2+2) where difference is 0.
Conjecture: Only first terms are 0 and all further terms are bigger than 0. Excluding a(1), a(n) = 0 iff the only Goldbach partition of 2n is n+n.

Examples

			a(1) = 0 for coherence with other related sequences.
a(2) = 0 because 2 * 2 = 4 = 2 + 2 and max_diff = 2 - 2 = 0.
a(8) = 10 because 2 * 8 = 16 = 5 + 11 = 3 + 13 and max_diff = 13 - 3 = 10.
		

Crossrefs

Cf. A002372, A002375, A047949, A066285 (minimum distance), A305883.

Programs

  • Mathematica
    a[1]=a[2]=0;
    a[n_]:=Module[{p=3},While[PrimeQ[2*n-p]!=True,p=NextPrime[p]];2*(n-p)];
    a/@Range[73] (* Ivan N. Ianakiev, Jun 27 2018 *)
  • PARI
    a(n) = if (n==1, 0, forprime(p=2, , if (isprime(2*n-p), return (2*n-2*p)))); \\ Michel Marcus, Jul 02 2018

Formula

a(n) = 2 * A047949(n) if A047949(n) > 0 for n >= 2; a(n) = 2n if A047949(n) = -1. - Alois P. Heinz, Jun 01 2020

A335297 Integers k such that for all m>k, d(m)/m < d(k)/k where d(j) = Min_{p & q odd primes, 2*j = p+q, p <= q} (q-p)/2.

Original entry on oeis.org

22, 46, 58, 146, 344, 362, 526, 1114, 1781, 2476, 3097, 3551, 5131, 5728, 8504, 10342, 10907, 10994, 13321, 13924, 13984, 18526, 24776, 26197, 30728, 40072, 44656, 44860, 68707, 70757, 71684, 76861, 78461, 89812, 125903, 181267, 191771, 227566, 256849, 278566, 371428, 379969
Offset: 1

Views

Author

Ya-Ping Lu, May 30 2020

Keywords

Comments

This sequence is related to a stronger form of Goldbach conjecture, and the formulation of the conjecture is the following.
Conjecture: Let
Gs(m) be the number of unordered pairs of odd prime numbers p and q such that an even number 2m can be written as the sum of p and q, or, Gs(m) = # { (p,q) | 2m = p+q }, where p <= q;
d be half of the minimum difference between q and p, or, d = min((q-p)/2);
r be the ratio of d/m, or, r = d/m; and
a(n) be the n-th number such that r = d/m is decreasing, or, r(m) < r(a(n+1)), if a(n) <= m < a(n+1), where n = 0, 1, 2, 3, .... and a(0)=3.
The conjecture states that
Gs(m) >= 1 if r(m) >= r(a(n+1)) where a(n) <= m < a(n+1).

Examples

			For even numbers 2m >= 6 (6 is the smallest even number that can be written as the sum of two odd primes), the list of m is:
m = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, ...}.
The corresponding values of d and r, according to the definition, are given in the following two lists:
d = {0, 1, 0, 1, 0, 3, 2, 3, 0, 1, 0, 3, 2, 3, 0, 1, 0, 3, 2, 9, 0, 5, 6, 3, 4, 9, 0, 1, 0, 9, 4, 3, 6, 5, 0, 9, 2, 3, 0, 1, 0, 3, 2, 15, ...}, and
r = {0, 1/4, 0, 1/6, 0, 3/8, 2/9, 3/10, 0, 1/12, 0, 3/14, 2/15, 3/16, 0, 1/18, 0, 3/20, 2/21, 9/22, 0, 5/24, 6/25, 3/26, 4/27, 9/28, 0, 1/30, 0, 9/32, 4/33, 3/34, 6/35, 5/36, 0, 9/38, 2/39, 3/40, 0, 1/42, 0, 3/44, 2/45, 15/46, ...}.
In the list of r, the first number that is bigger than all the preceding numbers is r = 9/22, which is corresponding to the number m = 22 in the list of m. Therefore, the first number of the sequence is 22, or a(1) = 22.
In the range of (9/22, 15/46], r= 15/46 is the biggest number. Since r = 15/46 corresponds to m = 46, the 2nd number of the sequence is 46, or a(2) = 46.
The first number in the list of m, 3, is defined as the zeroth term of the sequence, or a(0) = 3.
		

Crossrefs

Programs

  • PARI
    mindiff(n) = {forstep(k=n/2, 1, -1, if (isprime(k) && isprime(n-k), return(n-2*k)););}
    upto(n) = res=List(); r=0;forstep(i=n, 1, -1, c= mindiff(2*i) / (2*i); if(c>r,r=c;listput(res,i))); Vecrev(Vec(res)) \\ David A. Corneth, Jun 02 2020
Showing 1-6 of 6 results.