A157711 Primes made up of 0's and four 1's only.
10111, 1011001, 1100101, 10010101, 10100011, 101001001, 1000001011, 1000010101, 1010000011, 1100010001, 10000001101, 10001000011, 10001001001, 10001100001, 10100000011, 10100001001, 11000000101, 11001000001
Offset: 1
Links
- Jeppe Stig Nielsen, Table of n, a(n) for n = 1..10000 (terms 1..1000 from T. D. Noe)
- Hans Havermann, The one-millionth term.
- Hans Havermann, The two-millionth term.
Programs
-
Maple
for d from 4 to 18 do for c from 0 to 2^d-1 do bdgs := convert(c,base,2) ; if add(i,i=bdgs) = 3 then p := 10^d+add(op(i,bdgs)*10^(i-1),i=1..nops(bdgs)) ; if isprime(p) then printf("%d,",p) ; fi; fi; od: od: # R. J. Mathar, Mar 06 2009
-
Mathematica
Flatten[Select[FromDigits/@Permutations[Join[{1,1,1,1},PadRight[{},7,0]]],PrimeQ]] // Union (* Harvey P. Dale, May 09 2019 *)
-
PARI
for(n=0, 10, forprime(p=10^n, (10^(n+1)-1)/9, if(vecmax(digits(p))==1, if(sumdigits(p)==4, print1(p, ", "))))) \\ Felix Fröhlich, Nov 19 2014
-
PARI
my(M=20);for(i=3, M, for(j=2,i-1, for(k=1, j-1, my(p=10^i+10^j+10^k+1); isprime(p)&&print1(p,", ")))) \\ Jeppe Stig Nielsen, May 18 2023
Extensions
Extended by numerous authors, Mar 06 2009
Comments