A257668 Primes containing a digit 7.
7, 17, 37, 47, 67, 71, 73, 79, 97, 107, 127, 137, 157, 167, 173, 179, 197, 227, 257, 271, 277, 307, 317, 337, 347, 367, 373, 379, 397, 457, 467, 479, 487, 547, 557, 571, 577, 587, 607, 617, 647, 673, 677, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761
Offset: 1
Examples
For n = 2, a(2) = 17 is the second prime containing a digit of 7.
Links
- Shujing Lyu, Table of n, a(n) for n = 1..100000
Programs
-
Magma
[p: p in PrimesUpTo(800) | 7 in Intseq(p)];
-
Mathematica
Select[Prime[Range[150]], ! StringFreeQ[ToString[#], "7"] &]
-
PARI
lista(nn) = forprime(p=2, nn, if(vecsearch(vecsort(digits(p)), 7), print1(p, ", "))); \\ Altug Alkan, Apr 21 2016; corrected by Michel Marcus, Oct 30 2023
-
Sage
[p for p in primes(800) if 7 in p.digits(base=10)] # Bruno Berselli, May 03 2015
Formula
a(n) ~ n log n. - Charles R Greathouse IV, Nov 01 2022
Comments