OFFSET
1,1
COMMENTS
LINKS
G. C. Greubel, Rows n=1..100 of triangle, flattened
FORMULA
EXAMPLE
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).
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 *)
PROG
(PARI) a(n, k)=my(s); forprime(p=prime(k), prime(n), s+=p); s \\ Charles R Greathouse IV, Jul 25 2011
(Magma) [[(&+[NthPrime(j): j in [k..n]]): k in [1..n]]: n in [1..15]]; // G. C. Greubel, Oct 15 2018
CROSSREFS
KEYWORD
AUTHOR
Gary W. Adamson & Roger L. Bagula, Jul 26 2008
EXTENSIONS
Corrected by Hanke Bremer, Nov 28 2008
STATUS
approved