login
A242278
Number of non-palindromic n-tuples of 3 distinct elements.
4
0, 6, 18, 72, 216, 702, 2106, 6480, 19440, 58806, 176418, 530712, 1592136, 4780782, 14342346, 43040160, 129120480, 387400806, 1162202418, 3486725352, 10460176056, 31380882462, 94142647386, 282429005040, 847287015120, 2541864234006, 7625592702018, 22876787671992
OFFSET
1,2
FORMULA
a(n) = 1/2 * 3^(n/2) * ((sqrt(3)-1)*(-1)^n - sqrt(3)-1) + 3^n.
a(n) = 3^n - 3^ceiling(n/2).
a(n) = A000244(n) - A056449(n).
G.f.: (6*x) / (1 - 3*x - 3*x^2 + 9*x^3).
a(n) = 6*A167993(n). [Bruno Berselli, Aug 19 2014]
EXAMPLE
For n=3, the a(3)=18 solutions (non-palindromic 3-tuples) are:
{0,0,1}, {0,0,2}, {0,1,1}, {0,1,2}, {0,2,1}, {0,2,2}, {1,0,0}, {1,0,2},
{1,1,0}, {1,1,2}, {1,2,0}, {1,2,2}, {2,0,0}, {2,0,1}, {2,1,0}, {2,1,1},
{2,2,0}, {2,2,1}.
MAPLE
A242278:=n->(1/2)* 3^(n/2) * ((sqrt(3)-1) * (-1)^n - sqrt(3)-1) + 3^n: seq(A242278(n), n=1..28); # Wesley Ivan Hurt, Aug 17 2014.
MATHEMATICA
Table[1/2 * 3^(n/2) * ((Sqrt(3)-1) * (-1)^n - Sqrt(3)-1) + 3^n, {n, 28}]
PROG
(PARI) a(n)=3^n-3^ceil(n/2) \\ Charles R Greathouse IV, Dec 10 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mikk Heidemaa, Aug 16 2014
STATUS
approved