%I #21 Sep 08 2022 08:44:53
%S 1,1,2,0,0,1,2,2,1,0,0,0,0,0,0,0,0,1,2,2,1,0,0,2,1,1,2,0,0,0,0,0,0,0,
%T 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,1,0,0,2,1,1,2,0,0,0,0,0,
%U 0,0,0,2,1,1,2,0,0,1,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
%N An example of a d-perfect sequence.
%H D. Kohel, S. Ling and C. Xing, <a href="http://www.maths.usyd.edu.au/u/kohel/doc/perfect.ps">Explicit Sequence Expansions</a>, in Sequences and their Applications, C. Ding, T. Helleseth, and H. Niederreiter, eds., Proceedings of SETA'98 (Singapore, 1998), 308-317, 1999. DOI: 10.1007/978-1-4471-0551-0_23
%F a(n) = ((-1)^(n+1)*A007317(n)) mod 3 - _Christian G. Bower_, Jun 12 2005
%F a(n) = A001405(n-1) mod 3. - _John M. Campbell_, Jul 19 2016
%t Table[Mod[Binomial[n - 1, Floor[(n - 1)/2]], 3], {n, 120}] (* or *)
%t Table[Function[n, Mod[-(-1)^(n + 1) Sum[Binomial[n, k] CatalanNumber@ k, {k, 0, n}], 3]][n - 1], {n, 120}] (* _Michael De Vlieger_, Jul 19 2016 *)
%o (Magma) [Binomial(n, Floor(n/2)) mod 3: n in [0..140]]; // _Vincenzo Librandi_, Jul 20 2016
%K nonn
%O 1,3
%A _N. J. A. Sloane_.
%E More terms from _Christian G. Bower_, Jun 12 2005