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 A365276 #25 Sep 29 2023 17:56:54 %S A365276 0,0,2,3,0,5,0,7,0,0,0,11,2,16,0,5,0,24,0,19,2,2,4,28,2,7,2,9,2,31,3, %T A365276 34,5,6,3,8,3,47,3,3,0,41,2,46,0,5,0,54,0,0,5,5,7,61,5,10,5,12,5,64,0, %U A365276 61,2,3,0,5,0,74,0,0,7,78,9,83,7,12,7,14,7,86,0 %N A365276 Sum of all prime substrings of n in base 10, including n itself and duplicate or overlapping substrings but not substrings with a leading 0. %e A365276 a(25) = 2 + 5 = 7. %e A365276 a(37) = 3 + 7 + 37 = 47. %e A365276 a(3002) = 3 + 2 = 5. %e A365276 a(1235) = 2 + 3 + 5 + 23 = 33. %e A365276 Example including duplicate and overlapping prime substrings: %e A365276 a(227111) = 2 + 2 + 7 + 11 + 11 + 71 + 227 + 271 + 2711 + 227111 = 230424. %e A365276 Note that in the above example, the substring 2 is incorporated into the sum twice because it appears twice in n. The same is true of the substring 11, whose two appearances overlap each other in the final three digits of n. %e A365276 Example wherein substrings with a leading 0 are to be ignored: %e A365276 a(1002) = 2 because the substrings 002 and 02 are to be ignored due to the presence of a leading 0. %o A365276 (PARI) a(n)={my(v=digits(n)); sum(j=1, #v, sum(i=1, j, if(v[i], my(t=fromdigits(v[i..j])); t*isprime(t))))} \\ _Andrew Howroyd_, Aug 30 2023 %o A365276 (Python) %o A365276 from sympy import isprime %o A365276 def a(n): %o A365276 s = str(n) %o A365276 ss = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1)) %o A365276 return sum(p for w in ss if w[0]!="0" and isprime(p:=int(w))) %o A365276 print([a(n) for n in range(81)]) # _Michael S. Branicky_, Aug 30 2023 %Y A365276 Cf. A035232, A225580. %K A365276 nonn,base %O A365276 0,3 %A A365276 _Wade Reece Eberly_, Aug 30 2023 %E A365276 More terms from _Andrew Howroyd_, Aug 30 2023