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!)
A362678 Primes whose digits are prime and in nondecreasing order. 1

%I #50 Aug 08 2023 17:50:24

%S 2,3,5,7,23,37,223,227,233,257,277,337,557,577,2237,2333,2357,2377,

%T 2557,2777,3557,5557,22277,22777,23333,23357,23557,25577,33377,33577,

%U 222337,222557,223337,223577,233357,233557,233777,235577,333337,335557,355777

%N Primes whose digits are prime and in nondecreasing order.

%C Intersection of A009994 and A019546.

%C The subsequence for primes whose digits are prime and in strictly increasing order has just eight terms: 2 3 5 7 23 37 257 2357 (see A177061).

%H Michael S. Branicky, <a href="/A362678/b362678.txt">Table of n, a(n) for n = 1..10000</a>

%p M:= 7: # for terms with <+ M digits

%p R:= NULL:

%p for d from 1 to M do

%p S:= NULL:

%p for x2 from 0 to d do

%p for x3 from 0 to d-x2 do

%p for x5 from 0 to d-x2-x3 do

%p x7:= d-x2-x3-x5;

%p x:= parse(cat(2$x2,3$x3,5$x5,7$x7));

%p if isprime(x) then S:= S,x fi;

%p od od od;

%p R:= R, op(sort([S]));

%p od:

%p R; # _Robert Israel_, Jul 04 2023

%t Select[Prime[Range[31000]], AllTrue[d = IntegerDigits[#], PrimeQ] && LessEqual @@ d &] (* _Amiram Eldar_, Jul 07 2023 *)

%o (Python)

%o from sympy import isprime

%o from itertools import count, combinations_with_replacement as cwr, islice

%o def agen(): yield from (filter(isprime, (int("".join(c)) for d in count(1) for c in cwr("2357",d))))

%o print(list(islice(agen(), 50))) # _Michael S. Branicky_, Jul 05 2023

%o (PARI) isok(p) = if (isprime(p), my(d=digits(p)); (d == vecsort(d)) && (#select(isprime, d) == #d)); \\ _Michel Marcus_, Jul 07 2023

%Y Cf. A009994, A019546, A177061.

%K nonn,base

%O 1,1

%A _James C. McMahon_, Jul 03 2023

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 July 16 23:11 EDT 2024. Contains 374360 sequences. (Running on oeis4.)