login
Convolution of odd primes with themselves.
1

%I #15 Sep 30 2021 20:03:13

%S 9,30,67,136,237,386,587,852,1213,1658,2227,2932,3765,4766,5939,7324,

%T 8917,10746,12851,15200,17845,20794,24083,27748,31785,36250,41107,

%U 46376,52113,58350,65111,72444,80353,88858,98003,107744,118201,129410,141355,154080

%N Convolution of odd primes with themselves.

%H Harvey P. Dale, <a href="/A084370/b084370.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = Sum_{k=1..n} A065091(k) * A065091(n-k+1).

%e a(4) = 11*3 + 7*5 + 5*7 + 3*11 = 136.

%t Table[With[{c=Prime[Range[2,n]]},ListConvolve[c,c]],{n,2,40}]//Flatten (* _Harvey P. Dale_, Apr 25 2016 *)

%o (PARI) conv(n)=local(v,s); v=primes(n+1); s=0; for(i=2, length(v), s+=v[i]*v[length(v)-i+2]); s

%o for(n=1,40,print1(conv(n)","))

%o (Python)

%o from numpy import convolve

%o from sympy import prime, primerange

%o def aupton(terms):

%o p = list(primerange(3, prime(terms+1)+1))

%o return list(convolve(p, p))[:terms]

%o print(aupton(40)) # _Michael S. Branicky_, Sep 30 2021

%Y Cf. A065091, A014342, A209403.

%K nonn

%O 1,1

%A _Jon Perry_, Jun 23 2003