login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A178804 When dealing cards into 3 piles (Left, Center, Right), the number of cards in the n-th card's pile, if dealing in a pattern L, C, R, C, L, C, R, C, L, C, ... [as any thoughtful six-year-old will try to do when sharing a pile of candy among 3 people]. 3
1, 1, 1, 2, 2, 3, 2, 4, 3, 5, 3, 6, 4, 7, 4, 8, 5, 9, 5, 10, 6, 11, 6, 12, 7, 13, 7, 14, 8, 15, 8, 16, 9, 17, 9, 18, 10, 19, 10, 20, 11, 21, 11, 22, 12, 23, 12, 24, 13, 25, 13, 26, 14, 27, 14, 28, 15, 29, 15, 30, 16, 31, 16, 32, 17, 33, 17, 34, 18, 35, 18, 36, 19, 37, 19, 38, 20, 39, 20 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

COMMENTS

A008619 and A000027 interleaved; abs(a(n+1) - a(n)) = A059169(n). - Reinhard Zumkeller, Nov 15 2014

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

"TwoPi", A Cool Sequence Problem

Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,-1).

FORMULA

a(n) = ceiling(n/4) if n is odd, n/2 if n is even.

From R. J. Mathar, Jun 19 2010: (Start)

a(n) = a(n-2) + a(n-4) - a(n-6).

G.f.: x*(1+x+x^3) / ( (1+x^2)*(x-1)^2*(1+x)^2 ). (End)

a(n) = (3n+1-2(-1)^((n+3+(1-n)(-1)^n)/4)+(n-3)(-1)^n)/8. - Wesley Ivan Hurt, Mar 19 2015

MATHEMATICA

CoefficientList[Series[x*(1+x+x^3)/((1+x^2)*(x-1)^2*(1+x)^2), {x, 0, 90}], x] (* G. C. Greubel, Jan 23 2019 *)

PROG

(Haskell)

import Data.List (transpose)

a178804 n = a178804_list !! (n-1)

a178804_list = concat $ transpose [a008619_list, a000027_list]

-- Reinhard Zumkeller, Nov 15 2014

(PARI) my(x='x+O('x^90)); Vec(x*(1+x+x^3)/((1+x^2)*(x-1)^2*(1+x)^2)) \\ G. C. Greubel, Jan 23 2019

(MAGMA) m:=90; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!( x*(1+x+x^3)/((1+x^2)*(x-1)^2*(1+x)^2) )); // G. C. Greubel, Jan 23 2019

(Sage) a=(x*(1+x+x^3)/((1+x^2)*(x-1)^2*(1+x)^2)).series(x, 90).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Jan 23 2019

CROSSREFS

Cf. A000027, A008619, A211520 (partial sums), A059169.

Sequence in context: A331745 A103391 A331743 * A322355 A242112 A211316

Adjacent sequences:  A178801 A178802 A178803 * A178805 A178806 A178807

KEYWORD

easy,nonn

AUTHOR

Mark McKinzie (mmckinzie(AT)sjfc.edu), Jun 15 2010

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 12:10 EDT 2021. Contains 343740 sequences. (Running on oeis4.)