A384735 Numbers that are prime or end in a prime number (of any length).
2, 3, 5, 7, 11, 12, 13, 15, 17, 19, 22, 23, 25, 27, 29, 31, 32, 33, 35, 37, 41, 42, 43, 45, 47, 52, 53, 55, 57, 59, 61, 62, 63, 65, 67, 71, 72, 73, 75, 77, 79, 82, 83, 85, 87, 89, 92, 93, 95, 97, 101, 102, 103, 105, 107, 109, 111, 112, 113, 115, 117
Offset: 1
Examples
2, 3, 5, 7 and 11 are terms since they are prime. 15 is a term since it ends in the prime 5. 111 is a term since it ends in the prime 11.
Links
- Mohd Anwar Jamal Faiz, Primender Sequence: A Novel Mathematical Construct for Testing Symbolic Inference and AI Reasoning, arXiv:2506.10585 [cs.AI], 2025. See pp. 4, 9.
Programs
-
Maple
q:= n-> isprime(n) or (k-> k>1 and q(n mod 10^(k-1)))(length(n)): select(q, [$1..150])[]; # Alois P. Heinz, Jun 08 2025
-
Mathematica
q[n_] := AnyTrue[Range[1, IntegerLength[n]-1], PrimeQ[Mod[n, 10^#]] &]; Select[Range[120], PrimeQ[#] || q[#] &] (* Amiram Eldar, Jun 10 2025 *)
-
PARI
isok(x) = my(y=x, nb=0); while(y>1, y/=10; nb++; if (isprime(x%(10^nb)), return(1))); \\ Michel Marcus, Jun 10 2025
-
Python
from sympy import isprime def ok(n): s = str(n) return any(isprime(int(s[i:])) for i in range(len(s))) print([k for k in range(118) if ok(k)])
Comments