(Translated by https://www.hiragana.jp/)
A103542 - OEIS
login
Binary equivalents of A102370.
5

%I #26 Dec 07 2019 12:18:24

%S 0,11,110,101,100,1111,1010,1001,1000,1011,1110,1101,11100,10111,

%T 10010,10001,10000,10011,10110,10101,10100,11111,11010,11001,11000,

%U 11011,11110,111101,101100,100111,100010,100001,100000,100011,100110,100101

%N Binary equivalents of A102370.

%C The number of 1's in the n-th term appears to match A089400. - _Benoit Cloitre_, Mar 24 2005

%H Vincenzo Librandi, <a href="/A103542/b103542.txt">Table of n, a(n) for n = 0..2000</a>

%H David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL8/Sloane/sloane300.html">Sloping binary numbers: a new sequence related to the binary numbers</a>, J. Integer Seq. 8 (2005), no. 3, Article 05.3.6, 15 pp.

%H D. Applegate et al., <a href="https://arxiv.org/abs/math/0505295">Sloping Binary Number, A New Sequence Related to the Binary Numbers</a>, arXiv:math/0505295 [math.NT], 2005.

%t f[n_] := Block[{k = 1, s = 0, l = Max[2, Floor[Log[2, n + 1] + 2]]}, While[k < l, If[ Mod[n + k, 2^k] == 0, s = s + 2^k]; k++ ]; s]; Table[ FromDigits[ IntegerDigits[f[n] + n, 2]], {n, 0, 35}] (* _Robert G. Wilson v_, Mar 23 2005 *)

%o (Python)

%o def a(n): return '0' if n<1 else bin(sum([(n + k)&(2**k) for k in range(len(bin(n)[2:]) + 1)]))[2:] # _Indranil Ghosh_, May 03 2017

%K nonn,easy,base

%O 0,2

%A _N. J. A. Sloane_, Mar 23 2005

%E More terms from _Robert G. Wilson v_ and _Benoit Cloitre_, Mar 23 2005