A058481 a(n) = 3^n - 2.
1, 7, 25, 79, 241, 727, 2185, 6559, 19681, 59047, 177145, 531439, 1594321, 4782967, 14348905, 43046719, 129140161, 387420487, 1162261465, 3486784399, 10460353201, 31381059607, 94143178825, 282429536479, 847288609441
Offset: 1
Examples
G.f. = x + 7*x^2 + 25*x^3 + 79*x^4 + 241*x^5 + 727*x^6 + 2185*x^7 + 6559*x^8 + ... a(1) = 1; a(2) = 3 + 1 + 3 = 7; a(3) = 9 + 3 + 1 + 3 + 9 = 25; a(4) = 27 + 9 + 3 + 1 + 3 + 9 + 27 = 79; etc. - _Philippe Deléham_, Feb 24 2014
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- John Elias, Illustration: Union of Triple-Sierpinski Triangles
- Index entries for linear recurrences with constant coefficients, signature (4,-3).
Crossrefs
Programs
-
Maple
A058481:=n->3^n-2; seq(A058481(n), n=1..30); # Wesley Ivan Hurt, Mar 24 2014
-
Mathematica
a=1;lst={a};Do[a=a*3+4;AppendTo[lst,a],{n,0,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Dec 25 2008 *) 3^Range[30]-2 (* Harvey P. Dale, Mar 28 2011 *) LinearRecurrence[{4, -3}, {1, 7}, 25] (* G. C. Greubel, Aug 25 2016 *)
-
PARI
a(n)=3^n-2 \\ Charles R Greathouse IV, Feb 06 2017
-
PARI
{a(n) = if( n<1, 0, 3^n - 2)}; /* Michael Somos, Feb 17 2017 */
Formula
Number of m X n binary matrices with no zero rows or columns is Sum_{j=0..m} (-1)^j*C(m, j)*(2^(m-j)-1)^n.
From Mohammad K. Azarian, Jan 14 2009: (Start)
G.f.: 1/(1-3*x)-2/(1-x)+1.
E.g.f.: e^(3*x)-2*(e^x)+1. (End)
a(n) = 3*a(n-1) + 4 (with a(1)=1). - Vincenzo Librandi, Aug 07 2010
a(n) = 4*a(n-1) - 3*a(n-2). - G. C. Greubel, Aug 25 2016
Extensions
More terms from Larry Reeves (larryr(AT)acm.org), Dec 04 2000
Comments