A374084 a(n) = (1 + (n+1)^2 + (n-2)*(-1)^n)/2.
3, 5, 8, 14, 17, 27, 30, 44, 47, 65, 68, 90, 93, 119, 122, 152, 155, 189, 192, 230, 233, 275, 278, 324, 327, 377, 380, 434, 437, 495, 498, 560, 563, 629, 632, 702, 705, 779, 782, 860, 863, 945, 948, 1034, 1037, 1127, 1130, 1224, 1227, 1325, 1328, 1430, 1433, 1539
Offset: 1
Examples
[ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [ 7] [ 8] [ 9] [10] [11] [12] [ 1] 1 3 4 10 11 21 22 36 37 55 56 78 ... [ 2] 2 5 9 12 20 23 35 38 54 57 77 ... [ 3] 6 8 13 19 24 34 39 53 58 76 ... [ 4] 7 14 18 25 33 40 52 59 75 ... [ 5] 15 17 26 32 41 51 60 74 ... [ 6] 16 27 31 42 50 61 73 ... [ 7] 28 30 43 49 62 72 ... [ 8] 29 44 48 63 71 ... [ 9] 45 47 64 70 ... [10] 46 65 69 ... [11] 66 68 ... [12] 67 ... ...
Links
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Crossrefs
Programs
-
Magma
[(1 + (n+1)^2 + (n-2)*(-1)^n)/2: n in [1..80]];
-
Mathematica
CoefficientList[Series[-(2*x^3 - 3*x^2 + 2*x + 3)/((x + 1)^2*(x - 1)^3), {x, 0, 50}], x] k := 2; Table[(1 + (n + k - 1)^2 + (n - k) (-1)^(n + k))/2, {n, 60}]
-
Python
def A374084(n): return (n*(n+1)+4 if n&1 else n*(n+3))>>1 # Chai Wah Wu, Jul 07 2024
Formula
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
G.f.: -x*(2*x^3-3*x^2+2*x+3)/((x+1)^2*(x-1)^3).
a(n) = A128918(n+1) - (-1)^n.
E.g.f.: (2 + x)*(exp(x)*x + 2*sinh(x))/2. - Stefano Spezia, Jun 29 2024
Comments