OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
1 + 1 = 2, which is prime; 10 + 1 = 11, which is prime; 12 + 1 = 13, which is prime; 16 + 1 = 17, which is prime; 18 + 1 = 19, which is prime; 21 + 2 = 23, which is prime; etc.
MAPLE
select(t -> isprime(t + floor(t/10^ilog10(t))), [$1..1000]); # Robert Israel, May 05 2020
MATHEMATICA
Select[ Range[280], PrimeQ[ # + IntegerDigits[ # ][[1]]] &] (* Robert G. Wilson v, Jun 14 2005 *)
PROG
(Python)
from sympy import isprime
from itertools import count, islice
def agen(): # generator of terms
an = 0
while True:
an = next(k for k in count(an+1) if isprime(k + int(str(k)[0])))
yield an
print(list(islice(agen(), 58))) # Michael S. Branicky, Oct 03 2024
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Eric Angelini, Jun 11 2005
EXTENSIONS
Edited, corrected and extended by Robert G. Wilson v, Jun 14 2005
STATUS
approved