OFFSET
0,2
LINKS
Giovanni Resta, Table of n, a(n) for n = 0..500 (first 101 terms from Reinhard Zumkeller)
Carlos Rivera, Puzzle 265. Primes embedded, The Prime Puzzles & Problems Connection.
Reinhard Zumkeller, Illustration of initial terms
FORMULA
EXAMPLE
MATHEMATICA
cnt[n_] := Count[ PrimeQ@ Union[ FromDigits /@ Subsets[ IntegerDigits[n]]], True]; a[n_] := Block[{k = 1}, While[cnt[k] != n, k++]; k]; Array[a, 21, 0] (* Giovanni Resta, Jun 16 2017 *)
PROG
(Haskell)
import Data.List (elemIndex)
import Data.Maybe (fromJust)
a094535 n = a094535_list !! n
a094535_list = map ((+ 1) . fromJust . (`elemIndex` a039995_list)) [0..]
-- Reinhard Zumkeller, Feb 01 2012
(Python)
from sympy import isprime
from itertools import chain, combinations as combs, count, islice
def powerset(s): # nonempty subsets of s
return chain.from_iterable(combs(s, r) for r in range(1, len(s)+1))
def A039995(n):
ss = set(int("".join(s)) for s in powerset(str(n)))
return sum(1 for k in ss if isprime(k))
def agen():
adict, n = dict(), 0
for k in count(1):
v = A039995(k)
if v not in adict: adict[v] = k
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 36))) # Michael S. Branicky, Aug 07 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Farideh Firoozbakht, May 08 2004
STATUS
approved