This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A338972 #17 Jul 31 2025 18:36:40 %S A338972 5,17,47,97,359,1979,2399,5669,9719,12799,79379,134999,143999,161999, %T A338972 199679,671999,679999,890999,967999,974999,1249999,3455999,3583999, %U A338972 3644999,4687499,4976639,5279999,5375999,6298559,8774999,16839899,24959999,26459999,29567999,45359999,48383999,68849999 %N A338972 Primes p such that the sum of decimal digits of p is the sum of primes dividing p+1 (with repetition). %H A338972 Robert Israel, <a href="/A338972/b338972.txt">Table of n, a(n) for n = 1..63</a> %e A338972 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. %p A338972 sod:= n -> convert(convert(n,base,10),`+`): %p A338972 spf:= proc(n) local t; add(t[1]*t[2],t=ifactors(n)[2]) end proc: %p A338972 select(p -> sod(p) = spf(p+1), [seq(ithprime(i),i=1..10^5)]); %t A338972 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 *) %o A338972 (PARI) isok(p) = if (isprime(p), my(f=factor(p+1)); sumdigits(p) == f[, 1]~*f[, 2]); \\ _Michel Marcus_, Dec 18 2020 %Y A338972 Primes in A339805. %Y A338972 Cf. A001414, A007953. %K A338972 nonn,base %O A338972 1,1 %A A338972 _J. M. Bergot_ and _Robert Israel_, Dec 18 2020