The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A244189 a(n) = most common final digit for a prime with n digits, or 0 if there is a tie. 2

%I #28 Jul 11 2014 09:10:11

%S 0,3,7,3,7,3,7,7,3,3,1,7,3,7

%N a(n) = most common final digit for a prime with n digits, or 0 if there is a tie.

%e Primes with two digits are {11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97}. The most frequent last digit is a 3. Thus a(2) = 3.

%o (Python)

%o import sympy

%o from sympy import isprime

%o def end(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 ..a = max(lst)

%o ..lst[lst.index(a)] = 0

%o ..b = max(lst)

%o ..if a == b:

%o ....return 0

%o ..else:

%o ....return max(a,b) + 10**(d-1)

%o n = 2

%o while n < 10:

%o ..print(end(1,n),end=', ')

%o ..n += 1

%Y Cf. A244190.

%K nonn,base,hard,more

%O 1,2

%A _Derek Orr_, Jun 22 2014

%E a(9)-a(14) from _Hiroaki Yamanouchi_, Jul 10 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 19 20:59 EDT 2024. Contains 372703 sequences. (Running on oeis4.)