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.

Previous Showing 21-30 of 49 results. Next

A376502 Primes that contain at least two different even digits and at least two different odd digits where any permutation of the odd digits and any permutation of the even digits produces a prime. See comments for the treatment of 0s.

Original entry on oeis.org

1249, 1429, 1487, 1847, 2617, 2671, 4019, 4091, 6217, 6271, 6389, 6709, 6907, 6983, 7481, 7841, 8369, 8963, 9241, 9421, 60337, 60373, 60733
Offset: 1

Views

Author

Enrique Navarrete, Sep 25 2024

Keywords

Comments

Primes for which permutations described in the name produce primes with leading 0s are in the sequence but the generated primes with leading 0s are not. For example, in 6709: permutations of odd digits produce 6907, permutations of even digits produce 769, and permutations of even digits and of odd digits produce 967. Hence 6709 and 6907 are in the sequence but 769 and 967 are not since they have leading 0s.
The primes in the sequence cannot contain 5.
No further terms up to 10^10. - Robert Israel, Sep 25 2024

Examples

			1249 is in the sequence since the permutations described in the name produce 9241, 1429 and 9421, which are also prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,Ev,Od,Le,Lo,i,x;
      if not isprime(n) then return false fi;
      L:= convert(n,base,10);
      Ev,Od:= selectremove(t -> L[t]::even,[$1..nops(L)]);
      if nops(convert(L[Ev],set)) < 2 or nops(convert(L[Od],set)) < 2 then return false fi;
      for Le in combinat:-permute(L[Ev]) do
        for Lo in combinat:-permute(L[Od]) do
          x:= add(Le[i]*10^(Ev[i]-1),i=1..nops(Ev)) + add(Lo[i]*10^(Od[i]-1),i=1..nops(Od));
          if not isprime(x) then return false fi
      od od;
      true
    end proc:
    select(filter, [$1000 .. 10^5]); # Robert Israel, Sep 25 2024

Extensions

a(21) to a(23) from Robert Israel, Sep 25 2024

A085299 a(n) is the smallest number x such that A085298[x]=n, or 0 if no such number exists.

Original entry on oeis.org

1, 8, 47, 18, 14, 89, 10, 9, 48, 16, 23, 17, 168, 268, 15, 661, 50, 380, 84, 116, 360, 245, 29, 144, 345, 227, 785, 261, 148, 235, 691, 658, 638, 40, 1023, 674, 1529, 210, 19, 81, 181, 428, 170, 1130, 2322, 406, 600, 373, 958, 217
Offset: 1

Views

Author

Labos Elemer, Jun 24 2003

Keywords

Examples

			a(13) = 168 means that 13 is the smallest exponent such that reversed[p(168)^13] = reversed[997^13] = 776831144302925059735912605306533496169
is prime if read in this direction and 13th prime-power if read backwards.
		

Crossrefs

A086150 Number of permutations of decimal digits of n which yield nonprime numbers.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 1, 1, 2, 0, 2, 0, 1, 2, 1, 0, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 1, 1, 0, 1, 1, 1, 1, 2, 0, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 0, 2, 0, 1, 2, 1, 1, 2, 0, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 0, 1, 1, 3, 1, 6, 3, 4, 6
Offset: 1

Views

Author

Labos Elemer, Aug 04 2003

Keywords

Comments

From Robert Israel, Aug 13 2017: (Start)
Leading zeros are allowed.
a(n) = 0 for n in A003459. (End)

Examples

			n=117, digit-permutations={117,171,711} are all composites, so a(117)=3.
		

Crossrefs

Programs

  • Maple
    f:= proc(L) option remember;
      nops(remove(isprime, map(t -> add(t[i]*10^(i-1),i=1..nops(t)), combinat:-permute(L))))
    end proc:
    seq(f(sort(convert(n,base,10))),n=1..200); # Robert Israel, Aug 13 2017
  • Mathematica
    nd[x_, y_] := 10*x+y tn[x_] := Fold[nd, 0, x] Table[Count[Table[PrimeQ[tn[Part[Permutations[ IntegerDigits[w]], j]]], {j, 1, Length[Permutations[ IntegerDigits[w]]]}], False], {w, 1, 128}]
    Table[Count[FromDigits/@Permutations[IntegerDigits[n]],?(!PrimeQ[#]&)],{n,110}] (* _Harvey P. Dale, Dec 24 2016 *)

Formula

a(n) + A039999(n) = A047726(n). - Robert Israel, Aug 13 2017

A086402 Nontrivial numbers which are prime and yield another prime when their digits are sorted in descending order.

Original entry on oeis.org

13, 17, 37, 79, 113, 131, 149, 157, 163, 167, 179, 181, 191, 197, 199, 241, 251, 281, 313, 337, 347, 359, 373, 389, 419, 461, 463, 491, 563, 571, 593, 613, 617, 683, 719, 787, 797, 839, 919, 1163, 1181, 1193, 1217, 1223, 1229, 1237, 1249, 1259, 1279, 1297
Offset: 1

Views

Author

Chuck Seggelin, Jul 07 2003

Keywords

Comments

Primes with digits already in descending order (like 311 and 3221) are trivial cases and are therefore excluded.

Examples

			a(1)=13 because a descending sort of 13's digits yields 31 which is also prime. a(100)=2411 because a descending sort of 2411's digits yields 4211 which is also prime.
		

Crossrefs

Cf. A003459.

Programs

  • Mathematica
    pdsdQ[p_]:=With[{d=FromDigits[ReverseSort[IntegerDigits[p]]]},d!=p&&PrimeQ[d]]; Select[Prime[Range[250]],pdsdQ] (* Harvey P. Dale, Oct 03 2024 *)

A091897 Numbers that remain prime or composite for all permutations of their digits.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 17, 18, 21, 22, 24, 25, 26, 27, 28, 31, 33, 36, 37, 39, 40, 42, 44, 45, 46, 48, 49, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 71, 72, 73, 75, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88, 90, 93, 94, 96, 97, 99, 102, 105
Offset: 1

Views

Author

Rick L. Shepherd, Feb 09 2004

Keywords

Comments

Union of A003459 and A067012. The repdigit numbers (A010785) > 1 are also clearly a subsequence.

Crossrefs

Cf. A003459 (absolute primes), A067012 ('absolute composites'), A091898 (complement of A091897), A010785 (repdigit numbers).

A125268 Numbers that end with decimal digit 1, 3, 7, or 9 and that produce only composite numbers when any of the digits 0,1,...,9 is inserted anywhere in them (including at the beginning or end).

Original entry on oeis.org

25011, 52647, 72753, 122313, 168699, 283251, 324021, 598041, 783441, 804131, 837207, 924807, 1247241, 1905759, 2514819, 3461101, 3514077, 3617389, 3905817, 4112913, 4142139, 4203151, 4229871, 4283679, 4531907, 4628827, 4828443, 5380413, 5478091, 5632671, 5714889, 5818569, 5989269, 5990961
Offset: 1

Views

Author

I. J. Kennedy, Jan 15 2007

Keywords

Comments

Since digit 0 can be inserted at the beginning of a term, each term must be composite.

Crossrefs

Programs

  • Maple
    filter:= proc(n) local x,y,d,t;
      x:= n; y:= 0;
      for d from 0 to ilog10(n)+1 do
         for t from 0 to 9 do
           if isprime(10^(d+1)*x+10^d*t + y) then return false fi;
         od;
         t:= x mod 10;
         y:= y + 10^d*t;
         x:= (x-t)/10;
      od;
      true
    end proc:
    select(filter, [seq(seq(10*i+j,j=[1,3,7,9]),i=0..10^6)]); # Robert Israel, Sep 12 2016
  • PARI
    { printA125268(U=8) = my(v,t); v=vector(10^U); forprime(p=11,10^(U+1), if(p<=U,v[p]=p); for(i=1,#Str(p), t=(p\10^i) * 10^(i-1) + (p%10^(i-1)); if(#Str(t)==#Str(p)-1,v[t]=p););); forstep(n=1,10^U,2, if(n%10==5||v[n],next); print1(n,", ");); } \\ prints terms below 10^U, by Max Alekseyev, Sep 12 2016

Extensions

Corrected and extended by Robert G. Wilson v, Jan 26 2007
Removed incorrect terms and extended by Max Alekseyev, Sep 12 2016

A211655 Down-sortable primes: Primes that are also primes after digits are sorted into decreasing order.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 37, 41, 43, 53, 61, 71, 73, 79, 83, 97, 113, 131, 149, 157, 163, 167, 179, 181, 191, 197, 199, 211, 241, 251, 281, 311, 313, 331, 337, 347, 359, 373, 389, 419, 421, 431, 433, 443, 461, 463, 491, 521, 541, 563, 571, 593, 613, 617, 631, 641, 643, 653
Offset: 1

Views

Author

Francis J. McDonnell, Apr 17 2012

Keywords

Comments

All 1- and 2-digit reversible primes (A007500) are trivially in this sequence. No primes from A056709 are in this sequence. Clearly all absolute primes (A003459) are sortable primes but not all sortable primes are absolute primes. - Alonso del Arte, Oct 08 2013

Examples

			131 is prime and after sorting its digits into nonincreasing order we obtain 311, which is prime.
163 is in the sequence because its digits sorted in decreasing order give 631, which is prime. (Note that this is not a reversible prime, since 361 = 19^2.)
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]], PrimeQ[FromDigits[-Sort[-IntegerDigits[#]]]] &] (* T. D. Noe, Apr 17 2012 *)

A258778 Least base b >= 2 such that prime(n) is an absolute prime in base b.

Original entry on oeis.org

3, 2, 3, 2, 5, 3, 5, 5, 4, 4, 2, 7, 7, 6, 7, 4, 8, 8, 9, 6, 8, 9, 11, 7, 7, 9, 11, 11, 13, 10, 2, 10, 12, 11, 13, 17, 12, 11, 12, 9, 16, 9, 6, 13, 15, 10, 6, 11, 19, 12, 19, 13, 11, 16, 7, 17, 19, 19, 12, 7, 16, 19, 7, 10, 13, 19, 22, 7, 19, 19, 18, 18, 21, 10
Offset: 1

Views

Author

Chai Wah Wu, Jun 11 2015

Keywords

Comments

a(n) < prime(n) for n > 1. This is true since prime(n) in base prime(n)-1 is written as 11 which is an absolute prime.
Conjecture: a(n) < prime(n)-1 for n > 2.

Examples

			a(78) = 13. prime(78) = 397 in base 10 and 397_10 = 247_13. Rearranging the digits in base 13, we get 274_13 = 433_10, 427_13 = 709_10, 472_13 = 769_10, 724_13 = 1213_10, 742_13 = 1237_10, all of which are prime.
		

Crossrefs

A258802 Least base b >= 2 such that prime(n) is an absolute prime in base b with at least 2 distinct digits or 0 if no such base exists.

Original entry on oeis.org

0, 0, 3, 3, 5, 4, 5, 5, 4, 4, 6, 7, 7, 7, 7, 4, 8, 8, 9, 6, 9, 9, 11, 7, 7, 9, 11, 11, 13, 10, 13, 10, 12, 11, 13, 17, 14, 11, 12, 9, 16, 9, 6, 13, 15, 10, 6, 11, 19, 12, 19, 13, 11, 16, 7, 17, 19, 19, 12, 7, 16, 19, 7, 10, 13, 19, 22, 7, 19, 19, 18, 18, 21, 10
Offset: 1

Views

Author

Chai Wah Wu, Jun 11 2015

Keywords

Comments

a(n) < prime(n)-1. This is true since prime(n) in base b > prime(n) has a single digit, prime(n) in base prime(n) is written as 10 which is not an absolute prime and prime(n) in base prime(n)-1 is written as 11 which does not have 2 distinct digits.
For 1 <= n <= 10000, A258778 differs from A258802 for 50 values of n.
Conjecture: a(n) = 0 if and only if n=1 or n=2.

Examples

			See example in A258778.
		

Crossrefs

A268812 Absolute primes in base 16: every permutation of digits in base 16 is a prime (only the smallest representatives of the permutation classes are shown).

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 23, 31, 53, 59, 61, 89, 191, 277, 283, 887, 1373, 1979, 3037
Offset: 1

Views

Author

Chai Wah Wu, Apr 20 2016

Keywords

Comments

Base 16 analog of A258706.

Crossrefs

Previous Showing 21-30 of 49 results. Next