Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #25 Jun 20 2017 01:35:15
%S 1,4,2,6,3,8,4,10,5,12,6,14,7,16,8,18,9,20,10,22,11,24,12,26,13,28,14,
%T 30,15,32,16,34,17,36,18,38,19,40,20,42,21,44,22,46,23,48,24,50,25,52,
%U 26,54,27,56,28,58,29,60,30,62,31,64,32,66,33,68,34,70,35,72,36,74,37
%N a(n) = (n+1)/2 if n is odd, n+2 otherwise.
%C May be regarded as table T(n,j) for j=1 to 2, where T(n,1)=n, T(n,2)=2*n+2 T(n,1)=number of carbon atoms in alkane hydrocarbons C_n H_{2n+2}, T(n,2)=number of hydrogen atoms in alkane hydrocarbons C_nH_{2n+2}.
%H Arkadiusz Wesolowski, <a href="/A097362/b097362.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).
%F G.f.: (2 + x)/(1 - x^2)^2. - _Arkadiusz Wesolowski_, Dec 28 2011
%t a[n_] := If[OddQ[n], (n + 1)/2, n + 2]; Table[a[n], {n, 100}] (* _Stefan Steinerberger_, May 13 2006 *)
%t LinearRecurrence[{0,2,0,-1},{1,4,2,6},100] (* _Harvey P. Dale_, Sep 14 2016 *)
%o (PARI) a(n)=if(n%2,(n+1)/2,n+2) \\ _Charles R Greathouse IV_, Sep 02 2015
%Y Cf. A065423.
%K easy,nonn
%O 1,2
%A _Pierre CAMI_, Sep 18 2004
%E More terms from _Stefan Steinerberger_, May 13 2006