

A009947


Sequence of nonnegative integers, but insert n/2 after every even number n.


15



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, 19, 20, 10, 21, 22, 11, 23, 24, 12, 25, 26, 13, 27, 28, 14, 29, 30, 15, 31, 32, 16, 33, 34, 17, 35, 36, 18, 37, 38, 19, 39, 40, 20, 41, 42, 21, 43, 44, 22, 45, 46
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,4


COMMENTS

Coefficients in expansion of e/3 = Sum_{n>=1} a(n)/n!, using greedy algorithm.
Numerators of Peirce sequence of order 2.


REFERENCES

R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, AddisonWesley, Reading, MA, 2nd ed. 1998, p. 151.


LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,1).


FORMULA

G.f.: x^2*(x^3+x^2+2*x+1) / ((x1)^2*(x^2+x+1)^2).  Colin Barker, Aug 31 2013
a(n) = (n^2n+floor(n/3)*(18*floor(n/3)^23*(4*n7)*floor(n/3)+2*n^210*n+7))/2.  Luce ETIENNE, Mar 29 2017


MAPLE

A009947 := proc(a, n) local i, b, c; b := a; c := [ floor(b) ]; for i from 1 to n1 do b := bc[ i ]/i!; c := [ op(c), floor(b*(i+1)!) ]; od; c; end:


MATHEMATICA

Flatten[Table[If[EvenQ[n], {n, n/2}, n], {n, 0, 40}]] (* Harvey P. Dale, Feb 17 2016 *)


PROG

(Haskell)
a009947 n = a009947_list !! n
a009947_list = concatMap (\x > [2 * x, x, 2 * x + 1]) [0..]
 Reinhard Zumkeller, Jul 06 2012
(PARI) a(n)=if(n%3==1, n\3, n\3*2+!!(n%3)) \\ Charles R Greathouse IV, Sep 02 2015
(PARI) concat(vector(2), Vec(x^2*(x^3+x^2+2*x+1) / ((x1)^2*(x^2+x+1)^2) + O(x^100))) \\ Colin Barker, Mar 29 2017


CROSSREFS

Cf. A071281, A214090 (parity), A001477.
Sequence in context: A112382 A117384 A125160 * A166711 A026249 A130527
Adjacent sequences: A009944 A009945 A009946 * A009948 A009949 A009950


KEYWORD

nonn,easy


AUTHOR

Bill Gosper


STATUS

approved



