OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 971 is a term because 971 is prime, the next prime is 977, 971*977 = 948667, and 9+7+1+9+7+7 = 40 = 9+4+8+6+6+7.
MAPLE
q:= 2: sq:= q;
R:= NULL: count:= 0:
while count < 100 do
p:= q; sp:= sq;
q:= nextprime(q);
sq:= convert(convert(q, base, 10), `+`);
if sp+sq = convert(convert(p*q, base, 10), `+`) then
R:= R, p; count:= count+1;
fi
od:
R;
MATHEMATICA
Select[Prime@Range@3000, Total@Flatten[IntegerDigits/@(t=NextPrime[#, {0, 1}])]==Total@IntegerDigits[Times@@t]&] (* Giorgos Kalogeropoulos, Jul 20 2021 *)
PROG
(PARI) isok(p) = if (isprime(p), my(q=nextprime(p+1)); sumdigits(p)+sumdigits(q) == sumdigits(p*q)); \\ Michel Marcus, Jul 20 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Jul 19 2021
STATUS
approved