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.

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