OFFSET
1,1
COMMENTS
1 occurs first at a(2766290)
2 occurs first at a(1)
3 occurs first at a(6)
7 occurs first at a(37)
9 occurs first at a(7153)
13 occurs first at a(45532)
17 occurs first at a(12655)
23 occurs first at a(2)
37 occurs first at a(7)
39 occurs first at a(429687)
79 occurs first at a(7042)
137 occurs first at a(13)
235 occurs first at a(3)
379 occurs first at a(93562)
2357 occurs first at a(4)
12357 occurs first at a(5)
The other possible new terms are 19, 139, 179 and 1379. - Michael S. Branicky, Nov 11 2025
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Caldwell and Honaker, Prime Curios!: 137
EXAMPLE
a(13) = 137 because primes that end with digits 1, 3, and 7 occur most frequently (exactly three times each) up to the 13th prime.
MATHEMATICA
With[{s = Array[Mod[Prime@ #, 10] &, 73]}, Array[FromDigits@ Last[SplitBy[#, Last]][[All, 1]] &@ SortBy[Tally@ Take[s, #], Last] &, Length@ s]] (* Michael De Vlieger, Apr 21 2018 *)
PROG
(PARI) lista(nn) = {my(p=1, v = vector(9)); for (n=1, nn, p = nextprime(p+1); d = p % 10; v[d] ++; vmax = vecmax(v); s = ""; for (i=1, #v, if (v[i] == vmax, s = concat(s, i)); ); print1(eval(s), ", "); ); } \\ Michel Marcus, Apr 11 2018
(Python)
from gmpy2 import next_prime
from itertools import count, islice
from collections import Counter
def agen(verbose=False): # generator of terms, verbose=True prints first-seen terms
p, c, ranks = 2, Counter(), set()
for n in count(1):
c[str(int(p%10))] += 1
m = max(c.values())
r = int("".join(k for k in "123579" if c[k] == m))
yield r
if r not in ranks:
ranks.add(r)
if verbose: # print terms as in Comments
print(f"{r} occurs first at a({n})")
p = next_prime(p)
print(list(islice(agen(), 73))) # Michael S. Branicky, Nov 11 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
G. L. Honaker, Jr., Mar 27 2018
EXTENSIONS
a(14)-a(73) by Chuck Gaydos
STATUS
approved
