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.

Showing 1-10 of 12 results. Next

A293142 Largest nonrepunit base-n circular prime (conjectured).

Original entry on oeis.org

7, 1013, 3121, 211
Offset: 3

Views

Author

Felix Fröhlich, Oct 01 2017

Keywords

Comments

A circular prime is a prime where all numbers produced by cyclic permutations of the digits are also prime.
No nonrepunit circular prime exists in base 2, since any nonrepunit prime contains at least one 0 digit in its base-2 representation that yields an even number and thus a composite when permuted to the least significant place, so the offset of the sequence is 3.
a(3)-a(6) were found via a brute-force approach searching from the largest prime with 12 base-n digits backwards. The number of base-n digits in a(n) for n = 3, 4, 5, 6 is 2, 5, 5, 3, respectively. Since this is much shorter than 12 digits, it is conjectured that the terms are the maximal circular primes for those bases. This also verifies that no circular primes with a length between A055642(a(n)) and 13 digits exist in bases 3, 4, 5 and 6.
Candidates for a(7), a(8) and a(9) are 13143449029, 16244441 and 4717103, respectively.
a(10) is probably 999331. If not, it must have more than 23 digits (cf. De Geest link).

Examples

			1013 written in base 4 is 33311. The base-4 numbers 33311, 33113, 31133, 11333, 13331 written in base 10 are 1013, 983, 863, 383 and 509, respectively. All those base-10 numbers are prime and since there is no larger prime up to 12 base-4 digits where all cyclic permutations of base-4 digits are primes, 1013 is conjectured to be the largest nonrepunit circular prime in base 4.
		

Crossrefs

Cf. base-b nonrepunit circular primes: A293657 (b=4), A293658 (b=5), A293659 (b=6), A293660 (b=7), A293661 (b=8), A293662 (b=9), A293663 (b=10).

Programs

  • PARI
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
    is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
    a(base, maxlength) = my(p=precprime(base^maxlength)); while(p > 2, if(vecmin(digits(p, base))!=vecmax(digits(p, base)), if(is_circularprime(p, base), return(p))); p=precprime(p-1))
    for(n=3, 6, print1(a(n, 12), ", ")) \\ start searching a(n) from largest prime with 12 base-n digits backwards

A293660 Base-7 circular primes that are not base-7 repunits.

Original entry on oeis.org

11, 13, 17, 19, 23, 29, 37, 41, 43, 47, 79, 89, 97, 109, 131, 211, 233, 257, 263, 281, 307, 337, 439, 479, 509, 571, 619, 673, 677, 853, 941, 953, 977, 997, 1021, 1097, 1117, 1163, 1171, 1453, 1511, 1531, 1579, 1597, 1657, 1777, 1787, 1811, 1871, 1933, 1951
Offset: 1

Views

Author

Felix Fröhlich, Dec 30 2017

Keywords

Comments

Conjecture: The sequence is finite, with 13143449029 being the last term. - [Comment extended by Felix Fröhlich, May 30 2019]

Examples

			109 written in base 7 is 214. The base-7 numbers 214, 142, 421 written in base 10 are 109, 79, 211, respectively, and all those numbers are prime, so 79, 109 and 211 are terms of the sequence.
		

Crossrefs

Cf. base-b nonrepunit circular primes: A293657 (b=4), A293658 (b=5), A293659 (b=6), A293661 (b=8), A293662 (b=9), A293663 (b=10).

Programs

  • Mathematica
    With[{b = 7}, Select[Prime@ Range[PrimePi@ b + 1, 300], Function[w, And[AllTrue[Array[FromDigits[RotateRight[w, #], b] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* Michael De Vlieger, Dec 30 2017 *)
  • PARI
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
    is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
    forprime(p=1, , if(vecmin(digits(p, 7))!=vecmax(digits(p, 7)), if(is_circularprime(p, 7), print1(p, ", "))))

A317716 Square array A(n, k), read by antidiagonals downwards: k-th prime p such that cyclic digit shifts produce exactly n different primes.

Original entry on oeis.org

2, 3, 13, 5, 17, 113, 7, 31, 131, 1193, 11, 37, 197, 1931, 11939, 19, 71, 199, 3119, 19391, 193939, 23, 73, 311, 3779, 19937, 199933, 17773937, 29, 79, 337, 7793, 37199, 319993, 39371777, 119139133, 41, 97, 373, 7937, 39119, 331999, 71777393, 133119139
Offset: 1

Views

Author

Felix Fröhlich, Aug 05 2018

Keywords

Comments

k-th prime p such that A262988(p) = n.
Are all rows of the array infinite?
A term q of A270083 occurs in row A055642(q) - 1 in this array.
A term r of A293663 occurs in row A055642(r) in this array.
Row 1 is a supersequence of A004022.
Column 1 is A247153.

Examples

			Array starts
          2,         3,         5,         7,        11,        19,        23, ...
         13,        17,        31,        37,        71,        73,        79, ...
        113,       131,       197,       199,       311,       337,       373, ...
       1193,      1931,      3119,      3779,      7793,      7937,      9311, ...
      11939,     19391,     19937,     37199,     39119,     71993,     91193, ...
     193939,    199933,    319993,    331999,    391939,    393919,    919393, ...
   17773937,  39371777,  71777393,  73937177,  77393717,  77739371,  93717773, ...
  119139133, 133119139, 139133119, 191391331, 311913913, 331191391, 913311913, ...
...
		

Crossrefs

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    count_primes(n) = my(d=digits(n), i=0); while(1, if(ispseudoprime(eva(d)), i++); d=rot(d); if(d==digits(n), return(i)))
    row(n, terms) = my(i=0); forprime(p=1, , if(count_primes(p)==n, print1(p, ", "); i++); if(i==terms, print(""); break))
    array(rows, cols) = for(x=1, rows, row(x, cols))
    array(7, 7) \\ print initial 7 rows and 7 columns of array

A016114 The smallest representative in a cycle of circular primes, where circular primes are numbers that remain prime under cyclic shifts of digits.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 37, 79, 113, 197, 199, 337, 1193, 3779, 11939, 19937, 193939, 199933, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

Keywords

Comments

The next repunit that is prime has 317 digits, all ones. See A004023. - Harvey P. Dale, Mar 22 2012
Only the smallest member of the cyclic shift is listed. See A068652 for all members. - Chai Wah Wu, Nov 09 2015
It is highly likely that all circular primes not on the list above are repunits (see Caldwell link). - Ray Chandler, May 04 2017
Circular primes are A068652 (numbers that remain prime under cyclic shifts of digits). - Tanya Khovanova, Jul 29 2024

Crossrefs

Sequence includes all prime repunits (A004023). Cf. A003459, A293663.
For a sequence listing all the prime-yielding cyclic permutations see A068652.

Programs

  • Mathematica
    circularPrimeQ[p_] := Module[{d = IntegerDigits[p], ps}, ps = Table[FromDigits[d = RotateLeft[d]], {Length[d]}]; If[p > Min[ps], False, And @@ PrimeQ[ps]]]; Select[Prime[Range[100000]], circularPrimeQ] (* T. D. Noe, Mar 22 2012 *)
    Union[Select[Union/@((FromDigits/@Table[RotateRight[IntegerDigits[#],n],{n,IntegerLength[ #]}])&/@Prime[Range[20000]]),AllTrue[#,PrimeQ]&]][[All,1]] (* The program generates the first 19 terms of the sequence. *) (* Harvey P. Dale, Nov 14 2022 *)

Extensions

One more term from Lekraj Beedassy, Nov 07 2002
Name edited by Tanya Khovanova, Jul 29 2024

A293657 Base-4 circular primes that are not base-4 repunits.

Original entry on oeis.org

7, 13, 23, 29, 53, 383, 509, 863, 983, 1013
Offset: 1

Views

Author

Felix Fröhlich, Oct 28 2017

Keywords

Comments

Conjecture: The sequence is finite, with 1013 being the last term (see A293142).
Written in base 4 (A007090), the terms are 13, 31, 113, 131, 311, 11333, 13331, 31133, 33113, 33311. - Antti Karttunen, Nov 26 2017
From Michael De Vlieger, Dec 30 2017: (Start)
The digits of primes in this sequence must be in the reduced residue system modulo 4, i.e., {1, 3}.
a(11), if it exists, must be larger than 4^21 = 4398046511104. (End)

Examples

			53 written in base 4 is 311. The base-4 numbers 311, 131, 113 written in base 10 are 53, 29, 23, respectively and all those numbers are prime, so 23, 29 and 53 are terms of the sequence.
		

Crossrefs

Cf. base-b nonrepunit circular primes: A293658 (b=5), A293659 (b=6), A293660 (b=7), A293661 (b=8), A293662 (b=9), A293663 (b=10).

Programs

  • Mathematica
    With[{b = 4}, Select[Array[Map[If[Union@ # == {1}, 0, FromDigits[#, b]] &, NestList[RotateLeft, #, Length@ # - 1]] &@ IntegerDigits[Prime@ #, b] &, 10^6, If[PrimeQ@ b, #, # + 1] &@ PrimePi@ b], AllTrue[#, PrimeQ] &][[All, 1]] ] (* Michael De Vlieger, Nov 26 2017 *)
    With[{b = 4}, Select[Flatten@ Array[FromDigits[#, b] & /@ Most@ Rest@ Tuples[{1, 3}, #] &, 18, 2], Function[w, And[ AllTrue[ Array[ FromDigits[ RotateRight[w, #], b] &, Length@ w], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* Michael De Vlieger, Dec 30 2017 *)
  • PARI
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
    is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
    forprime(p=1, , if(vecmin(digits(p, 4))!=vecmax(digits(p, 4)), if(is_circularprime(p, 4), print1(p, ", "))))

A293658 Base-5 circular primes that are not base-5 repunits.

Original entry on oeis.org

7, 11, 13, 17, 19, 23, 167, 211, 239, 283, 359, 431, 547, 571, 1069, 1249, 1733, 2221, 2417, 2713, 2749, 3049, 3109, 3121
Offset: 1

Views

Author

Felix Fröhlich, Oct 28 2017

Keywords

Comments

Conjecture: The sequence is finite, with 3121 being the last term (see A293142).
Written in base 5 (A007091), the terms are 12, 21, 23, 32, 34, 43, 1132, 1321, 1424, 2113, 2414, 3211, 4142, 4241, 13234, 14444, 23413, 32341, 34132, 41323, 41444, 44144, 44414, 44441. - Antti Karttunen, Nov 26 2017
a(25), if it exists, must be larger than prime(10^6) = 15485863, an 11-digit quinary number. - Michael De Vlieger, Nov 26 2017

Examples

			1069 written in base 5 is 13234. The base-5 numbers 13234, 32341, 23413, 34132, 41323 written in base 10 are 1069, 2221, 1733, 2417, 2713, respectively and all those numbers are prime, so 1069, 1733, 2221, 2417 and 2713 are terms of the sequence.
		

Crossrefs

Cf. base-b nonrepunit circular primes: A293657 (b=4), A293659 (b=6), A293660 (b=7), A293661 (b=8), A293662 (b=9), A293663 (b=10).

Programs

  • Mathematica
    Select[Array[Map[If[Union@ # == {1}, 0, FromDigits[#, 5]] &, NestList[RotateLeft, #, Length@ # - 1]] &@ IntegerDigits[Prime@ #, 5] &, 10^5, 4], AllTrue[#, PrimeQ] &][[All, 1]] (* Michael De Vlieger, Nov 26 2017 *)
  • PARI
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
    is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
    forprime(p=1, , if(vecmin(digits(p, 5))!=vecmax(digits(p, 5)), if(is_circularprime(p, 5), print1(p, ", "))))

A293659 Base-6 circular primes that are not base-6 repunits.

Original entry on oeis.org

11, 31, 71, 191, 211
Offset: 1

Views

Author

Felix Fröhlich, Oct 28 2017

Keywords

Comments

Conjecture: The sequence is finite, with 211 being the last term (see A293142).
Written in base 6 (A007092), the terms are 15, 51, 155, 515, 551. - Antti Karttunen, Nov 26 2017
From Michael De Vlieger, Dec 30 2017: (Start)
This sequence may be particularly constrained to few terms since only {1, 5} are coprime to 6, and any senary circular prime involves just these 2 senary digits. This is because all primes aside from {2, 3} are congruent to {1, 5} (mod 6). Since a senary number consisting of all 5's is divisible by 5 and since we have disqualified prime repunits, the sequence is probably finite.
a(6), if it exists, must be larger than 6^21 = 21936950640377856. (End)

Examples

			71 written in base 6 is 155. The base-6 numbers 155, 515, 551 written in base 10 are 71, 191, 211, respectively and all those numbers are prime, so 71, 191 and 211 are terms of the sequence.
		

Crossrefs

Cf. base-b nonrepunit circular primes: A293657 (b=4), A293658 (b=5), A293660 (b=7), A293661 (b=8), A293662 (b=9), A293663 (b=10).

Programs

  • Mathematica
    With[{b = 6}, Select[Prime@ Range[PrimePi@ b + 1, 10^6], Function[w, And[AllTrue[Array[FromDigits[RotateRight[w, #], b] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* or *)
    With[{b = 6}, Select[Flatten@ Array[FromDigits[#, 6] & /@ Most@ Rest@ Tuples[{1, 5}, #] &, 18, 2], Function[w, And[ AllTrue[ Array[ FromDigits[ RotateRight[w, #], b] &, Length@ w], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* Michael De Vlieger, Dec 30 2017 *)
  • PARI
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
    is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
    forprime(p=1, , if(vecmin(digits(p, 6))!=vecmax(digits(p, 6)), if(is_circularprime(p, 6), print1(p, ", "))))

A293661 Base-8 circular primes that are not base-8 repunits.

Original entry on oeis.org

13, 29, 31, 41, 43, 47, 59, 61, 607, 719, 751, 761, 971, 1021, 1657, 1759, 1787, 1913, 1993, 2011, 2687, 3019, 3659, 3673, 3677, 3803, 3919, 4073, 49103, 56299, 62207, 105341, 130681, 177007, 188249, 195277, 235513, 237151, 251501, 259019, 4127707, 6807419
Offset: 1

Views

Author

Felix Fröhlich, Dec 30 2017

Keywords

Comments

Conjecture: The sequence is finite.
From Michael De Vlieger, Dec 30 2017: (Start)
Primes in this sequence must only have odd digits.
There are 8 terms with 2 octal digits, 20 terms with 4 octal digits, 12 terms with 6 octal digits, and 8 terms with 8 octal digits.
a(49), if it exists, must be larger than 8^12 = 68719476736. (End)

Examples

			607 written in base 8 is 1137. The base-8 numbers 1137, 1371, 3711, 7113 written in base 10 are 607, 761, 1993, 3659, respectively, and all those numbers are prime, so 607, 761, 1993 and 3659 are terms of the sequence.
		

Crossrefs

Cf. base-b nonrepunit circular primes: A293657 (b=4), A293658 (b=5), A293659 (b=6), A293660 (b=7), A293662 (b=9), A293663 (b=10).

Programs

  • Mathematica
    With[{b = 8}, Select[Prime@ Range[PrimePi@ b + 1, 10^6], Function[w, And[AllTrue[Array[FromDigits[RotateRight[w, #], b] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* or *)
    With[{b = 8}, Select[Flatten@ Array[FromDigits[#, b] & /@ Most@ Rest@ Tuples[Range[1, 7, 2], #] &, 6, 2], Function[w, And[ AllTrue[ Array[ FromDigits[ RotateRight[w, #], b] &, Length@ w], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* Michael De Vlieger, Dec 30 2017 *)
  • PARI
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
    is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
    forprime(p=1, , if(vecmin(digits(p, 8))!=vecmax(digits(p, 8)), if(is_circularprime(p, 8), print1(p, ", "))))

A293662 Base-9 circular primes that are not base-9 repunits.

Original entry on oeis.org

11, 13, 17, 19, 23, 37, 43, 47, 67, 71, 73, 79, 101, 149, 173, 181, 211, 233, 347, 421, 443, 613, 641, 647, 673, 719, 727, 971, 1123, 1361, 1429, 1609, 1697, 2153, 2179, 3371, 3547, 3833, 4019, 4091, 4099, 4229, 5227, 5261, 5281, 5683, 5689, 5741, 5749, 5821
Offset: 1

Views

Author

Felix Fröhlich, Dec 30 2017

Keywords

Comments

Conjecture: The sequence is finite.

Examples

			101 written in base 9 is 122. The base-9 numbers 122, 221, 212 written in base 10 are 101, 181, 173, respectively and all those numbers are prime, so 101, 173 and 181 are terms of the sequence.
		

Crossrefs

Cf. base-b nonrepunit circular primes: A293657 (b=4), A293658 (b=5), A293659 (b=6), A293660 (b=7), A293661 (b=8), A293663 (b=10).

Programs

  • Mathematica
    With[{b = 9}, Select[Prime@ Range[PrimePi@ b + 1, 10^3], Function[w, And[AllTrue[Array[FromDigits[RotateRight[w, #], b] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* Michael De Vlieger, Dec 30 2017 *)
  • PARI
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
    is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
    forprime(p=1, , if(vecmin(digits(p, 9))!=vecmax(digits(p, 9)), if(is_circularprime(p, 9), print1(p, ", "))))

A317688 Absolute primes that are not repunits: primes where the number resulting from any permutation of the digits is also prime, excluding repunit primes.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 199, 311, 337, 373, 733, 919, 991
Offset: 1

Views

Author

Felix Fröhlich, Aug 04 2018

Keywords

Comments

Any term with two or more digits contains exactly two different digits from the set {1, 3, 7, 9} (cf. Erdős et al., 1977, Solution 953).
Conjecture: The sequence is finite, with 991 being the last term.
The known terms are those terms of A293663 where membership in A293663 trivially implies membership in this sequence, i.e., the numbers resulting from all cyclic permutations of the digits of these terms are the same as the numbers resulting from all permutations of the digits of these terms. This is the case only for terms with less than four digits.

Examples

			The other numbers resulting from all possible permutations of the digits of 113 are 131 and 311. 113, 131 and 311 are all primes, so all three numbers are terms of this sequence.
		

Crossrefs

Relative complement of A004022 in A003459. Supersequence of A129338. Subsequence of A293663.

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    find_index_a(vec) = my(r=#vec-1); while(1, if(vec[r] < vec[r+1], return(r)); r--; if(r==0, return(-1)))
    find_index_b(r, vec) = my(s=#vec); while(1, if(vec[r] < vec[s], return(s)); s--; if(s==r, return(-1)))
    switch_elements(vec, firstpos, secondpos) = my(g); g=vec[secondpos]; vec[secondpos]=vec[firstpos]; vec[firstpos] = g; vec
    reverse_order(vec, r) = my(v=[], w=[]); for(x=1, r, v=concat(v, vec[x])); for(y=r+1, #vec, w=concat(w, vec[y])); w=Vecrev(w); concat(v, w)
    next_permutation(vec) = my(r=find_index_a(vec)); if(r==-1, return(0), my(s=find_index_b(r, vec)); vec=switch_elements(vec, r, s); vec=reverse_order(vec, r)); vec
    is(n) = if(n < 10, return(1)); my(d=vecsort(digits(n))); if(vecmin(d)==0 || vecmax(d)==1, return(0)); while(1, if(!ispseudoprime(eva(d)), return(0)); d=next_permutation(d); if(d==0, return(1)))
    forprime(p=1, , if(is(p), print1(p, ", ")))
Showing 1-10 of 12 results. Next