login
a(n) is the shyest prime in base n.
1

%I #12 Feb 22 2020 21:01:03

%S 2,3,31,13,523,31,3833,491,5483,523,18149,661,44657,3833,18869,7333,

%T 165479,5483,153953,20411,129127,18149,538651,7079,932257,44657,

%U 417037,52639,2223773,18869,3124217,175229,1993763,165479,2794811,50461,8678963,153953

%N a(n) is the shyest prime in base n.

%C Terminology: consider pairs of final digits of consecutive primes (a,b). Then of all pairs (3,1) is found last in the prime sequence, corresponding to (523, 541). This is termed the shyest pair, with 523 the shyest prime.

%C Consider final digit pairs (a,b) of consecutive primes.

%C There are three unique pairs: (2, 3) (3, 5) (5, 7)

%C For the remaining 16 pairs, record the first observed primes corresponding to the pair:

%C Initial prime -- Second prime (mod 10) ---

%C (mod 10) 1 3 7 9

%C 1 181,191 11, 13 31, 37 401,409

%C 3 523,541 283,293 13, 17 23, 29

%C 7 7, 11 47, 53 337,347 17, 19

%C 9 29, 31 19, 23 89, 97 139,149

%C 523,541 is the largest pair, thus the last to occur in the sequence of primes. The first member of this pair is the shyest prime, base 10. (Note that if we consider two digit pairs (ab, cd) then 40191937, 40192037 is the shyest pair for base 10.)

%C For base 3 the table is:

%C Initial prime Second prime (mod 3)

%C (mod 3) 0 1 2

%C 0 - - 3,5

%C 1 - 31,37 7,11

%C 2 2,3 5,7 23,29

%C and 31 is the shyest prime base 3.

%H Giovanni Resta, <a href="/A272043/b272043.txt">Table of n, a(n) for n = 1..200</a>

%H Erica Klarreich, <a href="https://www.quantamagazine.org/20160313-mathematicians-discover-prime-conspiracy/">Mathematicians Discover Prime Conspiracy</a>, Quanta Magazine, March 13, 2016

%H Robert J. Lemke Oliver and Kannan Soundararajan, <a href="http://arxiv.org/abs/1603.03720">Unexpected biases in the distribution of consecutive primes</a>, arXiv:1603.03720 [math.NT], 2016.

%H Andy Martin, <a href="/A272043/a272043.txt">Ruby code output of first 35 terms and additional data</a>

%H Terence Tao, <a href="https://terrytao.wordpress.com/2016/03/14/biases-between-consecutive-primes/">Biases between consecutive primes</a>, blog entry March 14, 2016.

%t a[n_] := Block[{g,p,m,q,k, e= First /@ Select[ Tally[ Mod[ Prime@ Range[n* 100], n]], #[[2]] > 50 &], A}, A = Association@ Table[{i,j} -> 0, {i,e}, {j,e}]; g = Length[e]^2; m=p=2; While[g > 0, q = NextPrime@p; k = Mod[{p, q}, n]; If[ Lookup[A, Key@k, 1] == 0, A[k] = 1; g--]; m=p; p=q]; m]; Array[a, 25] (* _Giovanni Resta_, Apr 19 2016 *)

%o require 'Prime'

%o # Ruby Code

%o # Generates Hash with first occurrences of all possible pairs (a,b)

%o # of final digits for consecutive primes in specified base.

%o def gen_hash(h, base)

%o last_prime = 2

%o iteration = last_found = 0

%o Prime.each() do |prime|

%o # This check could be improved & may be invalid for bases above 35.

%o return if (iteration+=1) > 10000 && iteration > 2 * last_found

%o next if prime == 2

%o l = last_prime.to_s(base)[-1]

%o p = prime.to_s(base)[-1]

%o if h[[l,p]].nil?

%o h[[l,p]] = [last_prime,prime]

%o last_found = iteration

%o end

%o last_prime = prime

%o end

%o end

%o puts "First Prime Second Prime Base Difference Different Final Digits In"

%o puts " Pairs Base Notation"

%o puts " 2 3 1 1 1 1 1"

%o # For bases above 35 additional programming needed.

%o 2.upto(35){|base|

%o gen_hash(h = Hash.new, base)

%o p0 = h.values.sort.last[0]

%o p1 = h.values.sort.last[1]

%o printf("%11d %12d %4d %10d %10d %s %s\n",

%o p0, p1, base, p1 - p0, h.length, p0.to_s(base)[-1], p1.to_s(base)[-1])

%o }

%Y Cf. A269364, A270310.

%K nonn,base

%O 1,1

%A _Andy Martin_, Apr 18 2016

%E a(22)-a(38) from _Giovanni Resta_, Apr 19 2016