login
A166522
a(n) = 7*n - a(n-1), with a(1) = 1.
8
1, 13, 8, 20, 15, 27, 22, 34, 29, 41, 36, 48, 43, 55, 50, 62, 57, 69, 64, 76, 71, 83, 78, 90, 85, 97, 92, 104, 99, 111, 106, 118, 113, 125, 120, 132, 127, 139, 134, 146, 141, 153, 148, 160, 155, 167, 162, 174, 169, 181, 176, 188, 183, 195, 190, 202, 197, 209, 204
OFFSET
1,2
FORMULA
G.f.: x*(1+12*x-6*x^2) / ( (1+x)*(1-x)^2 ). - R. J. Mathar, Mar 08 2011
a(n) = a(n-1) + a(n-2) - a(n-3), a(1)=1, a(2)=13, a(3)=8. - Harvey P. Dale, Jun 07 2012
E.g.f.: (1/4)*(17*exp(-x) + 7*(1 + 2*x)*exp(x) - 24). - G. C. Greubel, May 16 2016
a(n) = (1/4)*(14*n + 7 + 17*(-1)^n). - G. C. Greubel, Aug 03 2024
MATHEMATICA
RecurrenceTable[{a[1]==1, a[n]==7n-a[n-1]}, a, {n, 60}] (* or *) LinearRecurrence[{1, 1, -1}, {1, 13, 8}, 60] (* Harvey P. Dale, Jun 07 2012 *)
PROG
(Magma)
A166522:= func< n | ( 7*n -5 +17*((n+1) mod 2) )/2 >;
[A166522(n): n in [1..100]]; // G. C. Greubel, Aug 03 2024
(SageMath)
def A166522(n): return ( 7*n -5 +17*((n+1)%2) )//2
[A166522(n) for n in range(1, 101)] # G. C. Greubel, Aug 03 2024
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Oct 16 2009
STATUS
approved