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.

A084370 Convolution of odd primes with themselves.

Original entry on oeis.org

9, 30, 67, 136, 237, 386, 587, 852, 1213, 1658, 2227, 2932, 3765, 4766, 5939, 7324, 8917, 10746, 12851, 15200, 17845, 20794, 24083, 27748, 31785, 36250, 41107, 46376, 52113, 58350, 65111, 72444, 80353, 88858, 98003, 107744, 118201, 129410, 141355, 154080
Offset: 1

Views

Author

Jon Perry, Jun 23 2003

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    Table[With[{c=Prime[Range[2,n]]},ListConvolve[c,c]],{n,2,40}]//Flatten (* Harvey P. Dale, Apr 25 2016 *)
  • 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
    for(n=1,40,print1(conv(n)","))
    
  • Python
    from numpy import convolve
    from sympy import prime, primerange
    def aupton(terms):
        p = list(primerange(3, prime(terms+1)+1))
        return list(convolve(p, p))[:terms]
    print(aupton(40)) # Michael S. Branicky, Sep 30 2021

Formula

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