login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A076586 Total number of right truncatable primes in base n. 15

%I #23 May 03 2022 15:16:46

%S 0,4,7,14,36,19,68,68,83,89,179,176,439,373,414,473,839,1010,1577,

%T 2271,2848,1762,3376,5913,6795,6352,10319,5866,14639,13303,19439,

%U 29982,38956,39323,58857,41646,68371,80754,128859,81453,175734,161438,228543,396274,538797

%N Total number of right truncatable primes in base n.

%H 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 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 <a href="/index/Tri#tprime">Index entries for sequences related to truncatable primes</a>

%o (Python)

%o from sympy import isprime, primerange

%o from sympy.ntheory.digits import digits

%o def fromdigits(digs, base):

%o return sum(d*base**i for i, d in enumerate(digs))

%o def a(n):

%o prime_lists, an = [(p,) for p in primerange(1, n)], 0

%o digits = 1

%o while len(prime_lists) > 0:

%o an += len(prime_lists)

%o candidates = set((d,)+p for p in prime_lists for d in range(1, n))

%o prime_lists = [c for c in candidates if isprime(fromdigits(c, n))]

%o digits += 1

%o return an

%o print([a(n) for n in range(2, 27)]) # _Michael S. Branicky_, May 03 2022

%Y Cf. A024763, A024764, A024765, A024766, A024767, A024768, A024769, A024770, A076623.

%K nonn,base

%O 2,2

%A _Martin Renner_, Oct 20 2002, Sep 24 2007

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 13:51 EDT 2024. Contains 371914 sequences. (Running on oeis4.)