login
A385083
Expansion of e.g.f. cosh(x)*(x + x^2/2).
3
0, 1, 1, 3, 6, 5, 15, 7, 28, 9, 45, 11, 66, 13, 91, 15, 120, 17, 153, 19, 190, 21, 231, 23, 276, 25, 325, 27, 378, 29, 435, 31, 496, 33, 561, 35, 630, 37, 703, 39, 780, 41, 861, 43, 946, 45, 1035, 47, 1128, 49, 1225, 51, 1326, 53, 1431, 55, 1540, 57, 1653, 59, 1770
OFFSET
0,4
COMMENTS
Hexagonal numbers and odd numbers interleaved.
a(n) is the number of ternary strings of length n that contain exactly one 0 and no 1's or exactly two 1's and no 0's, and in both cases, an even number of 2's.
FORMULA
a(n) = (n/2)*(n-1), n even; a(n) = n, n odd.
G.f.: x*(1 + x + 3*x^3 - x^4)/(1 - x^2)^3. - Stefano Spezia, Jun 17 2025
EXAMPLE
a(7) = 7 since the strings are the 7 permutations of 0222222.
a(8) = 28 since the strings are the 28 permutations of 11222222.
MATHEMATICA
A385083[n_] := If[OddQ[n], n, n*(n - 1)/2]; Array[A385083, 100, 0] (* or *)
LinearRecurrence[{0, 3, 0, -3, 0, 1}, {0, 1, 1, 3, 6, 5}, 100] (* Paolo Xausa, Jan 07 2026 *)
CROSSREFS
Sequence in context: A292682 A334748 A334079 * A328403 A199126 A247569
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Jun 17 2025
STATUS
approved