OFFSET
0,3
COMMENTS
Even numbers and second hexagonal numbers interleaved.
Number of binary strings of length n with one or two 0's and an odd number of 1's.
Number of ternary strings of length n with either one 0 or two 2's and an odd number of 1's.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-3,0,1).
FORMULA
a(n) = n, n even; a(n) = binomial(n,2), n odd.
G.f.: x^2*(2 + 3*x - 2*x^2 + x^3)/(1 - x^2)^3. - Stefano Spezia, Oct 30 2025
EXAMPLE
a(6) = 6 since the strings are the 6 permutations of 111110.
a(7) = 21 since the strings are the 21 permutations of 1111122.
MATHEMATICA
A390255[n_] := If[OddQ[n], Binomial[n, 2], n]; Array[A390255, 100, 0] (* Paolo Xausa, Jan 02 2026 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Oct 30 2025
STATUS
approved
