login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A098224
Number of primes <=10^n in which decimal digits are all distinct.
5
4, 24, 121, 631, 3160, 13399, 47349, 137859, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086
OFFSET
1,1
COMMENTS
Partial sums of A073532. - Lekraj Beedassy, Aug 02 2008
No number with more than 10 digits can have all of its decimal digits distinct, and no number that uses all ten distinct decimal digits can be prime (because the sum of all ten decimal digits is 45 so any such number is divisible by 3). Therefore, every term in the sequence from and after a(9) is the same, i.e., 283086. - Harvey P. Dale, Dec 12 2010
FORMULA
a(n) = 283086 for n >= 9.
MATHEMATICA
okQ[n_]:=Max[DigitCount[n]]==1
Table[Length[Select[Prime[Range[PrimePi[10^i]]], okQ]], {i, 9}] (* Harvey P. Dale, Dec 12 2010 *)
PROG
(Python)
from sympy import sieve
def distinct_digs(n): s = str(n); return len(s) == len(set(s))
def aupton(terms):
ps, alst = 0, []
for n in range(1, terms+1):
if n >= 10: alst.append(ps); continue
ps += sum(distinct_digs(p) for p in sieve.primerange(10**(n-1), 10**n))
alst.append(ps)
return alst
print(aupton(35)) # Michael S. Branicky, Apr 24 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Labos Elemer, Oct 26 2004
STATUS
approved