%I #29 May 25 2022 03:39:19
%S 2,4,5,11,17,23,38,43,56,65,80,114,103,143,186,170,188,214,234,242,
%T 311,338,292,310,342,439,458,487,490,418,434,458,502,528,673,555,708,
%U 717,748,916,1089,1263,1132,982,921,757,791,813,843,1068,1296,1302,1133,1379,1162
%N 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.
%H Rémy Sigrist, <a href="/A352255/b352255.txt">Table of n, a(n) for n = 1..10000</a>
%e a(4) = 4 + 7 = 11;
%e a(7) = 9 + 12 + 17 = 38.
%e The initial table for calculating the terms of the sequence is shown below. The terms are the sums of numbers on the antidiagonals.
%e .
%e Antidiagonal sums: 2 4 5 11 17 23 38 43 56 65
%e / / / / / / / / / /
%e / / / / / / / / / /
%e primes: 2 3 5 7 11 13 17 19 23 29 ...
%e | / | /| /| /| /| /| /| /|
%e |/ |/ |/ |/ |/ |/ |/ |/ |
%e 1 4 6 10 12 16 18 22 28 ...
%e | / /| / /| /|
%e |/ / |/ / |/ |
%e 9 / 15 / 21 27 ...
%e | / | / | /|
%e |/ |/ |/ |
%e 8 14 20 26 ...
%e |
%e |
%e 25 ...
%e |
%e |
%e 24 ...
%o (MATLAB)
%o function a = A352255( max_p )
%o p = primes(max_p);
%o a = zeros(1,length(p));
%o while sum(p) > 0
%o a = a+p;
%o p = [0 p(1:end-1)];
%o p = p-1;
%o p(p<0) = 0;
%o p(isprime(p)) = 0;
%o end
%o end % _Thomas Scheuerle_, Mar 10 2022
%o (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
%Y Cf. A102370.
%K nonn
%O 1,1
%A _Tamas Sandor Nagy_, Mar 09 2022