A244192 a(n) = most common 2-digit ending for a prime < 10^n, or 0 if there is a tie.
0, 0, 0, 97, 71, 91, 77, 61, 47, 47, 19, 27, 37
Offset: 2
Examples
For all primes < 100000 (10^5), the most common 2-digit ending is 97. Thus a(5) = 97.
Programs
-
Python
import sympy from sympy import isprime def prend(d,n): lst = [] for k in range(10**n): if isprime(k): lst.append((k%10**d)) new = 0 newlst = [] for i in range(10**(d-1),10**d): new = lst.count(i) newlst.append(new) newlst1 = newlst.copy() a = max(newlst1) newlst1[newlst1.index(a)] = 0 b = max(newlst1) if a == b: return 0 else: return newlst.index(max(a,b)) + 10**(d-1) n = 3 while n < 10: print(prend(2,n),end=', ') n += 1
Extensions
a(9)-a(12) from Hiroaki Yamanouchi, Jul 11 2014
a(13)-a(14) from Giovanni Resta, Oct 23 2018
Comments