cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A362057 Number of compositions of n that are anti-palindromic modulo 3.

This page as a plain text file.
%I A362057 #26 May 10 2023 00:11:58
%S A362057 1,1,1,3,5,7,15,27,43,81,147,249,449,809,1409,2507,4485,7903,14015,
%T A362057 24963,44187,78329,139203,246801,437601,776881,1378081,2444083,
%U A362057 4337125,7694487,13648655,24215947,42962283,76213761,135212947,239883849,425562849,754987929
%N A362057 Number of compositions of n that are anti-palindromic modulo 3.
%C A362057 A composition (c(1), c(2), ..., c(k)) is anti-palindromic modulo 3 if c(i) and c(k+1-i) are not congruent modulo 3 whenever 1 <= i <= k/2.
%H A362057 Jia Huang, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL26/Huang/huang8.html">Partially Palindromic Compositions</a>, Journal of Integer Sequences, Vol. 26 (2023), Article 23.4.1.
%H A362057 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,3,-1).
%F A362057 a(n) = Sum_{3*i + j + 2*r + 2*s + 3*d = n} (-1)^r * 2^i * binomial(i+j,j) * binomial(i,r) * binomial(i+s-1,s) * binomial(i+d-1,d).
%F A362057 G.f.: (1 - x^3)/(1 - x - 3*x^3 + x^4).
%e A362057 There are a(5) = 7 compositions of n = 5 that are anti-palindromic modulo 3: 5, 32, 23, 311, 113, 221, 122. Note that 41 and 14 are anti-palindromic but not anti-palindromic modulo 3.
%o A362057 (PARI) a(n) = {sum(i=0, n\3,  sum(d=0, (n-3*i)\3, sum(s=0, (n-3*i-3*d)\2, 2^i * binomial(i+s-1,s) * binomial(i+d-1,d) * sum(r=0, (n-3*i-3*d-2*s)\2, my(j=n-3*i-3*d-2*s-2*r); (-1)^r * binomial(i+j,j) * binomial(i,r) ))))} \\ _Andrew Howroyd_, Apr 10 2023
%o A362057 (PARI) Vec((1 - x^3)/(1 - x - 3*x^3 + x^4) + O(x^41)) \\ _Andrew Howroyd_, Apr 11 2023
%o A362057 (PARI) my(p=Mod('x, 'x^4-'x^3-3*'x+1)); a(n) = vecsum(Vec(lift(p^(n+1)))); \\ _Kevin Ryde_, Apr 12 2023
%Y A362057 Cf. A000213 (anti-palindromic compositions), A362055.
%K A362057 nonn,easy
%O A362057 0,4
%A A362057 _Jia Huang_, Apr 06 2023