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.

A066285 a(n) is the minimal difference between primes p and q whose sum is 2n.

Original entry on oeis.org

0, 0, 2, 0, 2, 0, 6, 4, 6, 0, 2, 0, 6, 4, 6, 0, 2, 0, 6, 4, 18, 0, 10, 12, 6, 8, 18, 0, 2, 0, 18, 8, 6, 12, 10, 0, 18, 4, 6, 0, 2, 0, 6, 4, 30, 0, 10, 24, 6, 16, 18, 0, 14, 24, 6, 8, 30, 0, 2, 0, 18, 8, 6, 12, 10, 0, 30, 4, 6, 0, 2, 0, 30, 8, 6, 12, 10, 0, 18, 4, 30, 0, 10, 24, 6, 28, 18, 0
Offset: 2

Views

Author

Dean Hickerson, Dec 12 2001

Keywords

Comments

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 the difference is 0. a(n) = 0 iff n is prime. - Marcin Barylski, Apr 28 2018

Crossrefs

Programs

  • Mathematica
    a[n_] := For[p=n, True, p--, If[PrimeQ[p]&&PrimeQ[2n-p], Return[2n-2p]]]
  • PARI
    a(n) = {forstep(k=n, 1, -1, if (isprime(k) && isprime(2*n-k), return(2*n-2*k)););} \\ Michel Marcus, Jun 01 2020

Formula

a(n) = 2 * A047160(n). - Alois P. Heinz, Jun 01 2020

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
    				

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

A293858 Let n be even; m = n/2 and p a prime such that p<=m with n-p nonprime. The sequence contains the successive positive maxima of values n with L = primepi(m-1)-primepi(p+1)> 0.

Original entry on oeis.org

16, 44, 92, 148, 368, 400, 530, 688, 992, 1052, 2228, 3562, 4952, 7102, 10262, 20684, 37052, 52394, 61456, 62828, 80144, 224648, 236476, 251806, 360524, 362534, 742856, 1655152, 1872236, 2108282, 2319728, 2707118, 8561518, 12727966, 18115354, 18245438, 21572990, 54144704
Offset: 1

Views

Author

Keywords

Comments

Assuming the validity of Goldbach's Conjecture, there exists an integer L and a finite decreasing sequence of prime numbers P(i); i in {1,2,...,L}, such that P(L) < ... < P(2) < P(1) < m with n-P(i) not prime and n-P(L-1) prime, for P(L-1) prime.
The point {P(L-1), n-P(L-1)} is called the "minimal Goldbach point". The connotation of the word "minimal" is that this point lies on the line y = (-x + n) and sustains the shortest perpendicular distance to the line y = x, among all points {p,q} satisfying y=(-x+n) with prime p, 2 <= p <= m, such that n-p is prime.
Let L be the length of the set {P(1),P(2),..., P(L)}.
Notice that if m is prime then L=0. Also; if n-P(1) is prime then L=0.

Examples

			For n=16, previous prime of m is 7; (n-7) is not prime; previous prime of 7 is 5; n-5 is prime; L=Length({7})=1.
For n=44, previous prime of m is 19; (n-19)is not prime; previous prime of 19 is 17; n-17 is not prime; previous prime of 17 is 13; (n-13) is prime; L=Length({19, 17})= 2.
		

Crossrefs

Cf. A065978.

Programs

  • Mathematica
    PreviousPrime[n_]:=NextPrime[n, -1]
    L[n_?EvenQ]:=Module[{m=n/2},If[PrimeQ[m],l=0,l=Length[Drop[Most@NestWhileList[PreviousPrime,m,!PrimeQ[n-#]&],1]]];l]
    f[n_]:=For[m=n/2,True,m--,Return[L[n]]];For[n=16;max=-1,True,n+=2,If[f[n]>max,Print[n];max=f[n]]]
  • PARI
    f(n) = {len = 0; m = n/2; if (isprime(m), return (0)); p = precprime(m-1); while (1, if (isprime(n-p), return (len)); p = precprime(p-1); len ++;);}
    lista(nn) = {lmax = 0; forstep (n=2, nn, 2, newl = f(n); if (newl > lmax, print1(n, ", "); lmax = newl););} \\ Michel Marcus, Oct 22 2017

A307881 2*a(n) is the least number where k sets a new record such that 2*a(n)-k and 2*a(n)+k are prime and at least one of 2*a(n)-j and 2*a(n)+j is composite for all 0

Original entry on oeis.org

2, 4, 11, 23, 64, 68, 73, 119, 143, 172, 263, 452, 557, 868, 1238, 1579, 2864, 3533, 3637, 4252, 5171, 9263, 11282, 12388, 20036, 59119, 69332, 90131, 113783, 139283, 178612, 185714, 413788, 468059, 579932, 960707, 1879582, 2727031, 3266951, 3319868, 3591593
Offset: 1

Views

Author

Hugo Pfoertner, May 03 2019

Keywords

Comments

The corresponding records of k are given in A307882.

Crossrefs

Programs

  • PARI
    kmax=0; for(n=2,10^7,forstep(k=1,n,2,if(isprime(2*n-k)&&isprime(2*n+k),if(k>kmax,print1(n,", ");kmax=k);break(1))))

A307882 Records of the offset k in A307881, divided by 3.

Original entry on oeis.org

-1, 1, 3, 5, 7, 9, 11, 13, 15, 25, 29, 31, 39, 45, 61, 63, 75, 81, 85, 111, 123, 131, 151, 175, 207, 225, 241, 267, 301, 329, 335, 427, 435, 505, 539, 565, 611, 617, 665, 695, 739, 805, 843, 875, 1113, 1143, 1465, 1797, 1801, 1959, 2065, 2369, 2783
Offset: 1

Views

Author

Hugo Pfoertner, May 03 2019

Keywords

Comments

The divisibility of k by 3 of all terms after a(1) is conjectural. Offsets not divisible by 3 are given as -k instead of k/3.

Crossrefs

Programs

  • PARI
    kmax=0; for(n=2,10^7,forstep(k=1,n,2,if(isprime(2*n-k)&&isprime(2*n+k),if(k>kmax,if(k%3!=0,print1(-k,", "),print1(k/3,", "));kmax=k);break(1))))
Showing 1-6 of 6 results.