A343611 Partial sums of A345967.
0, 2, 1, 6, 3, 9, 5, 12, 4, 16, 7, 18, 8, 23, 10, 27, 13, 29, 11, 33, 14, 35, 15, 40, 17, 43, 19, 47, 20, 50, 21, 53, 22, 57, 24, 60, 26, 63, 25, 67, 28, 71, 31, 75, 34, 79, 32, 78, 30, 85, 36, 87, 37, 90, 38, 95, 41, 97, 39, 101, 42, 105, 45, 109, 48, 113, 46, 112, 44, 118, 49, 121, 51
Offset: 0
Keywords
Crossrefs
Cf. A345967.
Programs
-
PARI
A343611_vec(Nmax, P=0)={ my(US=[0], UP=[P], used(x, U)= setsearch(U, x) || x<=U[1], insert(x, U)= U=setunion(U, [x]); while(#U>1&&U[2]==U[1]+1, U=U[^1]); U); vector(Nmax, n, my(s=(-1)^n); for(S=US[1]+1, oo, (used(S, US) || used(P-s*S, UP))&&next; if(s<0, my(f=1); for(PP=UP[1]+1, P+S-1, used(PP, UP) || used(P+S-PP, US) || PP==P || [f=0; break]); f && next); UP=insert(P-=s*S, UP); US=insert(S, US); break); P)} \\ Gives the vector a(1..Nmax), i.e., without a(0)=0.
Formula
a(n) = Sum_{k=1..n} -(-1)^n * A345967(k), n >= 0.
Comments