OFFSET
1,1
FORMULA
EXAMPLE
The smallest integer whose sum of digits is 17 is 89; 89 is prime, therefore 17 is in the sequence.
MATHEMATICA
Select[Prime[Range[1000]], PrimeQ[FromDigits[Join[{Mod[ #, 9]}, Table[9, {i, 1, Floor[ #/9]}]]]] &]
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def A051885(n): return ((n%9)+1)*10**(n//9)-1 # from Chai Wah Wu
def agen(startp=2):
p = startp
while True:
if isprime(A051885(p)): yield p
p = nextprime(p)
print(list(islice(agen(), 23))) # Michael S. Branicky, Jul 27 2022
CROSSREFS
KEYWORD
hard,more,nonn,base
AUTHOR
J. M. Bergot, Jun 14 2007
EXTENSIONS
Edited, corrected and extended by Stefan Steinerberger, Jun 23 2007
Extended by D. S. McNeil, Mar 20 2009
Five more terms from Max Alekseyev, Nov 09 2009
STATUS
approved