A298736 a(n) = s(n) - prime(n+1)+3, where s(n) = smallest even number x > prime(n) such that the difference x-p is composite for all primes p <= prime(n).
6, 10, 26, 90, 88, 84, 82, 200, 282, 280, 522, 518, 516, 512, 942, 936, 934, 928, 924, 922, 2566, 2562, 2556, 2548, 2544, 2542, 5268, 5266, 5262, 5248, 5244, 5238, 5236, 7280, 7278, 7272, 7266, 7262, 7256, 43356, 43354, 43344, 43342, 43338, 43336, 43324, 54024
Offset: 1
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..1205
- Bui Minh Phong and Li Dongdong, Elementary problems which are equivalent to the Goldbach's Conjecture, Acta Academiae Paedagogicae Agriensis, Sectio Mathematicae 31 (2004) 33-37.
- Wikipedia, Goldbach's conjecture
- Index entries for sequences related to Goldbach conjecture
Programs
-
Maple
N:= 100: # to get a(1)..a(N) P:= [seq(ithprime(i),i=1..N+1)]: s:= proc(n,k0) local k; for k from max(k0,P[n]+1) by 2 do if andmap(not(isprime), map(t -> k - t, P[1..n])) then return k fi od end proc: K[1]:= 6: A[1]:= 6: for n from 2 to N do K[n]:= s(n,K[n-1]); A[n]:= K[n]- P[n+1]+3; od: seq(A[n],n=1..N); # Robert Israel, Mar 01 2018
-
Mathematica
f[n_] := Block[{k, x = 2, q = Prime@ Range@ n}, x += Mod[x, 2]; While[k = 1; While[k < n +1 && CompositeQ[x - q[[k]]], k++]; k < n +1, z = x += 2]; x - Prime[n +1] +3]; Array[f, 47] (* Robert G. Wilson v, Feb 26 2018 *)
-
PARI
s(n) = my(p=prime(n), x); if(p==2, x=4, x=p+1); while(1, forprime(q=1, p, if(ispseudoprime(x-q), break, if(q==p, return(x)))); x=x+2) a(n) = s(n)-prime(n+1)+3
Comments