|
|
A094535
|
|
a(n) is the smallest integer m such that A039995(m)=n.
|
|
3
|
|
|
1, 2, 13, 23, 113, 131, 137, 1013, 1031, 1273, 1237, 1379, 6173, 10139, 10193, 10379, 10397, 10937, 12397, 12379, 36137, 36173, 101397, 102371, 101937, 102973, 103917, 106937, 109371, 109739, 123797, 123917, 123719, 346137, 193719, 346173
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(6) = 137 because 137 is the smallest number m such that A039995(m) = 6; the six numbers 3, 7, 13, 17, 37 & 137 are primes.
See also A205956 for a(100) = 39467139.
|
|
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..]
(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))
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):
if v not in adict: adict[v] = k
while n in adict: yield adict[n]; n += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|