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-3 of 3 results.

A059693 Palindromes n such that 1n1, 3n3, 7n7 and 9n9 are all primes.

Original entry on oeis.org

8179718, 8615168, 209484902, 303272303, 342272243, 354050453, 378707873, 533373335, 631363136, 661525166, 668787866, 792545297, 807989708, 964666469, 12792529721, 14435153441, 17755355771, 20160806102, 20175857102
Offset: 1

Views

Author

Patrick De Geest, Feb 07 2001

Keywords

Examples

			8179718 is ok because 181797181, 381797183, 781797187 and 981797189 are primes.
		

Crossrefs

A059677 Numbers n such that 1n1, 3n3, 7n7 and 9n9 are all primes.

Original entry on oeis.org

20, 53, 341, 536, 2312, 2477, 3380, 3665, 3686, 4547, 5009, 5105, 6458, 6488, 6731, 6845, 7499, 7508, 7562, 7835, 8411, 8831, 9032, 9386, 9764, 9839, 11027, 11885, 14990, 19589, 20498, 21080, 22844, 24821, 25220, 26393, 27593, 29864, 29921
Offset: 1

Views

Author

Harvey P. Dale, Feb 05 2001

Keywords

Examples

			2312 is a term because 123121, 323123, 723127 and 923129 are all primes.
		

Crossrefs

Programs

  • Mathematica
    Select[ Range[ 30000 ], PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "1", {1, -1} ] ] ] && PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "3", {1, -1} ] ] ] && PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "7", {1, -1} ] ] ] && PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "9", {1, -1} ] ] ] & ]
    enclose[n_]:=Table[FromDigits[Join[{i},IntegerDigits[n],{i}]],{i, {1,3,7,9}}]; Select[Range[30000],AllTrue[enclose[#],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 21 2015 *)

Extensions

More terms from Patrick De Geest, Feb 07 2001

A360781 Primes p such that at least one number remains prime when p is bracketed by a single digit d; that is, at least one instance of d//p//d is prime where // means concatenation.

Original entry on oeis.org

2, 3, 5, 7, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 101, 103, 107, 109, 113, 131, 139, 149, 151, 157, 163, 173, 179, 191, 193, 197, 211, 223, 227, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331
Offset: 1

Views

Author

Harvey P. Dale, Feb 20 2023

Keywords

Comments

The bracketing digit d must be 1, 3, 7, or 9.

Examples

			263 is included because 263 is a prime and 32633 (and also 92639) is a prime.
		

Crossrefs

Programs

  • Maple
    q:= p-> ormap(isprime, map(d-> parse(cat(d, p, d)), [1, 3, 7, 9])):
    select(q, [ithprime(i)$i=1..67])[];  # Alois P. Heinz, Feb 22 2023
  • Mathematica
    brkQ[p_]:=AnyTrue[Table[FromDigits[Join[{d},IntegerDigits[p],{d}]],{d,{1,3,7,9}}],PrimeQ]; Select[Prime[Range[100]],brkQ]
  • PARI
    is(p) = my(d=digits(p)); forstep(k=1, 9, 2, if (isprime(fromdigits(concat(k, concat(d,k)))), return(1)));
    isok(p) = if (isprime(p), is(p)); \\ Michel Marcus, Feb 20 2023
  • Python
    from sympy import isprime, nextprime
    from itertools import islice
    def agen(): # generator of terms
        p = 2
        while True:
            sp = str(p)
            if any(isprime(int(d+sp+d)) for d in "1379"):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 57))) # Michael S. Branicky, Feb 20 2023
    

Formula

Union of A069687, A069688, A069689, A069690. - Alois P. Heinz, Feb 22 2023
Showing 1-3 of 3 results.