login
A336814
Denominator of the average distance among first n primes.
1
1, 1, 6, 5, 5, 21, 4, 1, 9, 55, 6, 39, 91, 105, 40, 17, 153, 171, 190, 21, 21, 253, 276, 15, 13, 351, 42, 203, 87, 465, 496, 11, 33, 595, 10, 111, 37, 741, 780, 41, 287, 301, 946, 5, 207, 1081, 376, 294, 35, 425, 1326, 689, 477, 33, 1540, 133, 551, 1711, 1770, 915, 1891, 1953, 224
OFFSET
2,3
FORMULA
a(n) = denominator((2/(n(n-1))*Sum_{j=2..n} Sum_{i=1..j-1} (prime(j) - prime(i))).
MATHEMATICA
nmax=64;
Table[Total[Flatten[Table[Table[Prime[k] - Prime[j], {j, 1, k - 1}], {k, 2, n}]]]/(n*(n - 1)/2), {n, 2, nmax}]//Denominator
(* Also *)
denavepdist[n_]:=Module[{pset, p2s, diffp2s},
pset=Prime[Range[n]];
p2s=Subsets[pset, {2}];
diffp2s=Map[Differences, p2s]//Flatten//Tally;
Sum[diffp2s[[j]][[1]]*diffp2s[[j]][[2]], {j, 1, Length[diffp2s]}]/Length[p2s]//Denominator//Return];
Table[denavepdist[n], {n, 2, 2^6}]
CROSSREFS
Cf. A332094 (numerator), A338869, A339022, A062020.
Sequence in context: A070860 A198354 A195956 * A019850 A185273 A330065
KEYWORD
nonn,frac
AUTHOR
Andres Cicuttin, Nov 21 2020
STATUS
approved