%I #29 Feb 27 2024 23:21:37
%S 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 94,98,103,108,113,119,124,129,135,140,146,151,156,162,167,172,178,
%U 183,189,194,200,205,211,216,222,228,233,239,244,250,255,261,267,273,278,284
%N 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 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 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 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 Conjecture: the second differences are in [-2,2].
%H Peter Munn, <a href="/A302334/b302334.txt">Table of n, a(n) for n = 1..500</a>
%H 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 Wikipedia, <a href="https://en.wikipedia.org/wiki/Smoothing">Smoothing</a>
%F a(n) = floor(Sum_{k=0..2n-2} (binomial(2n-2,k) * prime(k+1))/2^(2n-2)).
%F a(n) = floor(A007443(2n-1)/2^(2n-2)).
%e 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 Specifically, using the first formula, a(3) = floor( Sum_{k=0..4}(binomial(4,k)*prime(k+1)) / 2^4 ).
%e 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 So a(3) = floor(83/2^4) = floor(83/16) = 5.
%e Comparison with the primes: (Start)
%e 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 n prime(n) a(n) difference cumulative average
%e 1 2 2 0 0 0.000
%e 2 3 3 0 0 0.000
%e 3 5 5 0 0 0.000
%e 4 7 7 0 0 0.000
%e 5 11 10 1 1 0.200
%e 6 13 13 0 1 0.167
%e 7 17 16 1 2 0.286
%e 8 19 20 -1 1 0.125
%e 9 23 24 -1 0 0.000
%e 10 29 28 1 1 0.100
%e 11 31 32 -1 0 0.000
%e 12 37 36 1 1 0.083
%e 13 41 40 1 2 0.154
%e 14 43 44 -1 1 0.071
%e 15 47 48 -1 0 0.000
%e 16 53 53 0 0 0.000
%e 17 59 57 2 2 0.118
%e 18 61 61 0 2 0.111
%e 19 67 66 1 3 0.158
%e 20 71 70 1 4 0.200
%e 21 73 75 -2 2 0.095
%e 22 79 79 0 2 0.091
%e 23 83 84 -1 1 0.043
%e 24 89 89 0 1 0.042
%e 25 97 94 3 4 0.160
%e 26 101 98 3 7 0.269
%e 27 103 103 0 7 0.259
%e 28 107 108 -1 6 0.214
%e 29 109 113 -4 2 0.069
%e 30 113 119 -6 -4 -0.133
%e 31 127 124 3 -1 -0.032
%e 32 131 129 2 1 0.031
%e (End)
%t 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 (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 Cf. A000040, A000079, A007443, A053620, A060620.
%K nonn
%O 1,1
%A _Peter Munn_, Apr 05 2018
%E a(51)-a(60) from _Robert G. Wilson v_, Jun 10 2018