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 119 results. Next

A055387 2, 3, 5, 7, together with primes such that there is a nontrivial rearrangement of the digits which is a prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 31, 37, 71, 73, 79, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 239, 241, 251, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 359, 367, 373, 379, 389, 397, 401, 419, 421
Offset: 1

Views

Author

Asher Auel, May 05 2000

Keywords

Comments

Union of {2, 3, 5, 7} and A225035.

Crossrefs

Extensions

Edited by N. J. A. Sloane, Jan 22 2023

A065074 Near-repunit primes that contain the digit 0.

Original entry on oeis.org

101, 10111, 101111, 11110111, 11111101, 101111111, 101111111111, 111011111111, 111111011111, 111111110111, 111111111101, 11111111101111111, 11111111111111101, 101111111111111111, 111110111111111111, 111111101111111111, 111111111111011111, 111111111111111011
Offset: 1

Views

Author

Robert G. Wilson v, Nov 19 2001

Keywords

Crossrefs

Programs

  • Maple
    N:= 20: # to get all terms of up to N digits
    A:= select(isprime,[seq(seq((10^n-1)/9 - 10^j,j=n-2..1,-1),n=3..N)]); # Robert Israel, Jun 23 2015
  • Mathematica
    f[n_] := Block[{lst = {}, r = (10^(n - 1) - 1)/9}, AppendTo[ lst, Select[ FromDigits[ Permutations[ Append[ IntegerDigits@ r, 0]]], PrimeQ@# && # > 100 &]]; Union@ Flatten@ lst]; Array[f, 18] // Flatten (* Robert G. Wilson v, Jun 22 2015 *)

Extensions

Name changed by Arkadiusz Wesolowski, Sep 23 2011

A107694 Primes with digital product = 8.

Original entry on oeis.org

181, 241, 421, 811, 1181, 1811, 2141, 2221, 2411, 4211, 8111, 21221, 141121, 142111, 411211, 1111181, 1112141, 1121221, 1211141, 1211411, 1212121, 2111411, 2121121, 2211211, 2221111, 2411111, 4121111, 4211111, 11221211, 12111221, 12121121
Offset: 1

Views

Author

Zak Seidov and Robert G. Wilson v, May 20 2005

Keywords

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(3*10^7) | &*Intseq(p) eq 8]; // Vincenzo Librandi, Jul 27 2016
  • Mathematica
    Union[ Flatten[ Table[ Select[ Sort[ FromDigits /@ Join[ Permutations[ Flatten[{8, Table[1, {n}]}]], Permutations[ Flatten[{2, 4, Table[1, {n - 1}]}]], Permutations[ Flatten[{2, 2, 2, Table[1, {n - 2}]}] ]]], PrimeQ[ # ] & ], {n, 0, 7}]]]
    Select[Prime[Range[3 10^6]], Times@@IntegerDigits[#] == 8 &] (* Vincenzo Librandi, Jul 27 2016 *)

A107697 Primes with digital product = 12.

Original entry on oeis.org

43, 223, 431, 1223, 1621, 2161, 2213, 3221, 6121, 6211, 11261, 11621, 12161, 12611, 13411, 21611, 26111, 41113, 41131, 61121, 61211, 111143, 111341, 111431, 112213, 114113, 114311, 121123, 121321, 122131, 123121, 131221, 141131, 141311, 143111
Offset: 1

Views

Author

Zak Seidov and Robert G. Wilson v, May 20 2005

Keywords

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(1000000) | &*Intseq(p) eq 12]; // Vincenzo Librandi, Jul 27 2016
  • Mathematica
    Union[ Flatten[ Table[ Select[ Sort[ FromDigits /@ Join[ Permutations[ Flatten[{2, 6, Table[1, {n - 1}]}]], Permutations[ Flatten[{3, 4, Table[1, {n - 1}]}]], Permutations[ Flatten[{2, 2, 3, Table[1, {n - 2}]}] ]]], PrimeQ[ # ] & ], {n, 0, 5}]]]
    Select[Prime[Range[75000]], Times@@IntegerDigits[#] == 12 &] (* Vincenzo Librandi, Jul 27 2016 *)

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

A030291 Primes with at most two different digits.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 113, 131, 151, 181, 191, 199, 211, 223, 227, 229, 233, 277, 311, 313, 331, 337, 353, 373, 383, 433, 443, 449, 499, 557, 577, 599, 661, 677, 727, 733
Offset: 1

Views

Author

Keywords

Comments

The one-digit primes (2, 3, 5, 7) followed by the union of A004022 and A235154. - Jeppe Stig Nielsen, Feb 17 2021

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], PrimeQ[#] && Length[Union[RealDigits[#][[1]]]] <= 2 &]
    Select[Prime[Range[200]],Count[DigitCount[#],0]>7&] (* Harvey P. Dale, Jul 14 2017 *)

Extensions

Offset corrected by Arkadiusz Wesolowski, Sep 13 2011

A034895 Dropping any digit gives a prime number.

Original entry on oeis.org

22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 111, 113, 117, 119, 131, 137, 171, 173, 179, 197, 311, 317, 371, 411, 413, 417, 431, 437, 471, 473, 611, 617, 671, 711, 713, 719, 731, 1013, 1031, 1037, 1073, 1079, 1097, 1379, 1397, 1499, 1673
Offset: 1

Views

Author

Keywords

Comments

The prime terms are in A051362.
The number of terms < 10^n: 0, 16, 43, 101, 159, 267, 350, 476, 582, 751, ..., . - Robert G. Wilson v, Oct 09 2014
Includes 10*x+1 for x in A004022. - Robert Israel, Jan 14 2016

Examples

			1379 is in the sequence since 379, 179, 139 & 137 are all primes. - _Robert G. Wilson v_, Oct 07 2014
		

Crossrefs

Cf. A267413.

Programs

  • Mathematica
    fQ[n_] := Union[ PrimeQ[ Table[ Quotient[n, 10^k]*10^(k - 1) + Mod[n, 10^(k - 1)], {k, 1 + Floor@ Log10@ n}] ]] == {True}; Select[ Range@ 1675, fQ] (* Robert G. Wilson v, Oct 07 2014 *)
    ddpnQ[n_]:=With[{id=IntegerDigits[n]},AllTrue[Table[FromDigits[Drop[id,{i}]],{i,Length[id]}],PrimeQ]]; Select[Range[2000],ddpnQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 12 2017 *)
  • PARI
    isok(n) = {d = digits(n); for (i=1, #d, nd = []; for (k=1, #d, if (k != i, nd = concat(nd, d[k]));); if (! isprime(subst(Pol(nd), x, 10)), return (0));); return (1);} \\ Michel Marcus, Jul 17 2014
    
  • PARI
    DroppingAnyDigitGivesAPrime(N,b) = {
    \\ Property-testing function; returns 1 if true for N, 0 otherwise
    \\ Works with any base b. Here usable with b=10.
      my(k=b,m); if(N=(k\b), m=(N\k)*(k\b)+(N%(k\b));
        if ((m<2)||(!isprime(m)),return(0)); k*=b);
      return(1);
    } \\ Stanislav Sykora, Jan 14 2016
    
  • Python
    from sympy import isprime
    def is_A034895(n):
        s = str(n)
        return n>9 and all(isprime(int(s[:i]+s[i+1:])) for i in range(len(s)))
    # David Radcliffe, Dec 11 2017

A258706 Absolute primes: every permutation of digits is a prime. Only the smallest representative of each permutation class is shown.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 37, 79, 113, 199, 337, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

N. J. A. Sloane, Jun 09 2015

Keywords

Comments

See the main entry, A003459, for further information and references cited below.
The next terms are the repunit primes (A004023) R(317), too large to be displayed here, and R(1031), too large even for a b-file. Johnson (1977) proves that subsequent terms must be of the form a*R(n) + b*10^k, with a and a+b in {1..9}, k < n, and n > 9*10^9 if b != 0. - M. F. Hasler, Jun 26 2018

Crossrefs

Cf. A003459, A004023, A004022 (subsequence of repunit primes).

Programs

  • Haskell
    import Data.List (permutations, (\\))
    a258706 n = a258706_list !! (n-1)
    a258706_list = f a000040_list where
       f ps'@(p:ps) | any (== 0) (map a010051' dps) = f ps
                    | otherwise = p : f (ps' \\ dps)
                    where dps = map read $ permutations $ show p
    -- Reinhard Zumkeller, Jun 10 2015
    
  • Mathematica
    Flatten@{2, 3, 5, 7,
      Table[Select[
        Table @@
          Prepend[Prepend[
            Table[{A@k, A[k - 1], 4}, {k, 2, n}], {A[1], 4}],
           Unevaluated[
            Unevaluated[FromDigits[{1, 3, 7, 9}[[A /@ Range[n]]]]]]] //
         Flatten,
        Function[L,
           And[PrimeQ[#],
            And @@ PrimeQ[
              FromDigits /@ (Permute[L, #] & /@
                 RandomPermutation[Length@L, 5])],
            And @@ PrimeQ[FromDigits /@ Rest[Permutations[L]]]]]@
          IntegerDigits@# &], {n, 2, 33}]}
    (* Exhaustively searches thru 33 digits in ~7.5 sec, and up to 69 digits in 5 min, but cannot reach 317 digits. Not helpful in the light of Schroeppel's theorem that it's all repunits past 991. - Bill Gosper, Jan 06 2017 *)
  • PARI
    {A=[2,5]; for(n=1, 317, my(D=[1,3,7,9], r=10^n\9); for(a=1,4, for(b=a^(n<3),4, for(j=0, if(b!=a,n-1), ispseudoprime(D[a]*r+(D[b]-D[a])*10^j)||next(2)); A=setunion(A, [r*D[a]+(D[b]-D[a])*10^if(b=n[1] && #select(d->d,n[^1]-n[^-1])<2 && !for(i=1,(#n)^(n[#n]>1), isprime(fromdigits(n=concat(n[^1],n[1])))||return)} \\ By Johnson's theorem and minimality required here, the number must be of the form ab...b or a...ab (=> first difference of digits has at most 1 nonzero component) and then is sufficient to consider rotations of the digits.
    \\ M. F. Hasler, Jun 26 2018

A039986 Primes such that every distinct permutation of digits is composite (including permutations with leading zeros).

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

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
Up through 9999991 (the largest 7-digit prime) there are no terms with more than 4 distinct digits. - Harvey P. Dale, Dec 12 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

Crossrefs

Cf. A225421 (only odd digits).
Cf. A244529 for another variant. - M. F. Hasler, Jun 28 2018

Programs

  • 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 *)
  • 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; iM. F. Hasler, Jul 01 2018
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    from sympy.utilities.iterables import multiset_permutations
    from sympy import isprime
    def A039986_gen(): # generator of terms
        for l in count(1):
            xlist = []
            for p in combinations_with_replacement('0123456789',l):
                flag = False
                for q in multiset_permutations(p):
                    if isprime(m:=int(''.join(q))):
                        if flag or q[0]=='0':
                            flag = False
                            break
                        else:
                            flag = True
                            r = m
                if flag:
                    xlist.append(r)
            yield from sorted(xlist)
    A039986_list = list(islice(A039986_gen(),30)) # Chai Wah Wu, Dec 26 2023

Extensions

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

A260224 Primes having only {1, 3, 5} as digits.

Original entry on oeis.org

3, 5, 11, 13, 31, 53, 113, 131, 151, 311, 313, 331, 353, 1151, 1153, 1511, 1531, 1553, 3313, 3331, 3511, 3533, 5113, 5153, 5333, 5351, 5531, 11113, 11131, 11311, 11351, 11353, 11551, 13151, 13313, 13331, 13513, 13553, 15131, 15313, 15331, 15511, 15551
Offset: 1

Views

Author

Vincenzo Librandi, Jul 21 2015

Keywords

Crossrefs

Subsequence of A030096. A004022, A020451, A020453, and A020462 are subsequences.
Cf. similar sequences listed in A260223.

Programs

  • Magma
    [p: p in PrimesUpTo(40000) | Set(Intseq(p)) subset [3, 5, 1]];
    
  • Mathematica
    Select[Prime[Range[3 10^3]], Complement[IntegerDigits[#], {3, 5, 1}]=={} &]
    Select[Flatten[Table[FromDigits/@Tuples[{1,3,5},n],{n,5}]],PrimeQ] (* Harvey P. Dale, Mar 03 2020 *)
  • Python
    from gmpy2 import is_prime, mpz
    from itertools import product
    A260224_list = [int(''.join(x)) for n in range(1,10) for x in product('135',repeat=n) if is_prime(mpz(''.join(x)))] # Chai Wah Wu, Jul 21 2015
Previous Showing 21-30 of 119 results. Next