OFFSET
1,1
COMMENTS
There are no terms whose number of digits is divisible by 3: for every d that is a multiple of 3, every d-digit number j consisting of no digits other than 1's and 7's will have a digit sum divisible by 3, so j will also be divisible by 3. - Mikk Heidemaa, Mar 26 2021
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000 (first 1000 terms from Vincenzo Librandi)
James Maynard and Brady Haran, Primes without a 7, Numberphile video (2019)
MATHEMATICA
Flatten[Table[Select[FromDigits/@Tuples[{1, 7}, n], PrimeQ], {n, 7}]] (* Vincenzo Librandi, Jul 27 2012 *)
PROG
(Magma) [p: p in PrimesUpTo(1771177) | Set(Intseq(p)) subset [1, 7]]; // Vincenzo Librandi, Jul 27 2012
(Python)
from sympy import isprime
def only17(n): return int(bin(n+1)[3:].replace('1', '7').replace('0', '1'))
def auptod(digs):
return list(filter(isprime, (only17(i) for i in range(1, 2**(digs+1)-1))))
print(auptod(8)) # Michael S. Branicky, Jul 11 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved