cp's OEIS Frontend

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.

Previous Showing 21-21 of 21 results.

A384735 Numbers that are prime or end in a prime number (of any length).

Original entry on oeis.org

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

Views

Author

Mohd Anwar Jamal Faiz, Jun 08 2025

Keywords

Comments

If k is a term, so is m*10^A055642(k) + k for all m > 0. - Michael S. Branicky, Jun 10 2025

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.
		

Crossrefs

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)])
    
Previous Showing 21-21 of 21 results.