The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A024024 a(n) = 3^n - n. 14

%I

%S 1,2,7,24,77,238,723,2180,6553,19674,59039,177136,531429,1594310,

%T 4782955,14348892,43046705,129140146,387420471,1162261448,3486784381,

%U 10460353182,31381059587,94143178804,282429536457,847288609418

%N a(n) = 3^n - n.

%H Vincenzo Librandi, <a href="/A024024/b024024.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec">Index entries for linear recurrences with constant coefficients</a>, signature (5,-7,3).

%F G.f.: (1-3*x+4*x^2)/((1-3*x)*(1-x)^2). - _Vincenzo Librandi_, Mar 06 2013

%F a(n) = 5*a(n-1) - 7*a(n-2) + 3*a(n-3). - _Vincenzo Librandi_, Mar 06 2013

%t Table[3^n - n, {n, 0, 40}] (* or *) CoefficientList[Series[(1 - 3 x + 4 x^2)/((1 - 3 x)(1 - x)^2), {x, 0, 30}], x] (* _Vincenzo Librandi_, Mar 06 2013 *)

%o (MAGMA) [3^n - n: n in [0..35]]; // _Vincenzo Librandi_, May 13 2011

%o (MAGMA) I:=[1, 2, 7]; [n le 3 select I[n] else 5*Self(n-1)-7*Self(n-2)+3*Self(n-3): n in [1..30]]; // _Vincenzo Librandi_, Mar 06 2013

%o (PARI) a(n)=3^n-n \\ _Charles R Greathouse IV_, Sep 24 2015

%Y Cf. A000325, A024050.

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 27 09:09 EDT 2020. Contains 337380 sequences. (Running on oeis4.)