A338972 Primes p such that the sum of decimal digits of p is the sum of primes dividing p+1 (with repetition).
5, 17, 47, 97, 359, 1979, 2399, 5669, 9719, 12799, 79379, 134999, 143999, 161999, 199679, 671999, 679999, 890999, 967999, 974999, 1249999, 3455999, 3583999, 3644999, 4687499, 4976639, 5279999, 5375999, 6298559, 8774999, 16839899, 24959999, 26459999, 29567999, 45359999, 48383999, 68849999
Offset: 1
Examples
a(4) = 97 is in the sequence because 97 is prime, the sum of digits of 97 is 9+7 = 16 and the sum of primes dividing 98=2*7*7 is 2+7+7 = 16.
Links
- Robert Israel, Table of n, a(n) for n = 1..63
Programs
-
Maple
sod:= n -> convert(convert(n,base,10),`+`): spf:= proc(n) local t; add(t[1]*t[2],t=ifactors(n)[2]) end proc: select(p -> sod(p) = spf(p+1), [seq(ithprime(i),i=1..10^5)]);
-
Mathematica
sddQ[p_]:=Total[Flatten[Table[#[[1]],#[[2]]]&/@FactorInteger[p+1]]]==Total[IntegerDigits[p]]; Select[Prime[Range[600000]],sddQ] (* The program generates the first 30 terms of the sequence. *) (* Harvey P. Dale, Jul 31 2025 *)
-
PARI
isok(p) = if (isprime(p), my(f=factor(p+1)); sumdigits(p) == f[, 1]~*f[, 2]); \\ Michel Marcus, Dec 18 2020