OFFSET
1,2
COMMENTS
Except for 1, all terms == 2 (mod 3).
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 29 is a term because its sum of digits is 2+9 = 11 and 29 + 11 + 29*11 = 359 is prime.
MAPLE
f:= proc(n) local s, t;
s:= convert(convert(n, base, 10), `+`);
n+s+s*n;
end proc:
select(t -> isprime(f(t)), [1, seq(i, i=2..10000, 3)]);
PROG
(Python)
from sympy import isprime
def ok(n): s = sum(map(int, str(n))); return isprime(n + s + n*s)
print([k for k in range(702) if ok(k)]) # Michael S. Branicky, Apr 29 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Apr 29 2022
STATUS
approved