It would be fair to discount this discourse from the submission slate. More of a thought experment using a lot of brute force tactics that are pricey.
from math import sqrt from itertools import permutations
Prime number sieve from Basic submission...
# function to generate a prime number sieve def gen_sieve(lim): # function to retrieve next prime index in sieve def nextPrime(n): n += 1 while not s[n]: n += 1 continue return n i = u = lim + 1 j = k = 0 s =  * i s = 0 s = 0 while k < sqrt(u): j = nextPrime(k) k = j while j + k < u: j += k s[j] = 0 return s
Not sure how much memory is given back after this...
# function to extract number digits from a string def extract_nums(test_str): return list(filter(lambda x: not x.isalpha(), test_str))
We end up with a list of strings, which, as it were turns out to be a better way to venture forward as it does get resolved to integers down the way.
Next we look for odd number combinations (last member in list).
def filter_odd_nums(nums): return list(filter(lambda x: int(x[len(x)-1]) % 2, nums))
The next step uses the most resources.
#function to generate permutations of given r value def generate_perms(nums, r): return list(permutations(nums, r))
With a list of tuples that contain only lower order odd numbers, we can next combine the tuples into numeric values in a list...
# function to join tuples of number strings into an integer def combine_nums(nums): return [int(''.join(x)) for x in nums]
Next to see if the number combination is found in the test string...
# function to filter number in test string def filter_in_str(nums, test_str): return list(filter(lambda x: str(x) in test_str, nums))
Those that do get tested for primeness...
# filter to track primes def filter_primes(nums): s = gen_sieve(max(nums)) return list(filter(lambda x: not not s[x], nums))
The outcome should rightly be a list of primes contained in the string
Given there are any number of elements in the numbers list, things can feasibly go off the rails in this realm. Finding an effecient way to explore this is the ultimate goal. Test case to follow..