OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = sum(k=floor(n/2)...n+1, A000040(n+(k+1)*(k+2)/2-k) ). - Ralf Stephan, Mar 09 2014
EXAMPLE
2 3
0 5 7 11
0 0 13 17 19 23
0 0 0 29 31 37 41 43
0 0 0 0 47 53 59 61 67 71
0 0 0 0 0 73 79 83 89 97 101 103
........................................................
sum of the first column = 2.
sum of the second column = 3 + 5 = 8.
sum of the third column = 7 + 13 = 20.
sum of the fourth column = 11 + 17 + 29 = 57.
sum of the fifth column = 19 + 31 + 47 = 97.
.............................................
MAPLE
with(numtheory):nn:=50:mm:=500:T:=array(1..nn, 1..mm):for i from 1 to nn do:for j from 1 to mm do:T[i, j]:=0:od:od:m:=0:for n from 1 to nn do: for k from n to 2*n do: m:=m+1:T[n, k]:=ithprime(m):od:od:for p from 1 to nn do : s:=sum('T[q, p]', 'q'=1..nn): printf(`%d, `, s):od:
MATHEMATICA
With[{nn=50}, PadRight[#, nn]&/@(Join[Table[0, Length[#]-2], #]&/@ TakeList[ Prime[Range[((nn-1)(2+nn))/2]], Range[2, nn]])]//Total (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Feb 16 2018 *)
PROG
(Sage)
def a(n):
return sum([nth_prime((k+1)*(k+2)/2+n-k) for k in range(floor(n/2), n+1)])
# Ralf Stephan, Mar 09 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Mar 05 2014
STATUS
approved