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.
%I A024024 #29 Sep 06 2024 14:43:11 %S A024024 1,2,7,24,77,238,723,2180,6553,19674,59039,177136,531429,1594310, %T A024024 4782955,14348892,43046705,129140146,387420471,1162261448,3486784381, %U A024024 10460353182,31381059587,94143178804,282429536457,847288609418,2541865828303,7625597484960,22876792454933 %N A024024 a(n) = 3^n - n. %H A024024 Vincenzo Librandi, <a href="/A024024/b024024.txt">Table of n, a(n) for n = 0..1000</a> %H A024024 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (5,-7,3). %F A024024 From _Vincenzo Librandi_, Mar 06 2013: (Start) %F A024024 G.f.: (1-3*x+4*x^2)/((1-3*x)*(1-x)^2). %F A024024 a(n) = 5*a(n-1) - 7*a(n-2) + 3*a(n-3). (End) %F A024024 E.g.f.: exp(x)*(exp(2*x) - x). - _Elmo R. Oliveira_, Sep 06 2024 %t A024024 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 A024024 (Magma) [3^n - n: n in [0..35]]; // _Vincenzo Librandi_, May 13 2011 %o A024024 (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 A024024 (PARI) a(n)=3^n-n \\ _Charles R Greathouse IV_, Sep 24 2015 %Y A024024 Cf. A000325, A024050. %K A024024 nonn,easy %O A024024 0,2 %A A024024 _N. J. A. Sloane_