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!)
A371654 Numbers that are not multiples of 10 and that yield a prime if their digits are arranged in ascending order. 2
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 32, 37, 47, 59, 67, 71, 73, 74, 76, 79, 89, 91, 92, 95, 97, 98, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 157, 167, 172, 173, 175, 176, 179, 193, 194, 197, 199, 203, 209, 217, 223, 227, 229, 232, 233, 239, 257 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
If N is a term then all numbers with the same digits as N are terms too.
LINKS
EXAMPLE
91 is a term because arranging its digits in ascending order yields 19, which is a prime.
MATHEMATICA
Select[Range[500], Mod[#, 10] != 0 && PrimeQ[FromDigits[Sort[IntegerDigits[#]]]] &]
PROG
(Python)
from sympy import isprime
def ok(n): return n%10 and isprime(int("".join(sorted(str(n)))))
print([k for k in range(260) if ok(k)]) # Michael S. Branicky, Apr 01 2024
(Python)
from itertools import count, islice, combinations_with_replacement
from sympy import isprime
from sympy.utilities.iterables import multiset_permutations
def A371654_gen(): # generator of terms
for l in count(1):
xlist = []
for p in combinations_with_replacement('0123456789', l):
if isprime(int(''.join(p))):
xlist.extend(int(''.join(d)) for d in multiset_permutations(p) if d[0] != '0' and d[-1] != '0')
yield from sorted(xlist)
A371654_list = list(islice(A371654_gen(), 20)) # Chai Wah Wu, Apr 10 2024
CROSSREFS
Sequence in context: A326715 A338925 A358761 * A089063 A339819 A247142
KEYWORD
nonn,base,easy
AUTHOR
César Eliud Lozada, Apr 01 2024
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 August 13 13:50 EDT 2024. Contains 375142 sequences. (Running on oeis4.)