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.
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
Keywords
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.
Links
- Gilmar Rodriguez Pierluissi, Table of n, a(n) for n = 1..44
- J.-M. Deshouillers, A. Granville, W. Narkiewicz and C. Pomerance, An upper bound in Goldbach's problem, Math. Comp. 61 (1993), 209-213.
- Gilmar Rodriguez Pierluissi, Mathematica notebook (version 11.2) with examples for sequence A293858.
- Gilmar Rodriguez Pierluissi, Adobe PDF file showing content of Mathematica notebook (in case that the reader does not have the Mathematica software available).
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
Comments