%I #26 Nov 07 2024 21:55:10
%S 2,4,4,8,8,8,16,16,16,16,32,32,32,32,32,64,64,64,64,64,64,128,128,128,
%T 128,128,128,128,256,256,256,256,256,256,256,256,512,512,512,512,512,
%U 512,512,512,512,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024
%N Repeat 2^n n times.
%H Reinhard Zumkeller, <a href="/A140513/b140513.txt">Rows n = 0..127 of triangle, flattened</a>
%H Sajed Haque, Chapter 2.6.2 of <a href="https://uwspace.uwaterloo.ca/bitstream/handle/10012/12234/Haque_Sajed.pdf">Discriminators of Integer Sequences</a>, 2017, See p. 34.
%F a(n) = 2*A137688(n).
%F a(n) = A018900(n+1) - A059268(n). - _Reinhard Zumkeller_, Jun 24 2009
%F From _Reinhard Zumkeller_, Feb 28 2010: (Start)
%F Seen as a triangle read by rows: T(n,k)=2^n, 1 <= k <= n.
%F T(n,k) = A173786(n-1,k-1) + A173787(n-1,k-1), 1 <= k <= n. (End)
%F Sum_{n>=0} 1/a(n) = 2. - _Amiram Eldar_, Aug 16 2022
%t t={}; Do[r={}; Do[If[k==0||k==n, m=2^n, m=t[[n, k]] + t[[n, k + 1]]]; r=AppendTo[r, m], {k, 0, n}]; AppendTo[t, r], {n, 0, 10}]; t=Flatten[2 t] (* _Vincenzo Librandi_, Feb 17 2018 *)
%t Table[Table[2^n,n],{n,10}]//Flatten (* _Harvey P. Dale_, Dec 04 2018 *)
%o (Haskell)
%o a140513 n k = a140513_tabl !! (n-1) !! (k-1)
%o a140513_row n = a140513_tabl !! (n-1)
%o a140513_tabl = iterate (\xs@(x:_) -> map (* 2) (x:xs)) [2]
%o a140513_list = concat a140513_tabl
%o -- _Reinhard Zumkeller_, Nov 14 2015
%o (Python)
%o from math import isqrt
%o def A140513(n): return 1<<(m:=isqrt(k:=n+1<<1))+(k>m*(m+1)) # _Chai Wah Wu_, Nov 07 2024
%Y Cf. A000079, A018900, A059268, A111650, A137688.
%K nonn,tabl,changed
%O 0,1
%A _Paul Curtz_, Jul 01 2008