|
|
|
|
0, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 4, 4, 3, 0, 0, 5, 2, 2, 5, 0, 0, 3, 4, 4, 1, 0, 4, 1, 0, 0, 3, 2, 2, 3, 8, 8, 5, 4, 4, 1, 0, 0, 1, 4, 4, 5, 8, 8, 3, 2, 2, 3, 0, 0, 1, 4, 0, 1, 6, 2, 1, 4, 8, 9, 4, 4, 11, 2, 2, 1, 0, 8, 1, 2, 10, 3, 0, 0, 5, 0, 0, 1, 0, 0, 3, 0, 0, 9, 2, 2, 9, 0, 0, 3, 0, 0, 1, 0, 0, 5, 0, 0, 3, 10, 2, 1, 8, 0, 1, 2, 2, 11, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,6
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[BitAnd[a[n - 1], a@ n], {n, 120}] (* Michael De Vlieger, Mar 22 2017 *)
|
|
PROG
|
(PARI) A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
for(n=1, 120, print1(bitand(A(n - 1), A(n)), ", ")) \\ Indranil Ghosh, Mar 23 2017
(Python)
from functools import reduce
def A283988(n): return sum(reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(n)[-1:2:-1], (1, 0)))&sum(reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(n-1)[-1:2:-1], (1, 0))) if n>1 else 0 # Chai Wah Wu, May 05 2023
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|