fork download
  1. function p=f(n)
  2. p=1;t=1;while t
  3. p=p+1;t=~isprime(p)|sum(arrayfun(@(x)any(strfind(num2str(p),num2str(x))),primes(p)))~=n+1;end
  4.  
  5. end % line needed only in the online interpreter
  6.  
  7. f(2)
Success #stdin #stdout 0.59s 65240KB
stdin
Standard input is empty
stdout
ans =  23