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.

This page as a plain text file.
%I A173071 #13 Nov 06 2015 02:01:15
%S A173071 131,151,181,191,12421,12721,12821,13831,13931,14741,17971,1235321,
%T A173071 1245421,1257521,1268621,1278721,1456541,1469641,1489841,1579751,
%U A173071 1589851,123484321,123494321,123575321,136797631,167898761,12345854321
%N A173071 Palindromic mountain primes.
%C A173071 All terms have an odd number of digits. - _Emeric Deutsch_, Mar 09 2010
%H A173071 Chai Wah Wu, <a href="/A173071/b173071.txt">Table of n, a(n) for n = 1..39</a>
%e A173071 a(6) = 12721; is a palindromic mountain prime.
%e A173071 . . . . .
%e A173071 . . . . .
%e A173071 . . 7 . .
%e A173071 . . . . .
%e A173071 . . . . .
%e A173071 . . . . .
%e A173071 . . . . .
%e A173071 . 2 . 2 .
%e A173071 1 . . . 1
%p A173071 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
%o A173071 (Python)
%o A173071 from itertools import combinations
%o A173071 from gmpy2 import is_prime
%o A173071 A173071_list = []
%o A173071 for l in range(1,10):
%o A173071     for i in combinations('23456789',l):
%o A173071         s = '1'+''.join(i)
%o A173071         p = int(s+s[l-1::-1])
%o A173071         if is_prime(p):
%o A173071             A173071_list.append(p) # _Chai Wah Wu_, Nov 05 2015
%Y A173071 Cf. A002113, A002385, A134810, A134811, A134941, A134951.
%K A173071 nonn,base,fini,full
%O A173071 1,1
%A A173071 _Omar E. Pol_, Feb 09 2010
%E A173071 More terms from _Emeric Deutsch_, Mar 09 2010, corrected Mar 19 2010
%E A173071 a(22)-a(27) from _Donovan Johnson_, Jul 22 2010