login
A135164
a(n) = 7^n - 5^n + 3^n + 2^n.
1
2, 7, 37, 253, 1873, 13957, 102817, 747733, 5380993, 38420677, 272769697, 1928677813, 13597682113, 95669909797, 672124356577, 4717058313493, 33080385791233, 231867703805317, 1624599288327457, 11379822861830773, 79696902353804353, 558069037387531237, 3907436894177226337
OFFSET
0,1
COMMENTS
Constants are the prime numbers in decreasing order.
FORMULA
a(n) = 7^n - 5^n + 3^n + 2^n.
From Vincenzo Librandi, May 22 2014: (Start)
G.f.: 1/(1-7*x) - 1/(1-5*x) + 1/(1-3*x) + 1/(1-2*x).
a(n) = 17*a(n-1) - 101*a(n-2) + 247*a(n-3) - 210*a(n-4) for n>3. (End)
E.g.f.: exp(7*x) - exp(5*x) + exp(3*x) + exp(2*x). - G. C. Greubel, Sep 30 2016
EXAMPLE
a(4) = 1873 because 7^4 = 2401, 5^4 = 625, 3^4 = 81, 2^4 = 16 and 2401-625+81+16 = 1873.
MATHEMATICA
CoefficientList[Series[1/(1 - 7 x) - 1/(1 - 5 x) + 1/(1 - 3 x) + 1/(1 - 2 x), {x, 0, 40}], x] (* Vincenzo Librandi, May 22 2014 *)
Table[7^n-5^n+3^n+2^n, {n, 0, 30}] (* or *) LinearRecurrence[{17, -101, 247, -210}, {2, 7, 37, 253}, 30] (* Harvey P. Dale, Jul 23 2016 *)
PROG
(Magma) [7^n-5^n+3^n+2^n: n in [0..50]]; // Vincenzo Librandi, Dec 14 2010
(Magma) I:=[2, 7, 37, 253]; [n le 4 select I[n] else 17*Self(n-1)-101*Self(n-2)+247*Self(n-3)-210*Self(n-4): n in [1..30]]; // Vincenzo Librandi, May 22 2014
(PARI) a(n)=7^n-5^n+3^n+2^n \\ Charles R Greathouse IV, Sep 30 2016
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Nov 21 2007
EXTENSIONS
More terms from Vincenzo Librandi, Dec 14 2010
STATUS
approved