cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A355856 Primes, with at least one prime digit, that remain primes when all of their prime digits are removed.

This page as a plain text file.
%I A355856 #42 Sep 13 2022 13:04:44
%S A355856 113,131,139,151,179,193,197,211,241,311,389,421,431,541,613,617,631,
%T A355856 719,761,829,839,859,1013,1021,1031,1039,1051,1093,1097,1123,1153,
%U A355856 1201,1213,1217,1229,1231,1249,1259,1279,1291,1297,1301,1321,1381,1399,1429,1439,1459,1493,1531,1549
%N A355856 Primes, with at least one prime digit, that remain primes when all of their prime digits are removed.
%C A355856 Terms of A034844 that only have nonprime digits are not terms here. - _Michel Marcus_, Jul 19 2022
%H A355856 Michael S. Branicky, <a href="/A355856/b355856.txt">Table of n, a(n) for n = 1..10000</a>
%e A355856 The prime 179 is a term because when its prime digit 7 is removed, it remains 19, which is still a prime.
%e A355856 The prime 136457911 is a term because when all of its prime digits, 3, 5, and 7 are removed, it remains 164911, which is still a prime.
%t A355856 q[n_] := (r = FromDigits[Select[IntegerDigits[n], ! PrimeQ[#] &]]) != n && PrimeQ[r]; Select[Prime[Range[250]], q] (* _Amiram Eldar_, Jul 19 2022 *)
%o A355856 (MATLAB)
%o A355856 function a = A355856( max_prime )
%o A355856     a = []; p = primes( max_prime );
%o A355856     for n = 1:length(p)
%o A355856         s = num2str(p(n));
%o A355856         s = strrep(s,'2',''); s = strrep(s,'3','');
%o A355856         s = strrep(s,'5',''); s = strrep(s,'7','');
%o A355856         m = str2double(s);
%o A355856         if m > 1
%o A355856             if isprime(m) && m ~= p(n)
%o A355856                 a = [a p(n)];
%o A355856             end
%o A355856         end
%o A355856     end
%o A355856 end % _Thomas Scheuerle_, Jul 19 2022
%o A355856 (PARI) isok(p) = if (isprime(p), my(d=digits(p), v=select(x->(!isprime(x)), d)); (#v != #d) && isprime(fromdigits(v));) \\ _Michel Marcus_, Jul 19 2022
%o A355856 (Python)
%o A355856 from sympy import isprime
%o A355856 def ok(n):
%o A355856     s = str(n)
%o A355856     if n < 10 or set(s) & set("2357") == set(): return False
%o A355856     sd = s.translate({ord(c): None for c in "2357"})
%o A355856     return len(sd) and isprime(int(sd)) and isprime(n)
%o A355856 print([k for k in range(2000) if ok(k)]) # _Michael S. Branicky_, Jul 23 2022
%Y A355856 Cf. A000040, A034844, A019546.
%K A355856 nonn,base
%O A355856 1,1
%A A355856 _Tamas Sandor Nagy_, Jul 19 2022