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.

A080789 Numbers that are primes when turned upside down.

This page as a plain text file.
%I A080789 #7 Nov 19 2021 10:10:38
%S A080789 11,19,61,68,101,109,110,116,118,161,166,169,181,188,190,199,601,608,
%T A080789 610,616,619,661,680,1006,1010,1018,1019,1061,1066,1081,1090,1091,
%U A080789 1096,1100,1106,1108,1109,1118,1160,1169,1180,1181,1186,1601,1606,1609,1610,1618
%N A080789 Numbers that are primes when turned upside down.
%D A080789 P. Giannopoulos, The Brainteasers (unpublished)
%H A080789 Michael S. Branicky, <a href="/A080789/b080789.txt">Table of n, a(n) for n = 1..10000</a>
%o A080789 (Python)
%o A080789 from sympy import isprime
%o A080789 from itertools import product
%o A080789 def ud(s):
%o A080789     return s[::-1].translate({ord('6'):ord('9'), ord('9'):ord('6')})
%o A080789 def auptod(maxdigits):
%o A080789     alst = []
%o A080789     for d in range(1, maxdigits+1):
%o A080789         for start in "16":
%o A080789             for p in product("01689", repeat=d-1):
%o A080789                 s = start + "".join(p)
%o A080789                 t, udt = int(s), int(ud(s))
%o A080789                 if isprime(udt): alst.append(t)
%o A080789     return alst
%o A080789 print(auptod(4)) # _Michael S. Branicky_, Nov 19 2021
%Y A080789 Cf. A057770, A054047, A080788.
%K A080789 base,easy,nonn
%O A080789 1,1
%A A080789 P. Giannopoulos (pgiannop1(AT)yahoo.com), Mar 12 2003
%E A080789 610 inserted and a(24) and beyond from _Michael S. Branicky_, Nov 19 2021