OFFSET
0,5
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..65536
Rémy Sigrist, Interactive scatterplot of (a(n), A292372(n), A292373(n)) for n=0..4^8-1 [provided your web browser supports the Plotly library, you should see icons on the top right corner of the page: if you choose "Orbital rotation", then you will be able to rotate the plot alongside three axes, the 3D plot here corresponds to a Sierpiński triangle-based pyramid]
FORMULA
EXAMPLE
MATHEMATICA
Table[FromDigits[IntegerDigits[n, 4] /. k_ /; IntegerQ@ k :> If[k == 1, 1, 0], 2], {n, 0, 112}] (* Michael De Vlieger, Sep 21 2017 *)
PROG
(Scheme, with memoization-macro definec)
(definec (A292371 n) (if (zero? n) n (let ((d (modulo n 4))) (+ (if (= 1 d) 1 0) (* 2 (A292371 (/ (- n d) 4)))))))
(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==1 else '0' for i in k), 2)
print([a(n) for n in range(116)]) # Indranil Ghosh, Sep 21 2017
(Python)
def A292371(n): return int(bin(n&~(n>>1))[:1:-2][::-1], 2) # Chai Wah Wu, Jun 30 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 15 2017
STATUS
approved