cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A336814 Denominator of the average distance among first n primes.

Original entry on oeis.org

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

Views

Author

Andres Cicuttin, Nov 21 2020

Keywords

Crossrefs

Cf. A332094 (numerator), A338869, A339022, A062020.

Programs

  • 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}]

Formula

a(n) = denominator((2/(n*(n-1)))*Sum_{j=2..n} Sum_{i=1..j-1} (prime(j) - prime(i))).
Showing 1-1 of 1 results.