OFFSET
1,1
EXAMPLE
a(4) = 1789 because 1789 - 4 = 1785 = 3 * 5 * 7 * 17.
MAPLE
A191587 := proc(n) for i from 1 do p := ithprime(i) ; if A001221(p-n) = n then return p ; end if; end do: end proc: # R. J. Mathar, Jul 01 2011
MATHEMATICA
Table[k := 2; While[Not[Length[FactorInteger[Prime[k] - n]] == n], k++ ]; Prime[k], {n, 1, 8}]
PROG
(PARI) A191587List(m) = local(j=1, p); for(n=1, m, p=prime(j); while(omega(p-n)!=n, p=prime(j++)); print1(p, ", "));
default(primelimit, 2200000); A191587List(7); \\ Klaus Brockhaus, Jun 21 2011
(Haskell)
a191587 n = head [p | p <- dropWhile (<= n) a000040_list,
a001221 (p - n) == n]
-- Reinhard Zumkeller, Jun 24 2015
CROSSREFS
KEYWORD
nonn,hard
AUTHOR
Michel Lagneau, Jun 07 2011
EXTENSIONS
a(10)-a(16) from Donovan Johnson, Jan 14 2012
a(17)-a(20) from Robert Israel, Mar 27 2020
STATUS
approved