OFFSET
0,4
REFERENCES
E. Dijkstra, Selected Writings on Computing, Springer, 1982, p. 232 (sequence is called fusc).
LINKS
E. W. Dijkstra, An exercise for Dr. R. M. Burstall
E. W. Dijkstra, More about the function ``fusc''
PROG
(Python)
from functools import reduce
def A071412(n): return sum(reduce(lambda x, y:(x[0], (x[0]+x[1])%3) if int(y) else ((x[0]+x[1])%3, x[1]), bin(n)[-1:2:-1], (1, 0)))%3 if n else 0 # Chai Wah Wu, May 18 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 15 2002
STATUS
approved