%I #8 Aug 26 2014 08:07:57
%S 1,6,31,220,1748,14746,127601,1127869,10107163,91579392,837273621
%N a(n) = the frequency of the most common 2-digit ending of a prime with n digits.
%e Of the 3-digit primes, the most common two-digit ending occurs 6 times. Thus a(3) = 6.
%o (Python)
%o import sympy
%o from sympy import isprime
%o def end1(d,n):
%o ..lst = []
%o ..for k in range(10**(d-1),10**d):
%o ....num = ''
%o ....count = 0
%o ....for i in range(10**(n-d-1),10**(n-d)):
%o ......if isprime(int(str(i)+str(k))):
%o ........count += 1
%o ....lst.append(count)
%o ..return max(lst)
%o n = 3
%o while n < 10:
%o ..print(end1(2,n),end=', ')
%o ..n += 1
%Y Cf. A244190.
%K nonn,base,hard,more
%O 2,2
%A _Derek Orr_, Jun 24 2014
%E a(8)-a(12) from _Hiroaki Yamanouchi_, Aug 26 2014
|