login
(0,1)-sequence where n-th run has length n^2.
2

%I #7 Jul 06 2016 09:37:07

%S 0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,

%T 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,

%U 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0

%N (0,1)-sequence where n-th run has length n^2.

%C a(n) = A161385(n) - 1. - _Reinhard Zumkeller_, Aug 10 2014

%H Reinhard Zumkeller, <a href="/A161382/b161382.txt">Table of n, a(n) for n = 1..10000</a>

%t Table[{Table[0,n^2],Table[1,(n+1)^2]},{n,1,7,2}]//Flatten (* _Harvey P. Dale_, Jul 06 2016 *)

%o (Haskell)

%o a161382 n = a161382_list !! (n-1)

%o a161382_list = concatMap (\x -> replicate (x ^ 2) (1 - mod x 2)) [1..]

%o -- _Reinhard Zumkeller_, Aug 10 2014

%Y Cf. A161385.

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Nov 29 2009