A272043 a(n) is the shyest prime in base n.
2, 3, 31, 13, 523, 31, 3833, 491, 5483, 523, 18149, 661, 44657, 3833, 18869, 7333, 165479, 5483, 153953, 20411, 129127, 18149, 538651, 7079, 932257, 44657, 417037, 52639, 2223773, 18869, 3124217, 175229, 1993763, 165479, 2794811, 50461, 8678963, 153953
Offset: 1
Links
- Giovanni Resta, Table of n, a(n) for n = 1..200
- Erica Klarreich, Mathematicians Discover Prime Conspiracy, Quanta Magazine, March 13, 2016
- Robert J. Lemke Oliver and Kannan Soundararajan, Unexpected biases in the distribution of consecutive primes, arXiv:1603.03720 [math.NT], 2016.
- Andy Martin, Ruby code output of first 35 terms and additional data
- Terence Tao, Biases between consecutive primes, blog entry March 14, 2016.
Programs
-
Mathematica
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 *)
-
Ruby
require 'Prime' # Ruby Code # Generates Hash with first occurrences of all possible pairs (a,b) # of final digits for consecutive primes in specified base. def gen_hash(h, base) last_prime = 2 iteration = last_found = 0 Prime.each() do |prime| # This check could be improved & may be invalid for bases above 35. return if (iteration+=1) > 10000 && iteration > 2 * last_found next if prime == 2 l = last_prime.to_s(base)[-1] p = prime.to_s(base)[-1] if h[[l,p]].nil? h[[l,p]] = [last_prime,prime] last_found = iteration end last_prime = prime end end puts "First Prime Second Prime Base Difference Different Final Digits In" puts " Pairs Base Notation" puts " 2 3 1 1 1 1 1" # For bases above 35 additional programming needed. 2.upto(35){|base| gen_hash(h = Hash.new, base) p0 = h.values.sort.last[0] p1 = h.values.sort.last[1] printf("%11d %12d %4d %10d %10d %s %s\n", p0, p1, base, p1 - p0, h.length, p0.to_s(base)[-1], p1.to_s(base)[-1]) }
Extensions
a(22)-a(38) from Giovanni Resta, Apr 19 2016
Comments