login
Numbers k such that k + s + k*s is prime, where s is the sum of digits of k.
1

%I #12 May 07 2022 15:28:25

%S 1,14,29,32,38,41,56,71,89,95,107,113,119,155,164,173,185,203,212,236,

%T 251,263,275,278,290,293,299,305,311,326,344,371,377,395,401,416,419,

%U 437,467,470,473,479,485,497,509,524,527,539,569,584,587,593,611,623,635,641,659,665,671,674,692,701

%N Numbers k such that k + s + k*s is prime, where s is the sum of digits of k.

%C Except for 1, all terms == 2 (mod 3).

%H Robert Israel, <a href="/A353197/b353197.txt">Table of n, a(n) for n = 1..10000</a>

%e a(3) = 29 is a term because its sum of digits is 2+9 = 11 and 29 + 11 + 29*11 = 359 is prime.

%p f:= proc(n) local s,t;

%p s:= convert(convert(n,base,10),`+`);

%p n+s+s*n;

%p end proc:

%p select(t -> isprime(f(t)), [1,seq(i,i=2..10000,3)]);

%o (Python)

%o from sympy import isprime

%o def ok(n): s = sum(map(int, str(n))); return isprime(n + s + n*s)

%o print([k for k in range(702) if ok(k)]) # _Michael S. Branicky_, Apr 29 2022

%Y Cf. A007953.

%K nonn,base

%O 1,2

%A _Robert Israel_, Apr 29 2022