A135580 Largest prime visible as a substring of 10n+3.
3, 13, 23, 3, 43, 53, 3, 73, 83, 3, 103, 113, 23, 13, 43, 53, 163, 173, 83, 193, 3, 13, 223, 233, 43, 53, 263, 73, 283, 293, 3, 313, 23, 3, 43, 353, 3, 373, 383, 3, 3, 41, 23, 433, 443, 53, 463, 73, 83, 3, 503, 13, 523, 53, 43, 53, 563, 73, 83, 593, 3, 613, 23, 3, 643, 653, 3
Offset: 0
Examples
a(0) = 3 because 10 * 0 + 3 = 3 (prime), a(1) = 13 because 10 * 1 + 3 = 13 (prime), a(3) = 3 because 10 * 3 + 3 = 33 (composite). Substrings of 33 are 0, 3, 33 and the largest prime of these is 3. a(78) = 83 because 10 * 78 + 3 = 783 (composite). The largest prime substring is 83.
Programs
-
Mathematica
a[n_]:=Max[Select[FromDigits/@Subsequences[IntegerDigits[10n+3]],PrimeQ]] (* James C. McMahon, Apr 16 2025 *)