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.

A308731 a(n) is the sum of the terms of the symmetric square array defined by M(i,j) = prime(i)+i-j for i >= j and M(i,j) = M(j,i) if i < j.

Original entry on oeis.org

2, 13, 44, 105, 224, 397, 660, 1001, 1464, 2105, 2866, 3849, 5030, 6373, 7946, 9829, 12048, 14489, 17310, 20459, 23872, 27731, 31972, 36707, 42060, 47861, 54022, 60663, 67688, 75225, 83902, 93147, 103108, 113543, 125014, 136995, 149788, 163419, 177760, 192987, 209126, 225871, 243912, 262595, 282108
Offset: 1

Views

Author

Ali Sada, Jun 20 2019

Keywords

Examples

			For n=1, the array is 2, and the sum is 2.
.
.                     2  4
For n=2, the array is      and the sum is 13.
.                     4  3
.
.                     2  4  7
For n=3, the array is 4  3  6 and the sum is 44.
                      7  6  5
		

Crossrefs

Cf. A000040, A007290 (partial sums of n(n-1)), A316322 (sum of "pile of primes").

Programs

  • PARI
    M(i,j) = if (i>=j, prime(i)+i-j, M(j,i));
    a(n) = sum(i=1, n, vecsum(vector(n, k, M(i,k)))); \\ Michel Marcus, Jun 21 2019
    
  • PARI
    A308731_first(N)=vector(N, n, N+=if(n>1, prime(n)*(2*n-1)+n*(n-1), 2-N)) \\ This is a more efficient way to compute the list [a(1), ..., a(N)]
    apply( {A308731(n)=sum(k=1,n,prime(k)*(2*k-1))+2*binomial(n+1,3)}, [1..20]) \\ M. F. Hasler, May 08 2025

Formula

a(n) = a(n-1) + (2n-1)*prime(n) + n*(n-1). - Charlie Neder, Jun 21 2019
a(n) = A316322(n) + A007290(n+1). - M. F. Hasler, May 08 2025

Extensions

Edited by Michel Marcus, Jun 21 2019