OFFSET
1,1
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 4 + 7 = 11;
a(7) = 9 + 12 + 17 = 38.
The initial table for calculating the terms of the sequence is shown below. The terms are the sums of numbers on the antidiagonals.
.
Antidiagonal sums: 2 4 5 11 17 23 38 43 56 65
/ / / / / / / / / /
/ / / / / / / / / /
primes: 2 3 5 7 11 13 17 19 23 29 ...
| / | /| /| /| /| /| /| /|
|/ |/ |/ |/ |/ |/ |/ |/ |
1 4 6 10 12 16 18 22 28 ...
| / /| / /| /|
|/ / |/ / |/ |
9 / 15 / 21 27 ...
| / | / | /|
|/ |/ |/ |
8 14 20 26 ...
|
|
25 ...
|
|
24 ...
PROG
(MATLAB)
function a = A352255( max_p )
p = primes(max_p);
a = zeros(1, length(p));
while sum(p) > 0
a = a+p;
p = [0 p(1:end-1)];
p = p-1;
p(p<0) = 0;
p(isprime(p)) = 0;
end
end % Thomas Scheuerle, Mar 10 2022
(PARI) { for (n=1, #a=vector(55), m = n; forstep (v=prime(n), if (n==1, 1, prime(n-1)+1), -1, a[m]+=v; if (m++>#a, break)); print1 (a[n]", ")) } \\ Rémy Sigrist, Mar 12 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Tamas Sandor Nagy, Mar 09 2022
STATUS
approved