HP Forums
(38G) OEIS A065359: (Alternating Bit Sum) & Partial sums - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (38G) OEIS A065359: (Alternating Bit Sum) & Partial sums (/thread-8808.html)



(38G) OEIS A065359: (Alternating Bit Sum) & Partial sums - Gerald H - 08-10-2017 08:07 AM

A programme to insert symbolics in the Sequence App to reproduce the sequence

https://oeis.org/A065359

& its partial sums

https://oeis.org/A005536

Code:

A065359

RECURSE(U,N MOD 2-U1(U3(N)),1,-1)►U1(N):
CHECK 1:
RECURSE(U,U3(N)-IFTE(N MOD 2,2*U2(U3(N))-1,U2(U3(N))+U2(U3(N)-1)),1,0)►U2(N):
CHECK 2:
RECURSE(U,INT(N/2),0,1)►U3(N):