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.

A173071 Palindromic mountain primes.

Original entry on oeis.org

131, 151, 181, 191, 12421, 12721, 12821, 13831, 13931, 14741, 17971, 1235321, 1245421, 1257521, 1268621, 1278721, 1456541, 1469641, 1489841, 1579751, 1589851, 123484321, 123494321, 123575321, 136797631, 167898761, 12345854321
Offset: 1

Views

Author

Omar E. Pol, Feb 09 2010

Keywords

Comments

All terms have an odd number of digits. - Emeric Deutsch, Mar 09 2010

Examples

			a(6) = 12721; is a palindromic mountain prime.
. . . . .
. . . . .
. . 7 . .
. . . . .
. . . . .
. . . . .
. . . . .
. 2 . 2 .
1 . . . 1
		

Crossrefs

Programs

  • Maple
    a := proc (n) local rev, n1: rev := proc (n) local nn: nn := convert(n, base, 10): add(nn[j]*10^(nops(nn)-j), j = 1 .. nops(nn)) end proc: n1 := convert(n, base, 10): if n1[1]=1 and isprime(n) = true and rev(n) = n and n1[1] < n1[2] and n1[2] < n1[3] and n1[3] < n1[4] then n else end if end proc: seq(a(n), n = 1000000 .. 9999999); # this program works only for 7-digit numbers; easily adjustable for other (2k+1)-digit numbers # Emeric Deutsch, Mar 09 2010
  • Python
    from itertools import combinations
    from gmpy2 import is_prime
    A173071_list = []
    for l in range(1,10):
        for i in combinations('23456789',l):
            s = '1'+''.join(i)
            p = int(s+s[l-1::-1])
            if is_prime(p):
                A173071_list.append(p) # Chai Wah Wu, Nov 05 2015

Extensions

More terms from Emeric Deutsch, Mar 09 2010, corrected Mar 19 2010
a(22)-a(27) from Donovan Johnson, Jul 22 2010