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

A090726 Duplicate of A036953.

Original entry on oeis.org

2, 11, 101, 211, 1021, 1201, 2011, 2111, 2221, 10111, 10211, 12011, 12101, 12211
Offset: 1

Views

Author

Keywords

A020449 Primes whose greatest digit is 1.

Original entry on oeis.org

11, 101, 10111, 101111, 1011001, 1100101, 10010101, 10011101, 10100011, 10101101, 10110011, 10111001, 11000111, 11100101, 11110111, 11111101, 100100111, 100111001, 101001001, 101001011, 101100011, 101101111, 101111011, 101111111
Offset: 1

Views

Author

Keywords

Comments

Primes which are the sums of distinct powers of 10. - Amarnath Murthy, Nov 19 2002
Subsequence of A007088. - Michel Marcus, Dec 18 2015
These numbers are called Anti-Yarborough prime numbers in the Prime Glossary. - Randy L. Ekl, Jan 19 2019

Crossrefs

Subsequence of A036953.

Programs

  • Magma
    [p: p in PrimesUpTo(101111111) | Set(Intseq(p)) subset [0,1]]; // Vincenzo Librandi, Jul 27 2012
    
  • Maple
    N:= 10: # to get all entries with <= N digits
    S:= {}:
    for d from 1 to N-1 do
      S:= S union select(isprime,map(`+`,map(convert,combinat[powerset]({seq(10^i,i=0..d-1)}),`+`),10^d));
    od:
    S; # if using Maple 11 or earlier, uncomment the next line
    # sort(convert(%,list)); # Robert Israel, May 04 2015
  • Mathematica
    Select[FromDigits/@Tuples[{0,1},16],PrimeQ] (* Hans Havermann, May 12 2025 *)
  • PARI
    is(n)=isprime(n)&&vecmax(digits(n))==1 \\ Charles R Greathouse IV, Jul 01 2013
    
  • Python
    from sympy import isprime
    A020449_list = [n for n in (int(format(m,'b')) for m in range(1,2**10)) if isprime(n)] # Chai Wah Wu, Dec 17 2015

A004022 Primes of the form (10^k - 1)/9. Also called repunit primes or repdigit primes.

Original entry on oeis.org

11, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

Keywords

Comments

The next term corresponds to k = 317 and is too large to include: see A004023.
Also called repunit primes or prime repunits.
Also, primes with digital product = 1.
The number of 1's in these repunits must also be prime. Since the number of 1's in (10^k-1)/9 is k, if k = p*m then (10^(p*m)-1) = (10^p)^m-1 => (10^p-1)/9 = q and q divides (10^k-1). This follows from the identity a^k - b^k = (a-b)*(a^(k-1) + a^(k-2)*b + ... + b^(k-1)). - Cino Hilliard, Dec 23 2008
A subset of A020449, ..., A020457, A036953, ..., cf. link to OEIS index. - M. F. Hasler, Jul 27 2015
The terms in this sequence, except 11 which is not Brazilian, are prime repunits in base ten, so they are Brazilian primes belonging to A085104 and A285017. - Bernard Schott, Apr 08 2017

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 11. Graham, Knuth and Patashnik, Concrete mathematics, Addison-Wesley, 1994; see p. 146, problem 22.
  • M. Barsanti, R. Dvornicich, M. Forti, T. Franzoni, M. Gobbino, S. Mortola, L. Pernazza and R. Romito, Il Fibonacci N. 8 (included in Il Fibonacci, Unione Matematica Italiana, 2011), 2004, Problem 8.10.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 114.

Crossrefs

Subsequence of A020449.
A116692 is another version of repunit primes or repdigit primes. - N. J. A. Sloane, Jan 22 2023
See A004023 for the number of 1's.
Cf. A046413.

Programs

  • Magma
    [a: n in [0..300] | IsPrime(a) where a is (10^n - 1) div 9 ]; // Vincenzo Librandi, Nov 08 2014
    
  • Mathematica
    lst={}; Do[If[PrimeQ[p = (10^n - 1)/9], AppendTo[lst, p]], {n, 10^2}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 22 2008 *)
    Select[Table[(10^n - 1) / 9, {n, 500}], PrimeQ] (* Vincenzo Librandi, Nov 08 2014 *)
    Select[Table[FromDigits[PadRight[{},n,1]],{n,30}],PrimeQ] (* Harvey P. Dale, Apr 07 2018 *)
  • PARI
    forprime(x=2,20000,if(ispseudoprime((10^x-1)/9),print1((10^x-1)/9","))) \\ Cino Hilliard, Dec 23 2008
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        yield from (t for t in (int("1"*k) for k in count(1)) if isprime(t))
    print(list(islice(agen(), 4))) # Michael S. Branicky, Jun 09 2022

Formula

a(n) = A002275(A004023(n)).

Extensions

Edited by Max Alekseyev, Nov 15 2010
Name expanded by N. J. A. Sloane, Jan 22 2023

A036952 Numbers whose binary expansion is a decimal prime.

Original entry on oeis.org

3, 5, 23, 47, 89, 101, 149, 157, 163, 173, 179, 185, 199, 229, 247, 253, 295, 313, 329, 331, 355, 367, 379, 383, 405, 425, 443, 453, 457, 471, 523, 533, 539, 565, 583, 587, 595, 631, 643, 647, 653, 659, 671, 675, 689, 703, 709, 755, 781, 785, 815, 841, 855
Offset: 1

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

A100051(f(a(n))) = 1 with f(x) = if x<2 then x else 10*f(floor(x/2)) + x mod 2. - Reinhard Zumkeller, Mar 31 2010
Primes in A007088. - N. J. A. Sloane, Feb 17 2023

Examples

			1 = 1_2 is not a prime.
2 = 10_2 is not OK because 10 = 2*5 is not a prime.
3 = 11_2 is OK because 11 is a prime.
4 = 100_2 is not OK because 100 = 4*25 is not a prime.
5 = 101_2 is OK because 101 is a prime.
7 = 111_2 is not OK because 111 = 3*37.
11 = 1011_2 is not OK because 1011 = 3*337.
313 = 100111001_2 is OK because 100111001 is prime.
		

Crossrefs

Programs

  • Maple
    A007088 := proc(n)
    dgs := convert(n,base,2) ;
    add(op(i,dgs)*10^(i-1),i=1..nops(dgs)) ;
    end proc:
    isA036952 := proc(n)
    isprime( A007088(n)) :
    end proc:
    A036952 := proc(n)
    if n =1 then
    3;
    else
    for a from procname(n-1)+1 do
    if isA036952(a) then
    return a ;
    end if;
    end do:
    end if;
    end proc:
    seq(A036952(n),n=1..80) ;
    # R. J. Mathar, Mar 12 2010
    A036952 := proc() if isprime(convert(n,binary)) then RETURN (n); fi; end: seq(A036952(), n=1..1000);  # K. D. Bajpai, Jul 04 2014
  • Mathematica
    f[n_,k_]:=FromDigits[IntegerDigits[n,k]];lst={};Do[If[PrimeQ[f[n,2]],AppendTo[lst,n]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Mar 12 2010 *)
    NestList[NestWhile[# + 2 &, #, ! PrimeQ[FromDigits[IntegerDigits[#2, 2]]] &, 2] &, 3, 52] (* Jan Mangaldan, Jul 02 2020 *)
  • PARI
    is(n)=my(v=binary(n));isprime(sum(i=1,#v,v[i]*10^(#v-i))) \\ Charles R Greathouse IV, Jun 28 2013

Extensions

Entry revised by R. J. Mathar and N. J. A. Sloane, Mar 12 2010

A199329 Primes having only {0, 1, 9} as digits.

Original entry on oeis.org

11, 19, 101, 109, 191, 199, 911, 919, 991, 1009, 1019, 1091, 1109, 1901, 1999, 9001, 9011, 9091, 9109, 9199, 9901, 10009, 10091, 10099, 10111, 10909, 11119, 11909, 19001, 19009, 19919, 19991, 90001, 90011, 90019, 90191, 90199, 90901, 90911, 91009, 91019, 91099, 91199, 91909, 99109, 99119, 99191, 99901, 99991
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Crossrefs

Programs

  • Mathematica
    Select[FromDigits/@Tuples[{0,1,9},5],PrimeQ] (* Harvey P. Dale, Dec 10 2016 *)
  • PARI
    A199329(n=50,show=0,L=[0,1,9])={for(d=1,1e9,my(t,u=vector(d,i,10^(d-i))~);forvec(v=vector(d,i,[1+!(L[1]||(i>1&&iM. F. Hasler, Jul 25 2015

A062339 Primes whose sum of digits is 4.

Original entry on oeis.org

13, 31, 103, 211, 1021, 1201, 2011, 3001, 10111, 20011, 20101, 21001, 100003, 102001, 1000003, 1011001, 1020001, 1100101, 2100001, 10010101, 10100011, 20001001, 30000001, 101001001, 200001001, 1000000021, 1000001011, 1000010101, 1000020001, 1000200001, 1002000001, 1010000011
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Comments

Is this sequence (and its brothers A062337, A062341 and A062343) infinite?
10^A049054(m)+3 and 3*10^A056807(m)+1 are subsequences. A107715 (primes containing only digits from set {0,1,2,3}) is a supersequence. Terms not containing the digit 3 are either terms of A020449 (primes that contain digits 0 and 1 only) or of A106100 (primes with maximal digit 2) - and thus terms of these sequences' union A036953 (primes containing only digits from set {0,1,2}). - Rick L. Shepherd, May 23 2005

Examples

			3001 is a prime with sum of digits = 4, hence belongs to the sequence.
		

Crossrefs

Subsequence of A062338, A107288, and A107715 (primes with digits <= 3).
A159352 is a subsequence.
Cf. A000040 (primes), A052218 (digit sum = 4), A061239 (primes == 4 (mod 9)).
Cf. Primes p with digital sum equal to k: {2, 11 and 101} for k=2; this sequence (k=4), A062341 (k=5), A062337 (k=7), A062343 (k=8), A107579 (k=10), A106754 (k=11), A106755 (k=13), A106756 (k=14), A106757 (k=16), A106758 (k=17), A106759 (k=19), A106760 (k=20), A106761 (k=22), A106762 (k=23), A106763 (k=25), A106764 (k=26), A048517 (k=28), A106766 (k=29), A106767 (k=31), A106768 (k=32), A106769 (k=34), A106770 (k=35), A106771 (k=37), A106772 (k=38), A106773 (k=40), A106774 (k=41), A106775 (k=43), A106776 (k=44), A106777 (k=46), A106778 (k=47), A106779 (k=49), A106780 (k=50), A106781 (k=52), A106782 (k=53), A106783 (k=55), A106784 (k=56), A106785 (k=58), A106786 (k=59), A106787 (k=61), A107617 (k=62), A107618 (k=64), A107619 (k=65), A106807 (k=67), A244918 (k=68), A181321 (k=70).
Cf. A049054 (10^k+3 is prime), A159352 (these primes).
Cf. A056807 (3*10^k+1 is prime), A259866 (these primes).
Cf. A020449 (primes with digits 0 and 1), A036953 (primes with digits <= 2), A106100 (primes with largest digit = 2), A069663, A069664 (smallest resp. largest n-digit prime with minimum digit sum).

Programs

  • Magma
    [p: p in PrimesUpTo(800000000) | &+Intseq(p) eq 4]; // Vincenzo Librandi, Jul 08 2014
  • Maple
    N:= 20: # to get all terms < 10^N
    B[1]:= {1}:
    B[2]:= {2}:
    B[3]:= {3}:
    A:= {}:
    for d from 2 to N do
       B[4]:= map(t -> 10*t+1,B[3]) union  map(t -> 10*t+3,B[1]);
       B[3]:= map(t -> 10*t, B[3]) union map(t -> 10*t+1,B[2]) union map(t -> 10*t+2,B[1]);
       B[2]:= map(t -> 10*t, B[2]) union map(t -> 10*t+1,B[1]);
       B[1]:= map(t -> 10*t, B[1]);
       A:= A union select(isprime,B[4]);
    od:
    sort(convert(A,list)); # Robert Israel, Dec 28 2015
  • Mathematica
    Union[FromDigits/@Select[Flatten[Table[Tuples[{0,1,2,3},k],{k,9}],1],PrimeQ[FromDigits[#]]&&Total[#]==4&]] (* Jayanta Basu, May 19 2013 *)
    FromDigits/@Select[Tuples[{0,1,2,3},10],Total[#]==4&&PrimeQ[FromDigits[#]]&] (* Harvey P. Dale, Jul 23 2025 *)
  • PARI
    for(a=1,20,for(b=0,a,for(c=0,b,if(isprime(k=10^a+10^b+10^c+1),print1(k", "))))) \\ Charles R Greathouse IV, Jul 26 2011
    
  • PARI
    select( {is_A062339(p,s=4)=sumdigits(p)==s&&isprime(p)}, primes([1,10^7])) \\ 2nd optional parameter for similar sequences with other digit sums. M. F. Hasler, Mar 09 2022
    
  • PARI
    A062339_upto_length(L,s=4,a=List(),u=[10^(L-k)|k<-[1..L]])=forvec(d=[[1,L]|i<-[1..s]], isprime(p=vecsum(vecextract(u,d))) && listput(a,p),1); Vecrev(a) \\ M. F. Hasler, Mar 09 2022
    

Formula

Intersection of A052218 (digit sum 4) and A000040 (primes). - M. F. Hasler, Mar 09 2022

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 06 2001
More terms from Rick L. Shepherd, May 23 2005
More terms from Lekraj Beedassy, Dec 19 2007

A260266 Primes having only {0, 1, 4} as digits.

Original entry on oeis.org

11, 41, 101, 401, 4001, 4111, 4441, 10111, 10141, 11411, 14011, 14401, 14411, 40111, 41011, 41141, 41411, 44041, 44101, 44111, 100411, 101111, 101141, 101411, 110441, 114001, 114041, 140111, 140401, 140411, 141041, 141101, 400441, 401101, 401411, 404011
Offset: 1

Views

Author

Vincenzo Librandi, Jul 22 2015

Keywords

Comments

A020449 and A020452 are subsequences.
All terms end with a digit "1". - M. F. Hasler, Jul 26 2015

Crossrefs

Primes that contain only digits among {1,4,k}: this sequence (k=0), A260267 (k=2), A199341 (k=3), A260268 (k=5), A260269 (k=6), A079651 (k=7), A260270 (k=8), A260271 (k=9).

Programs

  • Magma
    [p: p in PrimesUpTo(5*10^5) | Set(Intseq(p)) subset [1, 4, 0]];
    
  • Mathematica
    Select[Prime[Range[4 10^4]], Complement[IntegerDigits[#], {1, 4, 0}]=={} &]
  • PARI
    A260266(n=50,show=0)={for(d=1,1e9,my(t,u=vector(d,i,10^(d-i))~);forvec(v=vector(d,i,[i==1||i==d,1+(iM. F. Hasler, Jul 25 2015

A199327 Primes having only {0, 1, 7} as digits.

Original entry on oeis.org

7, 11, 17, 71, 101, 107, 701, 1117, 1171, 1777, 7001, 7177, 7717, 10007, 10111, 10177, 10711, 10771, 11071, 11117, 11171, 11177, 11701, 11717, 11777, 17011, 17077, 17107, 17117, 17707, 70001, 70111, 70117, 70177, 70717, 71011, 71171, 71707, 71711, 71777, 77017, 77101, 77171, 77711, 101107, 101111, 101117
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(80000) | Intseq(p) subset {0,1,7}]; // Vincenzo Librandi, Jan 16 2020
  • Mathematica
    f[i_,nn_]:=Select[Flatten[Table[FromDigits/@(Join[{i},#]&/@Tuples[ {0,1,7}, n]), {n,0,nn}]],PrimeQ]; Union[Join[f[1,6],f[7,6]]] (* Harvey P. Dale, Nov 19 2011 *)
    Select[Prime[Range[2 10^4]], Complement[IntegerDigits[#], {0, 1, 7}]=={}&] (* Vincenzo Librandi, Jan 16 2020 *)
  • PARI
    a(n,list=0,L=[0,1,7])={for(d=1,1e9,my(t,u=vector(d,i,10^(d-i))~);forvec(v=vector(d,i,[1+!(L[1]||(i>1&&iM. F. Hasler, Jul 26 2015
    

A260044 Primes having only {0, 1, 3} as digits.

Original entry on oeis.org

3, 11, 13, 31, 101, 103, 113, 131, 311, 313, 331, 1013, 1031, 1033, 1103, 1301, 1303, 3001, 3011, 3301, 3313, 3331, 10103, 10111, 10133, 10301, 10303, 10313, 10331, 10333, 11003, 11113, 11131, 11311, 13001, 13003, 13033, 13103, 13313, 13331, 30011, 30013, 30103, 30113, 30133, 30313, 31013, 31033, 31333, 33013
Offset: 1

Views

Author

M. F. Hasler, Jul 25 2015

Keywords

Comments

A subsequence of A107715 and of A111488.
Number of terms < 10^n: 1, 4, 11, 22, 54, 118, 293, 691, 1837, 4871, 13321, 36042, 98325, 272237, 757080, .... - Robert G. Wilson v, Jul 26 2015

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^5) | Set(Intseq(p)) subset [0, 1, 3]]; // Vincenzo Librandi, Jul 26 2015
  • Mathematica
    Select[ FromDigits@# & /@ Tuples[{0, 1, 3}, 5], PrimeQ] (* Robert G. Wilson v, Jul 26 2015 *)
    Select[Prime[Range[4 10^3]], Complement[IntegerDigits[#], {0, 1, 3}]=={} &] (* Vincenzo Librandi, Jul 26 2015 *)
  • PARI
    A260044={(n,show=0,L=[0,1,3])->my(t);for(d=1,1e9,u=vector(d,i,10^(d-i))~;forvec(v=vector(d,i,[1+(i==1&!L[1]),#L]),ispseudoprime(t=vector(d,i,L[v[i]])*u)||next;show&print1(t",");n--||return(t)))}
    

A217039 Primes having only {4, 5, 7} as digits.

Original entry on oeis.org

5, 7, 47, 457, 547, 557, 577, 757, 4447, 4457, 4547, 5477, 5557, 7457, 7477, 7547, 7577, 7757, 44777, 45557, 45757, 47777, 54547, 54577, 55457, 55547, 57457, 57557, 74747, 75557, 75577, 77447, 77477, 77557, 77747, 444547, 444557, 445447, 445477, 445747, 447757
Offset: 1

Views

Author

Jonathan Vos Post, Sep 24 2012

Keywords

Comments

These are the primes in A214584. Primes whose numerals are all written (san serif) with at least one right or acute angle.

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(450000) | Intseq(p) subset [4,5,7]]; // Bruno Berselli, Sep 25 2012
    
  • Mathematica
    Select[Flatten[Table[FromDigits/@Tuples[{4,5,7},n],{n,6}]],PrimeQ] (* Bruno Berselli, Sep 25 2012 *)
  • PARI
    A217039(n=50,show=0,L=[4,5,7])={for(d=1,1e9, my(t, u=vector(d,i,10^(d-i))~); forvec(v=vector(d,i,[if(i==d&&d>1,3/*must end in 7*/,1), #L]), ispseudoprime(t=vecextract(L, v)*u)||next; show&&print1(t", "); n--||return(t)))} \\ Syntax updated for newer PARI versions by M. F. Hasler, Jul 25 2015

Formula

A000040 INTERSECTION A214584.
Showing 1-10 of 22 results. Next