cp's OEIS Frontend

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.

A171647 a(1) = 1; for n > 1, a(n) = 2*a(n-1) if n is even, a(n) = ((n+1)/(n-1))*a(n-1) if n is odd.

This page as a plain text file.
%I A171647 #46 Aug 27 2022 04:53:27
%S A171647 1,2,4,8,12,24,32,64,80,160,192,384,448,896,1024,2048,2304,4608,5120,
%T A171647 10240,11264,22528,24576,49152,53248,106496,114688,229376,245760,
%U A171647 491520,524288,1048576,1114112,2228224,2359296,4718592,4980736,9961472
%N A171647 a(1) = 1; for n > 1, a(n) = 2*a(n-1) if n is even, a(n) = ((n+1)/(n-1))*a(n-1) if n is odd.
%C A171647 a(n) is the number of subsets of {1,2,...,n} that contain exactly one odd number.  For example, for n=5, a(5)=12 and the 12 subsets are {1}, {3}, {5}, {1,2}, {1,4}, {2,3}, {2,5}, {3,4}, {4,5}, {1,2,4}, {2,3,4}, {2,4,5}. - _Enrique Navarrete_, Dec 15 2019
%C A171647 2*a(n-1) is the number of subsets of {1,2,...,n} that contain exactly one even number.  For example, for n=5, 2*a(4)=16 and the 16 subsets are {2}, {4}, {1,2}, {1,4}, {2,3}, {2,5}, {3,4}, {4,5}, {1,2,3}, {1,2,5}, {1,3,4}, {1,4,5}, {2,3,5}, {3,4,5}, {1,2,3,5}, {1,3,4,5}. - _Enrique Navarrete_, Dec 16 2019
%H A171647 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,4,0,-4).
%F A171647 From _R. J. Mathar_, Dec 06 2010: (Start)
%F A171647 a(n) = 4*a(n-2) - 4*a(n-4).
%F A171647 G.f.: x*(1+2*x)/(-1+2*x^2)^2. (End)
%F A171647 a(n) = (2*n - (-1)^n+1)*2^((2*n + (-1)^n - 9)/4). - _Bruno Berselli_, Dec 07 2010
%F A171647 G.f.: G(0), where G(k) = 1 + 2*x*(k+1)/(k + 1 - x*(k+1)*(k+2)/(x*(k+2) + (k+1)/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Jun 27 2013
%F A171647 Sum_{n>=1} 1/a(n) = 3*log(2) (A016631). - _Amiram Eldar_, Aug 27 2022
%e A171647 a(6) = 2*a(5) = 2*12 = 24;
%e A171647 a(7) = (8/6)*a(6) = (4/3)*24 = 32.
%t A171647 a[n_] := If[ OddQ@ n, (n + 1)/(n - 1) a[n - 1] , 2 a[n - 1]]; a[1] = 1; Array[a, 38]
%t A171647 LinearRecurrence[{0,4,0,-4},{1,2,4,8},40] (* _Harvey P. Dale_, Jan 14 2015 *)
%o A171647 (Magma) [ n eq 1 select 1 else IsEven(n) select 2*Self(n-1) else ((n+1)/(n-1))*Self(n-1): n in [1..40] ];
%Y A171647 Cf. A001787, A036289 (bisections).
%Y A171647 Cf. A016631.
%K A171647 nonn,easy
%O A171647 1,2
%A A171647 _Gary W. Adamson_, Dec 13 2009