OFFSET
0,2
COMMENTS
a(n) is the number of subsets T of A = {1, 2, ..., 2*n} such that no pair of elements a, b of T satisfy |a-b| = 1 or n.
LINKS
Yifan Xie, Proof for the comment
Index entries for linear recurrences with constant coefficients, signature (1,3,1).
FORMULA
a(n) = (1/4)*((3 + sqrt(2))*(1+sqrt(2))^n + (3 - sqrt(2))*(1-sqrt(2))^n-2*(-1)^n).
For n >= 2, a(n) = 2*a(n-1) + a(n-2) - (-1)^n.
From Stefano Spezia, Aug 26 2024: (Start)
G.f.: (1 + 2*x)/((1 + x)*(1 - 2*x - x^2)).
E.g.f.: (sinh(x) - cosh(x) + exp(x)*(3*cosh(sqrt(2)*x) + sqrt(2)*sinh(sqrt(2)*x)))/2. (End)
Let f = (3 - sqrt(2))*exp((1 - sqrt(2))*x) + (3 + sqrt(2))*exp((1 + sqrt(2))*x), then 4*a(n) + 2*(-1)^n = n! * [x^n] f. - Peter Luschny, Sep 10 2024
a(n)+a(n-1) = A048654(n). - R. J. Mathar, Sep 27 2024
EXAMPLE
For n = 2, the a(2) = 6 subsets of {1, 2, 3, 4} are {}, {1}, {2}, {3}, {4}, {1, 4}.
MATHEMATICA
LinearRecurrence[{1, 3, 1}, {1, 3, 6}, 31] (* Hugo Pfoertner, Aug 26 2024 *)
PROG
(PARI) my(a=1, b=3, c=6); for(n=1, 31, print1(a, ", "); my(d=a+3*b+c); a=b; b=c; c=d)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Yifan Xie, Aug 25 2024
STATUS
approved