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!)
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
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
A039995(a(n)) = n and A039995(m) != n for m < a(n). - Reinhard Zumkeller, Feb 01 2012
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..]
-- 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
Cf. A205956.
Sequence in context: A215390 A285789 A090528 * A035244 A085822 A213321
KEYWORD
base,nonn
AUTHOR
Farideh Firoozbakht, May 08 2004
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 April 24 19:06 EDT 2024. Contains 371962 sequences. (Running on oeis4.)