This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A330592 #27 Mar 24 2022 08:43:58 %S A330592 0,0,2,4,12,24,48,96,160,320,480,960,1344,2688,3584,7168,9216,18432, %T A330592 23040,46080,56320,112640,135168,270336,319488,638976,745472,1490944, %U A330592 1720320,3440640,3932160,7864320,8912896,17825792,20054016,40108032,44826624,89653248 %N A330592 a(n) is the number of subsets of {1,2,...,n} that contain exactly two odd numbers. %C A330592 2*a(n-1) for n>1 is the number of subsets of {1,2,...,n} that contain exactly two even numbers. For example, for n=5, 2*a(4)=8 and the 8 subsets are {2,4}, {1,2,4}, {2,3,4}, {2,4,5}, {1,2,3,4}, {1,2,4,5}, {2,3,4,5}, {1,2,3,4,5}. - _Enrique Navarrete_, Dec 20 2019 %H A330592 Colin Barker, <a href="/A330592/b330592.txt">Table of n, a(n) for n = 1..1000</a> %H A330592 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,6,0,-12,0,8). %F A330592 a(n) = binomial((n+1)/2,2) * 2^((n-1)/2), n odd; %F A330592 a(n) = binomial(n/2,2) * 2^(n/2), n even. %F A330592 G.f.: 2*(2*x+1)*x^3/(1-2*x^2)^3. %F A330592 a(n) = 6*a(n-2) - 12*a(n-4) + 8*a(n-6) for n>6. - _Colin Barker_, Dec 20 2019 %F A330592 From _Amiram Eldar_, Mar 24 2022: (Start) %F A330592 Sum_{n>=3} 1/a(n) = 3*(1-log(2)). %F A330592 Sum_{n>=3} (-1)^(n+1)/a(n) = 1-log(2). (End) %e A330592 For n=5, a(5)=12 and the 12 subsets are {1,3}, {1,5}, {3,5}, {1,2,3}, {1,2,5}, {1,3,4}, {1,4,5}, {2,3,5}, {3,4,5}, {1,2,3,4}, {1,2,4,5}, {2,3,4,5}. %t A330592 a[n_] := If[OddQ[n], Binomial[(n + 1)/2, 2]*2^((n - 1)/2), Binomial[n/2, 2]*2^(n/2)]; Array[a, 38] (* _Amiram Eldar_, Mar 24 2022 *) %o A330592 (Magma) [IsEven(n) select Binomial(n div 2,2)*2^(n div 2) else Binomial((n+1) div 2,2)*2^((n-1) div 2):n in [1..40]]; // _Marius A. Burtea_, Dec 19 2019 %o A330592 (PARI) concat([0,0], Vec(2*x^3*(1 + 2*x) / (1 - 2*x^2)^3 + O(x^40))) \\ _Colin Barker_, Dec 20 2019 %Y A330592 Cf. A089822 (with exactly two primes). %K A330592 nonn,easy %O A330592 1,3 %A A330592 _Enrique Navarrete_, Dec 18 2019