login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A328107
Binary weight of A327973.
6
2, 4, 5, 6, 7, 8, 9, 13, 11, 13, 13, 14, 17, 18, 19, 23, 20, 23, 24, 27, 26, 24, 23, 30, 31, 29, 29, 31, 36, 35, 36, 37, 35, 34, 35, 42, 40, 46, 41, 50, 54, 48, 52, 47, 47, 53, 47, 51, 51, 54, 48, 51, 60, 55, 56, 64, 61, 60, 59, 68, 71, 67, 65, 78, 64, 63, 68, 72, 70, 74, 79, 89, 85, 77, 85, 76, 79, 83, 78, 90, 97, 82, 87, 81
OFFSET
1,1
FORMULA
a(n) = A000120(A327973(n)) = A000120(A110240(n) XOR 2*A110240(n-1)).
PROG
(PARI)
A269160(n) = bitxor(n, bitor(2*n, 4*n)); \\ From A269160.
A110240(n) = if(!n, 1, A269160(A110240(n-1)));
A327973(n) = bitxor(A110240(n), 2*A110240(n-1));
A328107(n) = hammingweight(bitxor(A110240(n), 2*A110240(n-1)));
\\ Use this one for writing b-files:
A328107write(up_to) = { my(s=1, t, n=0); for(n=1, up_to, t = A269160(s); write("b328107.txt", n, " ", hammingweight(bitxor(2*s, t))); s = t); };
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 05 2019
STATUS
approved