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.

Showing 1-2 of 2 results.

A085413 Prime such that concatenation of it and its first digit is prime.

Original entry on oeis.org

13, 19, 31, 37, 79, 103, 109, 151, 157, 181, 193, 331, 337, 353, 359, 367, 373, 379, 383, 751, 757, 787, 919, 941, 947, 953, 967, 971, 983, 1009, 1021, 1033, 1039, 1063, 1069, 1117, 1201, 1249, 1279, 1291, 1459, 1483, 1489, 1567, 1579, 1597, 1609, 1663, 1669
Offset: 1

Views

Author

Zak Seidov, Jun 29 2003

Keywords

Comments

Indices of primes in A085412; primes as concatenation of prime and its first digit in A085414.

Examples

			13 is a term because concatenation of 13 and 1 is prime.
		

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0:
    for d from 1 while count < 100 do
      for a in [1,3,7,9] do
        for x from 1 to 10^d-1 by 2 while count < 100 do
          if isprime(a*10^d + x) and isprime(a*10^(d+1)+10*x+a) then
            R:= R, a*10^d+x; count:= count+1
    fi od od od:
    R; # Robert Israel, Mar 24 2023
  • Python
    from itertools import count, islice
    from sympy import isprime, primerange
    def agen(): # generator of terms
        for d in count(1):
            for f in [1, 3, 7, 9]:
                for p in primerange(f*10**d, (f+1)*10**d):
                    if isprime(10*p+f):
                        yield p
    print(list(islice(agen(), 50))) # Michael S. Branicky, Mar 24 2023

Formula

Prime[A085412]

A085414 Primes that are a concatenation of a prime and its first digit.

Original entry on oeis.org

131, 191, 313, 373, 797, 1031, 1091, 1511, 1571, 1811, 1931, 3313, 3373, 3533, 3593, 3673, 3733, 3793, 3833, 7517, 7577, 7877, 9199, 9419, 9479, 9539, 9679, 9719, 9839, 10091, 10211, 10331, 10391, 10631, 10691, 11171, 12011, 12491, 12791, 12911
Offset: 1

Views

Author

Zak Seidov, Jun 29 2003

Keywords

Comments

Also primes remaining prime after deleting last digit, but not all such primes. See also A012833, A024770, A033664, A069867.

Examples

			13 is a term because concatenation of 13 and 1 is prime.
		

Crossrefs

Showing 1-2 of 2 results.