OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 30 is a term because 30 = 2*3*5 has no prime factors > 7 and 30 is the average of the twin primes 29 and 31.
MAPLE
N:= 100: # for a(1) .. a(N)
V:= Vector(N): V[1]:= 4: count:= 1: with(priqueue):
initialize(pq);
insert([-6, 0, 0, 0, 0], pq);
while count < N do
t:= extract(pq);
x:= -t[1];
if isprime(x+1) and isprime(x-1) then count:= count+1; V[count]:= x fi;
insert([-7*x, t[2], t[3], t[4], t[5]+1], pq);
if t[5]=0 then
insert([-5*x, t[2], t[3], t[4]+1, 0], pq);
if t[4] = 0 then
insert([-3*x, t[2], t[3]+1, 0, 0], pq);
if t[3] = 0 then
insert([-2*x, t[2]+1, 0, 0, 0], pq);
fi fi fi;
od:
convert(V, list);
MATHEMATICA
Select[Range[50000], AllTrue[First/@FactorInteger[#], #<=7&]&&PrimeQ[#+1]&&PrimeQ[#-1]&] (* James C. McMahon, Feb 28 2026 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Feb 27 2026
STATUS
approved
