login
A352255
Write down the prime numbers 2,3,5,... and write below each one the preceding nonprimes greater than the previous prime, in decreasing order. Sums of the antidiagonals give the terms of the sequence.
1
2, 4, 5, 11, 17, 23, 38, 43, 56, 65, 80, 114, 103, 143, 186, 170, 188, 214, 234, 242, 311, 338, 292, 310, 342, 439, 458, 487, 490, 418, 434, 458, 502, 528, 673, 555, 708, 717, 748, 916, 1089, 1263, 1132, 982, 921, 757, 791, 813, 843, 1068, 1296, 1302, 1133, 1379, 1162
OFFSET
1,1
LINKS
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
Cf. A102370.
Sequence in context: A366702 A089416 A056817 * A192581 A095023 A049913
KEYWORD
nonn
AUTHOR
Tamas Sandor Nagy, Mar 09 2022
STATUS
approved