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.

Showing 1-3 of 3 results.

A107767 a(n) = (1 + 3^n - 2*3^(n/2))/4 if n is even, (1 + 3^n - 4*3^((n-1)/2))/4 if n odd.

Original entry on oeis.org

0, 1, 4, 16, 52, 169, 520, 1600, 4840, 14641, 44044, 132496, 397852, 1194649, 3585040, 10758400, 32278480, 96845281, 290545684, 871666576, 2615029252, 7845176329, 23535617560, 70607118400, 211821620920, 635465659921
Offset: 1

Views

Author

Emeric Deutsch, Jun 12 2005

Keywords

Comments

a(n-1) is the number of chiral pairs of color patterns (set partitions) for a row of length n using up to 3 colors (subsets). For n=4, a(n-1)=4, the chiral pairs are AAAB-ABBB, AABA-ABAA, AABC-ABCC, and ABAC-ABCB. - Robert A. Russell, Oct 28 2018

References

  • Balaban, A. T., Brunvoll, J., Cyvin, B. N., & Cyvin, S. J. (1988). Enumeration of branched catacondensed benzenoid hydrocarbons and their numbers of KekulĂ© structures. Tetrahedron, 44(1), 221-228. See Eq. 5.

Crossrefs

Cf. A167993 (first differences).
Column 3 of A320751, offset by 1.
Cf. A124302 (oriented), A001998 (unoriented), A182522 (achiral), varying offsets.

Programs

  • GAP
    a:=[];; for n in [1..30] do if n mod 2 <> 0 then Add(a,(1+3^n-4*3^((n-1)/2))/4); else Add(a,(1+3^n-2*3^(n/2))/4); fi; od; a; # Muniru A Asiru, Oct 30 2018
  • Magma
    I:=[0, 1, 4, 16]; [n le 4 select I[n] else 4*Self(n-1)-12*Self(n-3)+9*Self(n-4): n in [1..30]]; // Vincenzo Librandi, Jun 26 2012
    
  • Maple
    a:=proc(n) if n mod 2 = 0 then (1+3^n-2*3^(n/2))/4 else (1+3^n-4*3^((n-1)/2))/4 fi end: seq(a(n),n=1..32);
  • Mathematica
    CoefficientList[Series[-x/((x-1)*(3*x-1)*(3*x^2-1)),{x,0,40}],x] (* or *) LinearRecurrence[{4,0,-12,9},{0,1,4,16},50] (* Vincenzo Librandi, Jun 26 2012 *)
    Ach[n_, k_] := Ach[n, k] = If[n<2, Boole[n==k && n>=0], k Ach[n-2,k] + Ach[n-2,k-1] + Ach[n-2,k-2]] (* A304972 *)
    k=3; Table[Sum[StirlingS2[n,j]-Ach[n,j],{j,k}]/2,{n,2,40}] (* Robert A. Russell, Oct 28 2018 *)
    CoefficientList[Series[(1/12 E^(-Sqrt[3] x) (-3 + 2 Sqrt[3] - (3 + 2 Sqrt[3]) E^(2 Sqrt[3] x) + 3 E^((3 + Sqrt[3]) x) + 3 E^(x + Sqrt[3] x)))/x, {x, 0, 20}], x]*Table[(k+1)!, {k, 0, 20}] (* Stefano Spezia, Oct 29 2018 *)
  • PARI
    x='x+O('x^50); concat(0, Vec(x^2/((1-x)*(3*x-1)*(3*x^2-1)))) \\ Altug Alkan, Sep 23 2018
    

Formula

G.f.: -x^2 / ( (x-1)*(3*x-1)*(3*x^2-1) ). - R. J. Mathar, Dec 16 2010
a(n) = 4*a(n-1) - 12*a(n-3) + 9*a(n-4). - Vincenzo Librandi, Jun 26 2012
From Robert A. Russell, Oct 28 2018: (Start)
a(n-1) = Sum_{j=0..k} (S2(n,j) - Ach(n,j)) / 2, where k=3 is the maximum number of colors, S2 is the Stirling subset number A008277, and Ach(n,k) = [n>=0 & n<2 & n==k] + [n>1]*(k*Ach(n-2,k) + Ach(n-2,k-1) + Ach(n-2,k-2)).
a(n-1) = (A124302(n) - A182522(n))/2.
a(n-1) = A124302(n) - A001998(n-1).
a(n-1) = A001998(n-1) - A182522(n).
a(n-1) = A122746(n-2) + A320526(n). (End)
E.g.f.: (1/12)*exp(-sqrt(3)*x)*(-3 + 2*sqrt(3) - (3 + 2*sqrt(3))*exp(2*sqrt(3)*x) + 3*exp((3 + sqrt(3))*x) + 3*exp(x + sqrt(3)*x)). - Stefano Spezia, Oct 29 2018
From Bruno Berselli, Oct 31 2018: (Start)
a(n) = (1 + 3^n - 3^((n-1)/2)*(4 + (-2 + sqrt(3))*(1 + (-1)^n)))/4. Therefore:
a(2*k) = (3^k - 1)^2/4;
a(2*k+1) = (3^k - 1)*(3^(k+1) - 1)/4. (End)

Extensions

Entry revised by N. J. A. Sloane, Jul 29 2011

A242278 Number of non-palindromic n-tuples of 3 distinct elements.

Original entry on oeis.org

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

Views

Author

Mikk Heidemaa, Aug 16 2014

Keywords

Examples

			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}.
		

Crossrefs

Programs

  • 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}]
  • PARI
    a(n)=3^n-3^ceil(n/2) \\ Charles R Greathouse IV, Dec 10 2014

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]

A107660 Sum 3^max(k,n-k),k=0..n.

Original entry on oeis.org

1, 6, 21, 72, 225, 702, 2133, 6480, 19521, 58806, 176661, 530712, 1592865, 4780782, 14344533, 43040160, 129127041, 387400806, 1162222101, 3486725352, 10460235105, 31380882462, 94142824533, 282429005040, 847287546561
Offset: 0

Views

Author

Keywords

Comments

Third column of A107661.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1 + 3 x) / ((1 - 3 x) (1 - 3 x^2)), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 17 2013 *)

Formula

G.f.: (1+3*x)/((1-3*x)*(1-3*x^2)).
a(2n) = 3^(2n+1) - 2*3^n; a(2n+1) = 9^(n+1) - 3^(n+1).
a(n) = A167993(n+2) + 3*A167993(n+1). - R. J. Mathar, Aug 16 2013
Showing 1-3 of 3 results.