OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
18 is a term because 18 + (2+3+3) = 26 + (2+13) = ending prime 41. Between 18 and 41 one finds 5 primes 19, 23, 29, 31 and 37.
MAPLE
filter:= proc(n) local r, s, t;
if isprime(n) then return false fi;
t:= 0: s:= n;
do
r:= s;
s:= s + add(p[1]*p[2], p=ifactors(s)[2]);
t:= t + numtheory:-pi(s-1) - numtheory:-pi(r);
if isprime(s) then return t=5 fi;
if t > 5 then return false fi;
od;
end proc:
select(filter, [$2..10000]); # Robert Israel, May 08 2020
MATHEMATICA
ok[n_] := CompositeQ[n] && Block[{k=n, p = NextPrime[n, 6]}, While[k < p, k += Total[ Times @@@ FactorInteger[k]]]; k == p]; Select[Range@ 6069, ok] (* Giovanni Resta, May 08 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Patrick De Geest, Sep 15 1999
EXTENSIONS
Offset changed to 1 by Robert Israel, May 08 2020
STATUS
approved