cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A292370 A binary encoding of the zeros in base-4 representation of n.

This page as a plain text file.
%I A292370 #21 May 15 2021 06:16:58
%S A292370 0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,3,2,2,2,1,0,0,0,1,0,0,0,1,0,0,0,3,2,
%T A292370 2,2,1,0,0,0,1,0,0,0,1,0,0,0,3,2,2,2,1,0,0,0,1,0,0,0,1,0,0,0,7,6,6,6,
%U A292370 5,4,4,4,5,4,4,4,5,4,4,4,3,2,2,2,1,0,0,0,1,0,0,0,1,0,0,0,3,2,2,2,1,0,0,0,1,0,0,0,1,0,0,0,3,2,2,2,1,0,0,0,1
%N A292370 A binary encoding of the zeros in base-4 representation of n.
%H A292370 Antti Karttunen, <a href="/A292370/b292370.txt">Table of n, a(n) for n = 0..65536</a>
%H A292370 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A292370 For all n >= 0, A000120(a(n)) = A160380(n).
%e A292370    n      a(n)     base-4(n)  binary(a(n))
%e A292370                   A007090(n)  A007088(a(n))
%e A292370   --      ----    ----------  ------------
%e A292370    1        0          1           0
%e A292370    2        0          2           0
%e A292370    3        0          3           0
%e A292370    4        1         10           1
%e A292370    5        0         11           0
%e A292370    6        0         12           0
%e A292370    7        0         13           0
%e A292370    8        1         20           1
%e A292370    9        0         21           0
%e A292370   10        0         22           0
%e A292370   11        0         23           0
%e A292370   12        1         30           1
%e A292370   13        0         31           0
%e A292370   14        0         32           0
%e A292370   15        0         33           0
%e A292370   16        3        100          11
%e A292370   17        2        101          10
%t A292370 Table[FromDigits[IntegerDigits[n, 4] /. k_ /; IntegerQ@ k :> If[k == 0, 1, 0], 2], {n, 0, 120}] (* _Michael De Vlieger_, Sep 21 2017 *)
%o A292370 (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)))))))
%o A292370 (Python)
%o A292370 from sympy.ntheory.factor_ import digits
%o A292370 def a(n):
%o A292370     k=digits(n, 4)[1:]
%o A292370     return 0 if n==0 else int("".join('1' if i==0 else '0' for i in k), 2)
%o A292370 print([a(n) for n in range(111)]) # _Indranil Ghosh_, Sep 21 2017
%Y A292370 Cf. A007088, A007090, A160380, A292371, A292372, A292373.
%Y A292370 Cf. A291770 (analogous sequence for base-3).
%K A292370 nonn,base
%O A292370 0,17
%A A292370 _Antti Karttunen_, Sep 15 2017