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!)
A133757 Total number of restricted right truncatable primes in base n. 0
0, 1, 2, 4, 11, 7, 20, 23, 27, 28, 61, 61, 153, 130, 151, 157, 301, 343, 561, 806, 1046, 615, 1227, 2136, 2472, 2288, 3685, 2110, 5241, 4798, 7017, 10630, 14175, 14127, 21267, 15034, 24677, 29289, 46814, 29291, 63872, 58451, 82839, 143678, 196033, 99103, 218108 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,3
COMMENTS
Prime digits p in base n are counted if there is no prime with 2 digits which can have its rightmost digit removed to produce p.
LINKS
I. O. Angell and H. J. Godwin, On Truncatable Primes, Math. Comput. 31, 265-267, 1977.
Eric Weisstein's World of Mathematics, Truncatable Prime.
PROG
(Python)
from sympy import isprime, primerange
def fromdigits(digs, base):
return sum(d*base**i for i, d in enumerate(digs))
def a(n):
prime_lists, an = [(p, ) for p in primerange(1, n)], 0
digits = 1
while len(prime_lists) > 0:
new_prime_strs = set()
for p in prime_lists:
can_extend = False
for d in range(n):
c = (d, ) + p
if isprime(fromdigits(c, n)):
can_extend = True
new_prime_strs.add(c)
if not can_extend:
an += 1
prime_lists = list(new_prime_strs)
digits += 1
return an
print([a(n) for n in range(2, 27)]) # Michael S. Branicky, Dec 11 2022
CROSSREFS
Cf. A076586.
Sequence in context: A012611 A356109 A356175 * A246164 A124183 A218643
KEYWORD
nonn
AUTHOR
Martin Renner, Jan 04 2008
EXTENSIONS
a(6) corrected and a(11) and beyond from Michael S. Branicky, Dec 11 2022
STATUS
approved

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 May 1 23:54 EDT 2024. Contains 372178 sequences. (Running on oeis4.)