A279312 Number of subsets of {1, 2, 3, ..., n} that include no consecutive even integers.
1, 2, 4, 8, 12, 24, 40, 80, 128, 256, 416, 832, 1344, 2688, 4352, 8704, 14080, 28160, 45568, 91136, 147456, 294912, 477184, 954368, 1544192, 3088384, 4997120, 9994240, 16171008, 32342016, 52330496
Offset: 0
Examples
For n=4, a(n)=12. The number of subsets of {1, 2, 3, 4} that include no consecutive even integers are: {}, {1}, {2}, {3}, {4}, {1,2}, {1,3}, {1,4}, {2,3}, {3,4}, {1,2,3}, {1,3,4}.
Links
- Index entries for linear recurrences with constant coefficients, signature (0,2,0,4).
Crossrefs
Cf. A279245
Programs
-
Mathematica
LinearRecurrence[{0,2,0,4},{1,2,4,8},40] (* Harvey P. Dale, Mar 30 2025 *)
-
PARI
a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; 4,0,2,0]^n*[1;2;4;8])[1,1] \\ Charles R Greathouse IV, Dec 13 2016
Formula
G.f.: (2*x^3+4*x^2+2*x+2)/(4*x^4+2*x^2-1).
a(n) = 2a(n-2) + 4a(n-4). - Charles R Greathouse IV, Dec 13 2016
Extensions
More terms from Charles R Greathouse IV, Dec 13 2016
Edited by Michel Marcus, Jul 04 2017
Comments