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.

A143121 Triangle read by rows, T(n,k) = Sum_{j=k..n} prime(j), 1 <= k <= n.

Original entry on oeis.org

2, 5, 3, 10, 8, 5, 17, 15, 12, 7, 28, 26, 23, 18, 11, 41, 39, 36, 31, 24, 13, 58, 56, 53, 48, 41, 30, 17, 77, 75, 72, 67, 60, 49, 36, 19, 100, 98, 95, 90, 83, 72, 59, 42, 23, 129, 127, 124, 119, 112, 101, 88, 71, 52, 29, 160, 158, 155, 150, 143, 132, 119, 102, 83, 60, 31
Offset: 1

Views

Author

Keywords

Comments

Left border = A007504, sum of first n primes: (2, 5, 10, 27, 28, 41, ...).
Right border = primes = A000040.
Row sums = A014285: (2, 8, 23, 51, 106, 184, ...).

Examples

			First few rows of the triangle are:
   2;
   5,  3;
  10,  8,  5;
  17, 15, 12,  7;
  28, 26, 23, 18, 11;
  41, 39, 36, 31, 24, 13;
  58, 56, 53, 48, 41, 30, 17;
  ...
T(5,3) = 23 = prime(3) + prime(4) + prime(5) = (5 + 7 + 11).
		

Crossrefs

Cf. A194939 (rows reversed).

Programs

  • Magma
    [[(&+[NthPrime(j): j in [k..n]]): k in [1..n]]: n in [1..15]]; // G. C. Greubel, Oct 15 2018
  • Maple
    a:=proc(n,k) add(ithprime(j),j=k..n) end: seq(seq(a(n,k),k=1..n),n=1..11); # Muniru A Asiru, Oct 15 2018
  • Mathematica
    a[n_, k_] := a[n, k] = Plus@@Prime[Range[n - k + 1, n]]; Column[Table[a[n, k], {n, 15}, {k, n, 1, -1}], Center] (* Alonso del Arte, Jul 25 2011 *)
    Table[Sum[Prime[j], {j, k, n}], {n, 1, 15}, {k, 1, n}]//Flatten (* G. C. Greubel, Oct 15 2018 *)
  • PARI
    a(n,k)=my(s);forprime(p=prime(k),prime(n),s+=p);s \\ Charles R Greathouse IV, Jul 25 2011
    

Formula

T(n,k) = Sum_{j=k..n} prime(j), 1 <= k <= n, primes = A000040.
Equals A000012 * (A000040 * 0^(n-k)) * A000012.

Extensions

Corrected by Hanke Bremer, Nov 28 2008