OFFSET
0,17
LINKS
EXAMPLE
MATHEMATICA
Table[FromDigits[IntegerDigits[n, 4] /. k_ /; IntegerQ@ k :> If[k == 0, 1, 0], 2], {n, 0, 120}] (* Michael De Vlieger, Sep 21 2017 *)
PROG
(Scheme) (define (A292370 n) (if (zero? n) n (let loop ((n n) (b 1) (s 0)) (if (< n 4) s (let ((d (modulo n 4))) (if (zero? d) (loop (/ n 4) (+ b b) (+ s b)) (loop (/ (- n d) 4) (+ b b) s)))))))
(Python)
from sympy.ntheory.factor_ import digits
def a(n):
k=digits(n, 4)[1:]
return 0 if n==0 else int("".join('1' if i==0 else '0' for i in k), 2)
print([a(n) for n in range(111)]) # Indranil Ghosh, Sep 21 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 15 2017
STATUS
approved