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 A116966 #44 Dec 22 2024 20:16:29 %S A116966 1,3,2,4,5,7,6,8,9,11,10,12,13,15,14,16,17,19,18,20,21,23,22,24,25,27, %T A116966 26,28,29,31,30,32,33,35,34,36,37,39,38,40,41,43,42,44,45,47,46,48,49, %U A116966 51,50,52,53,55,54,56,57,59,58,60,61,63,62,64,65,67,66,68 %N A116966 a(n) = n + {1,2,0,1} according as n == {0,1,2,3} mod 4. %C A116966 In each group of four consecutive numbers, swap 2nd and 3rd terms. - _Zak Seidov_, Mar 31 2006 %C A116966 First differences of A089781. - _Reinhard Zumkeller_, Aug 15 2015 %C A116966 From _Guenther Schrack_, May 31 2017: (Start) %C A116966 Permutation of the positive integers partitioned into quadruples [4k+1,4k+3,4k+2,4k+4]. %C A116966 Partial sums: A116996. (End) %H A116966 Vincenzo Librandi, <a href="/A116966/b116966.txt">Table of n, a(n) for n = 0..1000</a> %H A116966 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1). %F A116966 a(n) = n+1+(i^(n(n-1))-(-1)^n)/2, where i=sqrt(-1). - _Bruno Berselli_, Nov 25 2012 %F A116966 G.f.: (2*x^3-x^2+2*x+1) / ((x-1)^2*(x+1)*(x^2+1)). - _Colin Barker_, Apr 30 2013 %F A116966 a(n) = A140081(n+2) + n. - _Reinhard Zumkeller_, Aug 15 2015 %F A116966 From _Guenther Schrack_, May 31 2017: (Start) %F A116966 a(n) = n + 1 + ((-1)^(n*(n-1)/2) - (-1)^n)/2. %F A116966 a(n) = a(n-4) + 4, n > 3. %F A116966 a(n) = a(n-1) + a(n-4) - a(n-5), n > 4. (End) %F A116966 Sum_{n>=0} (-1)^n/a(n) = Pi/4 + log(2)/2. - _Amiram Eldar_, Jan 31 2023 %p A116966 f:=proc(i) if i mod 4 = 0 then i+1 elif i mod 4 = 1 then i+2 elif i mod 4 = 2 then i else i+1; fi; end; %t A116966 b := {1, 2, 0, 1}; a[n_] := n + b[[1 + Mod[n, 4]]]; Table[a[n], {n, 0, 60}] (* _Stefan Steinerberger_, Mar 31 2006 *) %t A116966 CoefficientList[Series[(2 x^3 - x^2 + 2 x + 1) / ((x - 1)^2 (x + 1) (x^2 + 1)), {x, 0, 40}], x] (* _Vincenzo Librandi_, Jun 19 2013 *) %o A116966 (Maxima) makelist(n+1+(%i^(n*(n-1))-(-1)^n)/2, n, 0, 70); /* _Bruno Berselli_, Nov 25 2012 */ %o A116966 (Magma) /* By definition: */ [ n + [1,2,0,1][1+(n mod 4)]: n in [0..70] ]; // _Bruno Berselli_, Nov 25 2012 %o A116966 (PARI) Vec((2*x^3-x^2+2*x+1) / ((x-1)^2*(x+1)*(x^2+1)) + O(x^66) ) \\ _Joerg Arndt_, Apr 30 2013 %o A116966 (Haskell) %o A116966 a116966 n = a116966_list !! n %o A116966 a116966_list = zipWith (+) [0..] $ drop 2 a140081_list %o A116966 -- _Reinhard Zumkeller_, Aug 15 2015 %Y A116966 Cf. A115391, A116996. %Y A116966 Cf. A140081, A089781. %K A116966 nonn,easy %O A116966 0,2 %A A116966 _N. J. A. Sloane_, Mar 31 2006