|
|
A244253
|
|
a(n) = the frequency of the most common final digit of a prime with n digits.
|
|
0
|
|
|
1, 6, 40, 268, 2103, 17623, 146590, 1274284, 11272025, 101053126, 915755611, 8372478663, 77114448042, 714719245204
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
For the most common final digit, see A244189.
|
|
LINKS
|
|
|
EXAMPLE
|
Of the 3-digit primes, there are 35 that end in 1, 35 that end in 3, 40 that end in 7, and 33 that end in 9. Thus since 7 has the most, a(3) = 40.
|
|
PROG
|
(Python)
import sympy
from sympy import isprime
def end1(d, n):
..lst = []
..for k in range(10**(d-1), 10**d):
....num = ''
....count = 0
....for i in range(10**(n-d-1), 10**(n-d)):
......if isprime(int(str(i)+str(k))):
........count += 1
....lst.append(count)
..return max(lst)
n = 2
while n < 10:
..print(end1(1, n), end=', ')
..n += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,more,hard
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|