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.
%I A048661 #16 Apr 28 2024 11:31:57 %S A048661 0,0,0,0,0,4,12,16,132,308,1096,3704,12984,47008,179660,681608 %N A048661 Number of n-digit dihedral primes for which the 4 numbers (n, n upside-down, n in a mirror, n upside-down and mirrored) are distinct. %H A048661 Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_039.htm">Puzzle 39. The Mirrorable Numbers (By Mike Keith)</a>, The Prime Puzzles and Problems Connection. %o A048661 (Python) %o A048661 from sympy import isprime %o A048661 from itertools import count, islice, product %o A048661 def t(s): return s.translate({ord("2"):ord("5"), ord("5"):ord("2")}) %o A048661 def a(n): %o A048661 if n < 2: return 0 %o A048661 c = 0 %o A048661 for mid in product("01258", repeat=n-2): %o A048661 s = "1" + "".join(mid) + "1" %o A048661 ss = set([s, s[::-1], t(s), t(s[::-1])]) %o A048661 if len(ss) != 4: continue %o A048661 if all(isprime(int(w)) for w in ss): c += 1 %o A048661 return c %o A048661 print([a(n) for n in range(1, 11)]) # _Michael S. Branicky_, Apr 27 2024 %Y A048661 Cf. A134996. %K A048661 base,more,nonn %O A048661 1,6 %A A048661 _Felice Russo_ %E A048661 a(11)-a(14) from _Sean A. Irvine_, Jun 25 2021 %E A048661 a(15)-a(16) from _Michael S. Branicky_, Apr 27 2024