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 A076586 #23 May 03 2022 15:16:46 %S A076586 0,4,7,14,36,19,68,68,83,89,179,176,439,373,414,473,839,1010,1577, %T A076586 2271,2848,1762,3376,5913,6795,6352,10319,5866,14639,13303,19439, %U A076586 29982,38956,39323,58857,41646,68371,80754,128859,81453,175734,161438,228543,396274,538797 %N A076586 Total number of right truncatable primes in base n. %H A076586 Seth A. Troisi, <a href="/A076586/b076586.txt">Table of n, a(n) for n = 2..100</a> (terms n=2..53 from Martin Renner) %H A076586 I. O. Angell and H. J. Godwin, <a href="http://dx.doi.org/10.1090/S0025-5718-1977-0427213-2">On Truncatable Primes</a>, Math. Comput. 31, 265-267, 1977. %H A076586 <a href="/index/Tri#tprime">Index entries for sequences related to truncatable primes</a> %o A076586 (Python) %o A076586 from sympy import isprime, primerange %o A076586 from sympy.ntheory.digits import digits %o A076586 def fromdigits(digs, base): %o A076586 return sum(d*base**i for i, d in enumerate(digs)) %o A076586 def a(n): %o A076586 prime_lists, an = [(p,) for p in primerange(1, n)], 0 %o A076586 digits = 1 %o A076586 while len(prime_lists) > 0: %o A076586 an += len(prime_lists) %o A076586 candidates = set((d,)+p for p in prime_lists for d in range(1, n)) %o A076586 prime_lists = [c for c in candidates if isprime(fromdigits(c, n))] %o A076586 digits += 1 %o A076586 return an %o A076586 print([a(n) for n in range(2, 27)]) # _Michael S. Branicky_, May 03 2022 %Y A076586 Cf. A024763, A024764, A024765, A024766, A024767, A024768, A024769, A024770, A076623. %K A076586 nonn,base %O A076586 2,2 %A A076586 _Martin Renner_, Oct 20 2002, Sep 24 2007