OFFSET
1,2
COMMENTS
Composite numbers n for which a(n)=0 we call absolute composite numbers.
Almost evidently that almost all integers are absolute composite numbers. Moreover, since the number of primes<=x containing no at least one digit is o(pi(x)), then, for almost all positions of prime n, a(n)=0. It is interesting to obtain an upper estimate of number of nonzero positions in the sequence, more exactly, than o(x/log(x)).
Only O(sqrt x) numbers up to x have nonzero values in this sequence. - Charles R Greathouse IV, Jan 24 2014
LINKS
Peter J. C. Moses, Table of n, a(n) for n = 1..5000
EXAMPLE
Let n = 29. In bases 2, 3, ..., 9 the representations of 29 are 11101_2, 1002_3, 131_4, 104_5, 45_6, 41_7, 35_8, 32_9. In this list only 131_4 and 41_7 are primes, so a(29) = 47.
The sequence of numbers whose representations in bases 4 and 7, read in decimal, are primes are the numbers n such that a(n) contains the digits 4 and 7: 2, 3, 5, 17, 29, 43, ....
PROG
(Python)
from sympy import isprime
from sympy.ntheory import digits
def c(n, b): return isprime(int("".join(map(str, digits(n, b)[1:]))))
def a(n): return int("0"+"".join(k for k in "23456789" if c(n, int(k))))
print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Sep 22 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Vladimir Shevelev, Jan 23 2014
EXTENSIONS
Name clarified by Jon E. Schoenfield, Sep 21 2022
STATUS
approved