Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #23 Sep 14 2022 02:04:07
%S 6,1,7,2,8,3,9,4,10,5,11,6,12,7,13,8,14,9,15,10,16,11,17,12,18,13,19,
%T 14,20,15,21,16,22,17,23,18,24,19,25,20,26,21,27,22,28,23,29,24,30,25,
%U 31,26,32,27,33,28,34,29,35,30,36,31,37,32,38,33,39,34,40,35,41,36,42,37
%N a(n) = (n+1)/2 if n is odd; a(n) = n/2 + 6 if n is even.
%C See the paper by A. Karabegov and J. Holland for details.
%H A. Karabegov and J. Holland, <a href="http://www.jstor.org/stable/27646593">Finding all solutions to the Magic Hexagram</a>, The College Mathematics Journal, vol. 39 (2008), pp. 102-106.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).
%F O.g.f.: -(-6+5*x)/((-1+x)^2 *(1+x)). - _R. J. Mathar_, Mar 16 2008
%F a(n) = 1/4*(2*(n + 1) - 11*(-1)^(n + 1) + 11). - _Ilya Gutkovskiy_, Sep 18 2015
%F Sum_{n>=0} (-1)^(n+1)/a(n) = 137/60. - _Amiram Eldar_, Sep 14 2022
%e 0 is even so a(0) = 0/2 + 6 = 6.
%e 1 is odd so a(1) = (1+1)/2 = 1.
%e 2 is even so a(2) = 2/2 + 6 = 7.
%p A137235 := proc(n) if n mod 2 = 0 then n/2+6 ; else (n+1)/2 ; fi ; end: seq(A137235(n),n=0..80) ; # _R. J. Mathar_, Mar 16 2008
%t Table[If[OddQ[n], (n + 1)/2, (n + 12)/2], {n, 0, 60}] (* _Erich Friedman_, Mar 22 2008 *)
%t a=5;Table[a=n-a,{n,a,200}] (* _Vladimir Joseph Stephan Orlovsky_, Nov 22 2009 *)
%o (PARI) a(n)=(2*n+2-11*(-1)^(n+1)+11)/4 \\ _Charles R Greathouse IV_, Sep 18 2015
%K nonn,easy
%O 0,1
%A _Parthasarathy Nambi_, Mar 08 2008
%E More terms from _R. J. Mathar_ and _Erich Friedman_, Mar 22 2008, Mar 16 2008
%E Examples edited by _Jon E. Schoenfield_, Jan 26 2015