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 A212831 #43 Sep 08 2022 08:46:02 %S A212831 0,1,2,3,2,5,4,7,4,9,6,11,6,13,8,15,8,17,10,19,10,21,12,23,12,25,14, %T A212831 27,14,29,16,31,16,33,18,35,18,37,20,39,20,41,22,43,22,45,24,47,24,49, %U A212831 26,51,26,53,28,55,28,57,30,59,30,61,32,63,32,65,34,67,34,69,36,71,36,73,38,75 %N A212831 a(4*n) = 2*n, a(2*n+1) = 2*n+1, a(4*n+2) = 2*n+2. %C A212831 First differences: (1, 1, 1, -1, 3, -1, 3, -3, 5,...) = (1, A186422). %C A212831 Second differences: (0, 0, -2, 4, -4, 4, -6, 8, ...) = (-1)^(n+1) * A201629(n). %C A212831 Interleave the terms with even indices of the companion A215495 and this one to get (A215495(0), A212831(0), A215495(2), A212831(2),...) = (1, 0, 1, 2, 3, 2, 3, 4, 5, 4,...) = A106249, up to the initial term = A083219 = A083220/2. %H A212831 G. C. Greubel, <a href="/A212831/b212831.txt">Table of n, a(n) for n = 0..10000</a> %H A212831 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,1,0,-1). %F A212831 a(n) + A215495(n) = A043547(n). %F A212831 a(n) = -A214283(n)/A000108([n/2]). %F A212831 a(n+1) = (A186421(n)=0,1,2,1,4,...) + 1. %F A212831 a(2*n) = A052928(n+1). %F A212831 a(n+2) - a(n) = 2, 2, 0, 2. (period 4). %F A212831 a(n) = a(n-2) +a(n-4) -a(n-6); also holds for A215495(n). %F A212831 G.f.: x*(1+2*x+2*x^2+x^4) / ( (x^2+1)*(x-1)^2*(1+x)^2 ). - _R. J. Mathar_, Aug 21 2012 %F A212831 a(n) = (1/4)*((1 +(-1)^n)*(1 - (-1)^floor(n/2)) + (3 -(-1)^n)*n). - _G. C. Greubel_, Apr 25 2018 %t A212831 a[n_] := (1/4)*((-(1 + (-1)^n))*(-1 + (-1)^Floor[n/2]) - (-3 + (-1)^n)*n ); Table[a[n], {n, 0, 84}] (* _Jean-François Alcover_, Sep 18 2012 *) %t A212831 LinearRecurrence[{0,1,0,1,0,-1},{0,1,2,3,2,5},80] (* _Harvey P. Dale_, May 29 2016 *) %o A212831 (PARI) A212831(n)=if(bittest(n,0), n, n\2+bittest(n,1)) \\ _M. F. Hasler_, Oct 21 2012 %o A212831 (PARI) for(n=0,50, print1((1/4)*((1 +(-1)^n)*(1 - (-1)^floor(n/2)) + (3 -(-1)^n)*n), ", ")) \\ _G. C. Greubel_, Apr 25 2018 %o A212831 (Magma) [(1/4)*((1 +(-1)^n)*(1 - (-1)^Floor(n/2)) + (3 -(-1)^n)*n): n in [0..50]]; // _G. C. Greubel_, Apr 25 2018 %Y A212831 Cf. A214282, A129756. %K A212831 nonn,easy %O A212831 0,3 %A A212831 _Paul Curtz_, Aug 14 2012 %E A212831 Corrected and edited by _M. F. Hasler_, Oct 21 2012