A090726 Duplicate of A036953.
2, 11, 101, 211, 1021, 1201, 2011, 2111, 2221, 10111, 10211, 12011, 12101, 12211
Offset: 1
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.
[p: p in PrimesUpTo(101111111) | Set(Intseq(p)) subset [0,1]]; // Vincenzo Librandi, Jul 27 2012
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
Select[FromDigits/@Tuples[{0,1},16],PrimeQ] (* Hans Havermann, May 12 2025 *)
is(n)=isprime(n)&&vecmax(digits(n))==1 \\ Charles R Greathouse IV, Jul 01 2013
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
[a: n in [0..300] | IsPrime(a) where a is (10^n - 1) div 9 ]; // Vincenzo Librandi, Nov 08 2014
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 *)
forprime(x=2,20000,if(ispseudoprime((10^x-1)/9),print1((10^x-1)/9","))) \\ Cino Hilliard, Dec 23 2008
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
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.
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
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 *)
is(n)=my(v=binary(n));isprime(sum(i=1,#v,v[i]*10^(#v-i))) \\ Charles R Greathouse IV, Jun 28 2013
Select[FromDigits/@Tuples[{0,1,9},5],PrimeQ] (* Harvey P. Dale, Dec 10 2016 *)
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
3001 is a prime with sum of digits = 4, hence belongs to the sequence.
[p: p in PrimesUpTo(800000000) | &+Intseq(p) eq 4]; // Vincenzo Librandi, Jul 08 2014
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
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 *)
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
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
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
[p: p in PrimesUpTo(5*10^5) | Set(Intseq(p)) subset [1, 4, 0]];
Select[Prime[Range[4 10^4]], Complement[IntegerDigits[#], {1, 4, 0}]=={} &]
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
[p: p in PrimesUpTo(80000) | Intseq(p) subset {0,1,7}]; // Vincenzo Librandi, Jan 16 2020
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 *)
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
[p: p in PrimesUpTo(10^5) | Set(Intseq(p)) subset [0, 1, 3]]; // Vincenzo Librandi, Jul 26 2015
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 *)
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)))}
[p: p in PrimesUpTo(450000) | Intseq(p) subset [4,5,7]]; // Bruno Berselli, Sep 25 2012
Select[Flatten[Table[FromDigits/@Tuples[{4,5,7},n],{n,6}]],PrimeQ] (* Bruno Berselli, Sep 25 2012 *)
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
Comments