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.
%I A302334 #29 Feb 27 2024 23:21:37 %S A302334 2,3,5,7,10,13,16,20,24,28,32,36,40,44,48,53,57,61,66,70,75,79,84,89, %T A302334 94,98,103,108,113,119,124,129,135,140,146,151,156,162,167,172,178, %U A302334 183,189,194,200,205,211,216,222,228,233,239,244,250,255,261,267,273,278,284 %N A302334 A weighted smoothing applied to the primes as a data set: a(n) = floor(A007443(2n-1)/2^(2n-2)), where A007443 is binomial transform of primes. %C A302334 a(n) is the weighted average of the first 2n - 1 primes, using row 2n - 2 of Pascal's triangle as weights, with the result rounded down. a(n) is thus based on the longest ordered list of consecutive primes that has prime(n) in the central position, while giving substantially greater weight to the primes near prime(n). %C A302334 A guiding aim when framing the definition was having the arithmetic mean of the first k terms close to the arithmetic mean of the first k primes. In this respect, a simplified analysis suggested the binomial weighting might perform equally well for large k as small k, and empirical results were encouraging. For all k <= 500 the difference between the means is < 0.541, with 0.5 being exceeded only for 394 <= k <= 401. (These figures become not quite as good if floor rounding is replaced by nearest-integer, though a rounding midway between the two does better than either.) %C A302334 The early terms (playing the role of primes) correspond closely to A053620 (in the role of primepi function), but the correspondence gets better if nearest-integer rounding is used instead of the floor rounding used here. - _Peter Munn_, Feb 26 2024 %C A302334 Conjecture: the second differences are in [-2,2]. %H A302334 Peter Munn, <a href="/A302334/b302334.txt">Table of n, a(n) for n = 1..500</a> %H A302334 P. Marchand and L. Marmet, <a href="https://www.researchgate.net/publication/224473494_Binomial_smoothing_filter_A_way_to_avoid_some_pitfalls_of_least-squares_polynomial_smoothing">Binomial smoothing filter: A way to avoid some pitfalls of least square polynomial smoothing</a>, Review of Scientific Instruments, 54, 1034-41, 1983. %H A302334 Wikipedia, <a href="https://en.wikipedia.org/wiki/Smoothing">Smoothing</a> %F A302334 a(n) = floor(Sum_{k=0..2n-2} (binomial(2n-2,k) * prime(k+1))/2^(2n-2)). %F A302334 a(n) = floor(A007443(2n-1)/2^(2n-2)). %e A302334 For n=3, we calculate a weighted average of the first 2n - 1 = 5 primes. Row 2n - 2 = 4 of Pascal's triangle, (1,4,6,4,1), provides the weights, and its row sum is 2^4 = 16. %e A302334 Specifically, using the first formula, a(3) = floor( Sum_{k=0..4}(binomial(4,k)*prime(k+1)) / 2^4 ). %e A302334 The sum in the formula = 1*prime(1) + 4*prime(2) + 6*prime(3) + 4*prime(4) + 1*prime(5) = 1*2 + 4*3 + 6*5 + 4*7 + 1*11 = 2 + 12 + 30 + 28 + 11 = 83. %e A302334 So a(3) = floor(83/2^4) = floor(83/16) = 5. %e A302334 Comparison with the primes: (Start) %e A302334 Analysis table showing the difference between the start of this sequence and the start of the list of primes. a(n) is subtracted from prime(n) to give a sense of how prime(n) is lower or higher than it might be if the primes were more smoothly distributed. The column headed "cumulative" gives the partial sums of the previous column, which are then divided by n and rounded to 3 decimal places to give the final column. The final column therefore shows the difference between the arithmetic means of the first n primes and the first n terms of this sequence. %e A302334 n prime(n) a(n) difference cumulative average %e A302334 1 2 2 0 0 0.000 %e A302334 2 3 3 0 0 0.000 %e A302334 3 5 5 0 0 0.000 %e A302334 4 7 7 0 0 0.000 %e A302334 5 11 10 1 1 0.200 %e A302334 6 13 13 0 1 0.167 %e A302334 7 17 16 1 2 0.286 %e A302334 8 19 20 -1 1 0.125 %e A302334 9 23 24 -1 0 0.000 %e A302334 10 29 28 1 1 0.100 %e A302334 11 31 32 -1 0 0.000 %e A302334 12 37 36 1 1 0.083 %e A302334 13 41 40 1 2 0.154 %e A302334 14 43 44 -1 1 0.071 %e A302334 15 47 48 -1 0 0.000 %e A302334 16 53 53 0 0 0.000 %e A302334 17 59 57 2 2 0.118 %e A302334 18 61 61 0 2 0.111 %e A302334 19 67 66 1 3 0.158 %e A302334 20 71 70 1 4 0.200 %e A302334 21 73 75 -2 2 0.095 %e A302334 22 79 79 0 2 0.091 %e A302334 23 83 84 -1 1 0.043 %e A302334 24 89 89 0 1 0.042 %e A302334 25 97 94 3 4 0.160 %e A302334 26 101 98 3 7 0.269 %e A302334 27 103 103 0 7 0.259 %e A302334 28 107 108 -1 6 0.214 %e A302334 29 109 113 -4 2 0.069 %e A302334 30 113 119 -6 -4 -0.133 %e A302334 31 127 124 3 -1 -0.032 %e A302334 32 131 129 2 1 0.031 %e A302334 (End) %t A302334 a[n_] := Floor[ Sum[ Binomial[2n -2, k]*Prime[k +1]/2^(2n -2), {k, 0, 2n -2}]]; Array[a, 60] (* _Robert G. Wilson v_, Jun 10 2018 *) %o A302334 (PARI) a(n) = floor(sum(k=0, 2*n-2, (binomial(2*n-2,k) * prime(k+1))/2^(2*n-2))); \\ _Michel Marcus_, Aug 21 2018 %Y A302334 Cf. A000040, A000079, A007443, A053620, A060620. %K A302334 nonn %O A302334 1,1 %A A302334 _Peter Munn_, Apr 05 2018 %E A302334 a(51)-a(60) from _Robert G. Wilson v_, Jun 10 2018