login
This site is supported by donations to The OEIS Foundation.

 

Logo

The October issue of the Notices of the Amer. Math. Soc. has an article about the OEIS.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A039986 Primes such that every distinct permutation of digits is composite (including permutations with leading zeros). 4
2, 3, 5, 7, 11, 19, 23, 29, 41, 43, 47, 53, 59, 61, 67, 83, 89, 151, 211, 223, 227, 229, 233, 257, 263, 269, 353, 383, 409, 431, 433, 443, 449, 487, 499, 523, 541, 557, 599, 661, 677, 773, 827, 829, 853, 859, 881, 883, 887, 929, 997, 1447, 1451, 1481, 2111 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

At most one permutation of digits of A179239 can occur in this sequence. - David A. Corneth, Jun 28 2018

Is there a term with more than 4 distinct digits? - David A. Corneth, Jun 30 2018

The sequence can be seen as a table with the n-digit terms in row n. Row lengths would then be (4, 13, 34, 45, 68, 67, 47, 36, 40, 46, 33, 45, 35, 38, 32, ...). In these rows there are (0, 0, 0, 6, 9, 3, 0, 1, 0, 0, ...) terms with >= 4 distinct digits: this seems to happen only for terms with 4, 5, 6 or 8 digits. I conjecture that there are no more than these 6 + 9 + 3 + 1 = 19 terms (2861, 4027, 4801, 5209, 5623, 5849, 24889, 26561, 40609, 40883, 66541, 66853, 85087, 85843, 86441, 288689, 442469, 558541, 55555429) with 4, and none with 5 or more distinct digits. - M. F. Hasler, Jul 01 2018

Prime repunits (A004022) are a subset of this sequence. As larger terms are seemingly all near-repdigit primes, it is possible to obtain very large terms. For example: (10^10002 - 1)/9 - 10^2872. - Hans Havermann, Jul 08 2018

LINKS

Hans Havermann and M. F. Hasler, Table of n, a(n) for n = 1..1141 (Terms < 10^30; earlier terms from T. D. Noe and David A. Corneth.)

Hans Havermann, AEnlic primes.

MAPLE

with(combinat): P:=proc(n) local a, b, c, d, j, k, t, x; x:=ithprime(n);

a:=permute(convert(x, base, 10)); b:=ilog10(x)+1; d:=0;

for k from 1 to nops(a) do c:=0; for j from 1 to b do c:=10*c+a[k][j]; od;

if not isprime(c) then d:=d+1; fi; od; if d=nops(a)-1 then x; fi;

end: seq(P(i), i=1..330); # Paolo P. Lava, Jun 29 2018

MATHEMATICA

t = {}; Do[p=Prime[n]; If[Length[Select[Table[FromDigits[k], {k, Permutations[IntegerDigits[p]]}], PrimeQ]] == 1, AppendTo[t, p]], {n, 330}]; t (* Jayanta Basu, May 07 2013 *)

Select[Prime[Range[400]], AllTrue[FromDigits/@Rest[ Permutations[ IntegerDigits[#]]], CompositeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 22 2015 *)

PROG

(PARI) is(n, d=digits(n))={isprime(n)&&!for(i=1, (#d)!, (n=vecextract(d, numtoperm(#d, i)))!=d&& isprime(fromdigits(n))&& return)} \\ Then: select(is, primes(500)) - M. F. Hasler, Jun 28 2018

is(n)={isprime(n)||return; my(d=vecsort(digits(n), (a, b)->if(a-b&& t=bittest(650, a)-bittest(650, b), t, a-b)), p=vector(#d, i, i), N(p, i=2)= while((t=p[i]-1)&& while((setsearch(Set(p[i+1..#p]), t)|| d[t]==d[p[i]])&& t--, ); !t, i++>#p&& return); i<#p|| bittest(650, d[t])|| return; concat([setminus(Set(p[1..i]), [t]), t, p[i+1..#p]]), t); #d==1|| !until(!p=N(p), (n!=t=fromdigits(vecextract(d, p)))&& isprime(t)&& return)} \\ Produces only inequivalent permutations which can be prime. - M. F. Hasler, Jun 28 2018

A039986_row(n)={if(n>1, local(D=eval(Vec("0245681379")), u=vectorv(n, i, 10^(n-i)), nextperm()=for(i=2, n, (t=p[i]-1)&& while(setsearch(Set(p[i+1..n]), t)|| d[t]==d[p[i]], t--||break); t|| next; i<n|| bittest(650, d[t])|| return; return(p=concat([setminus(Set(p[1..i]), [t]), t, p[i+1..n]]))), L=List(), f, p, d); forvec(i=vector(n, i, [7^(i==n), 10]), vecsum(d=vecextract(D, i))%3|| next; f=0; p=[1..n]; until(!nextperm(), isprime(vecextract(d, p)*u)&& (f&& next(2)|| f=p)); f&& d[f[1]]&& listput(L, vecextract(d, f)*u), 1); Set(L), primes(4))} \\ Returns all terms with n digits. - M. F. Hasler, Jul 01 2018

CROSSREFS

Cf. A030291, A179239.

Cf. A225421 (only odd digits).

Cf. A244529 for another variant. - M. F. Hasler, Jun 28 2018

Sequence in context: A262837 A143260 A246044 * A278694 A214837 A079346

Adjacent sequences:  A039983 A039984 A039985 * A039987 A039988 A039989

KEYWORD

base,nonn

AUTHOR

David W. Wilson

EXTENSIONS

Name clarified upon the suggestion of Robert Israel, Jun 30 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 24 22:27 EDT 2018. Contains 315360 sequences. (Running on oeis4.)