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 A009947 #36 Jan 11 2023 06:39:28 %S A009947 0,0,1,2,1,3,4,2,5,6,3,7,8,4,9,10,5,11,12,6,13,14,7,15,16,8,17,18,9, %T A009947 19,20,10,21,22,11,23,24,12,25,26,13,27,28,14,29,30,15,31,32,16,33,34, %U A009947 17,35,36,18,37,38,19,39,40,20,41,42,21,43,44,22,45,46 %N A009947 Sequence of nonnegative integers, but insert n/2 after every even number n. %C A009947 Coefficients in expansion of e/3 = Sum_{n>=1} a(n)/n!, using greedy algorithm. %C A009947 Numerators of Peirce sequence of order 2. %D A009947 R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, Addison-Wesley, Reading, MA, 2nd ed. 1998, p. 151. %H A009947 Reinhard Zumkeller, <a href="/A009947/b009947.txt">Table of n, a(n) for n = 0..1000</a> %H A009947 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,2,0,0,-1). %F A009947 G.f.: x^2*(x^3+x^2+2*x+1) / ((x-1)^2*(x^2+x+1)^2). - _Colin Barker_, Aug 31 2013 %F A009947 a(n) = (n^2-n+floor(n/3)*(18*floor(n/3)^2-3*(4*n-7)*floor(n/3)+2*n^2-10*n+7))/2. - _Luce ETIENNE_, Mar 29 2017 %F A009947 Sum_{n>=2} (-1)^n/a(n) = Pi/4 + log(2)/2. - _Amiram Eldar_, Jan 11 2023 %p A009947 A009947 := proc(a,n) local i,b,c; b := a; c := [ floor(b) ]; for i from 1 to n-1 do b := b-c[ i ]/i!; c := [ op(c), floor(b*(i+1)!) ]; od; c; end: %t A009947 Flatten[Table[If[EvenQ[n],{n,n/2},n],{n,0,40}]] (* _Harvey P. Dale_, Feb 17 2016 *) %o A009947 (Haskell) %o A009947 a009947 n = a009947_list !! n %o A009947 a009947_list = concatMap (\x -> [2 * x, x, 2 * x + 1]) [0..] %o A009947 -- _Reinhard Zumkeller_, Jul 06 2012 %o A009947 (PARI) a(n)=if(n%3==1, n\3, n\3*2+!!(n%3)) \\ _Charles R Greathouse IV_, Sep 02 2015 %o A009947 (PARI) concat(vector(2), Vec(x^2*(x^3+x^2+2*x+1) / ((x-1)^2*(x^2+x+1)^2) + O(x^100))) \\ _Colin Barker_, Mar 29 2017 %Y A009947 Cf. A071281, A214090 (parity), A001477. %Y A009947 Cf. A166711 (signed). %K A009947 nonn,easy %O A009947 0,4 %A A009947 _Bill Gosper_