%I #14 Jan 21 2021 18:33:42
%S 1,10,111,10,11101,111000,1001101,1011110,11011110,1111100001,
%T 11001010,11101001010,1101101011111,11001110101,101111100111011,
%U 1110111111000001,1100010100011,100100100101100110,1001111010001010011
%N Concatenate all natural numbers starting with 1 in binary like this 11011100101110111100010011010..., then a(n) = the number formed from the next n digits (by dropping leading zeros). 1, 10, 111, 0010, 11101, 111000, ... 1, 10, 111, 10, 11101, 111000, ...
%H John Cerkan, <a href="/A100751/b100751.txt">Table of n, a(n) for n = 1..996</a>
%e 1, 10, 111, 0010, 11101, 111000, ... becomes
%e 1, 10, 111, 10, 11101, 111000, ...
%t d = Flatten[ Table[ IntegerDigits[n, 2], {n, 45}]]; Table[ FromDigits[ Take[d, {n(n + 1)/2 + 1, (n + 1)(n + 2)/2}]], {n, 0, 18}] (* _Robert G. Wilson v_, Nov 22 2004 *)
%t Module[{nn=50,b,x},b=Flatten[IntegerDigits[Range[nn],2]];x = Floor[ (Sqrt[1+8 Length[ b]]-1)/2];FromDigits[#]&/@TakeList[b,Range[x]]] (* Requires Mathematica version 11 or later *) (* _Harvey P. Dale_, Jan 21 2021 *)
%Y Cf. A066547, A100489.
%K base,easy,nonn
%O 1,2
%A _Amarnath Murthy_, Nov 20 2004
%E More terms from _Robert G. Wilson v_, Nov 22 2004
|