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.

A364458 Prime numbers that are not repdigits with digits in nondecreasing order with the property that any nontrivial permutation of the digits gives a composite number.

This page as a plain text file.
%I A364458 #118 Jan 03 2024 09:49:27
%S A364458 19,23,29,47,59,67,89,223,227,229,233,257,269,449,499,557,599,677,
%T A364458 1447,2267,2447,4447,5557,8999,11119,15559,22229,22669,23333,24889,
%U A364458 44449,48889,55589,55889,59999,79999,222269,444449,455557,555557,555589,666667,4444469,4555559
%N A364458 Prime numbers that are not repdigits with digits in nondecreasing order with the property that any nontrivial permutation of the digits gives a composite number.
%C A364458 The least terms with respectively 2, 3, 4 distinct digits are 19, 257, 24889.
%H A364458 Michael S. Branicky, <a href="/A364458/b364458.txt">Table of n, a(n) for n = 1..108</a> (all terms with <= 52 digits)
%H A364458 David A. Corneth, <a href="/A364458/a364458.gp.txt">PARI program</a>
%e A364458 19 is a term, because the digits of 19 are in nondecreasing order and 91 is the unique number != 19 given by a permutation of 19 and 91 = 7 * 13 is composite and the digits of 91 are not in nondecreasing order.
%o A364458 (PARI) is(k)=my(u=digits(k),n=#u);if(#vecsort(u,,8)==1||u!=vecsort(u)||!isprime(k),return(0));forperm(n,p,my(vp=Vec(p),v=[]);for(i=1,n,v=concat(v,u[vp[i]]));q=fromdigits(v);if(k!=q&&isprime(q),return(0)));1
%o A364458 (PARI) \\ See PARI link
%o A364458 (Python)
%o A364458 from sympy import isprime
%o A364458 from sympy.utilities.iterables import multiset_permutations as mp
%o A364458 from itertools import count, islice, combinations_with_replacement as mc
%o A364458 def bgen(d): yield from ("".join(m) for m in mc("123456789", d))
%o A364458 def agen(): yield from (t for d in count(1) for k in bgen(d) if len(set(k))!=1 and isprime(t:=int(k)) if not any((j:="".join(m))!=k and isprime(int(j)) for m in mp(k)))
%o A364458 print(list(islice(agen(), 44))) # _Michael S. Branicky_, Dec 23 2023
%Y A364458 Cf. A028864, A039986.
%K A364458 nonn,base
%O A364458 1,1
%A A364458 _Jean-Marc Rebert_, Dec 23 2023