The OEIS is supported by the many generous donors to the OEIS Foundation.

 Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”). Other ways to Give
 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A261038 a(1)=1; for n>1: a(n) = a(n-1)*n if t=0, a(n) = round(a(n-1)/n) if t=1, a(n) = a(n-1)+n if t=2, a(n) = a(n-1)-n if t=3, where t = n mod 4. 1
 1, 3, 0, 0, 0, 6, -1, -8, -1, 9, -2, -24, -2, 12, -3, -48, -3, 15, -4, -80, -4, 18, -5, -120, -5, 21, -6, -168, -6, 24, -7, -224, -7, 27, -8, -288, -8, 30, -9, -360, -9, 33, -10, -440, -10, 36, -11, -528, -11, 39, -12, -624, -12, 42, -13, -728, -13, 45, -14 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS a(4*n+1) = 1, 0, -1, -2, -3, ... a(4*n+2) = 3, 6, 9, 12, 15, ... a(4*n+3) = 0, -1, -2, -3, -4, ... a(4*n+4) = 0, -8, -24, -48, -80, ... = -A033996(n). LINKS Alois P. Heinz, Table of n, a(n) for n = 1..10000 Index entries for linear recurrences with constant coefficients, signature (0,0,0,3,0,0,0,-3,0,0,0,1). FORMULA From Colin Barker, Aug 09 2015: (Start) a(n) = 3*a(n-4) - 3*a(n-8) + a(n-12). G.f.: -x*(x^10+2*x^8-8*x^7-x^6-3*x^5-3*x^4+3*x+1) / ((x-1)^3*(x+1)^3*(x^2+1)^3). (End) EXAMPLE a(1) = 1. a(2) = a(1) + 2 = 3. a(3) = a(2) - 3 = 0. a(4) = a(3) * 4 = 0. a(5) = round(a(4) / 5) = 0. a(6) = a(5) + 6 = 6. a(7) = a(6) - 7 = -1. MAPLE a:= proc(n) option remember; `if`(n=1, 1, (t-> `if`(t=0, a(n-1)*n, `if`(t=1, round(a(n-1)/n), `if`(t=2, a(n-1)+n, a(n-1)-n))))(irem(n, 4))) end: seq(a(n), n=1..100); # Alois P. Heinz, Aug 08 2015 MATHEMATICA nxt[{n_, a_}]:=Module[{t=Mod[n+1, 4]}, {n+1, Which[t==0, a(n+1), t==1, Round[ a/(n+1)], t==2, a+n+1, t==3, a-n-1]}]; NestList[nxt, {1, 1}, 100][[All, 2]] (* or *) LinearRecurrence[{0, 0, 0, 3, 0, 0, 0, -3, 0, 0, 0, 1}, {1, 3, 0, 0, 0, 6, -1, -8, -1, 9, -2, -24}, 100] (* Harvey P. Dale, May 25 2018 *) PROG (PARI) Vec(-x*(x^10+2*x^8-8*x^7-x^6-3*x^5-3*x^4+3*x+1)/((x-1)^3*(x+1)^3*(x^2+1)^3) + O(x^100)) \\ Colin Barker, Aug 10 2015 (PARI) first(m)=my(v=vector(m), t); v[1]=1; for(i=2, m, t = i%4; if(t==0, v[i]=v[i-1]*i, if(t==1, v[i]=round(v[i-1]/i), if(t==2, v[i]=v[i-1]+i, v[i]=v[i-1]-i )))); v; \\ Anders Hellström, Aug 17 2015 CROSSREFS Cf. A033996. Sequence in context: A327889 A221702 A084681 * A285852 A096528 A161837 Adjacent sequences: A261035 A261036 A261037 * A261039 A261040 A261041 KEYWORD sign,easy AUTHOR Peter Woodward, Aug 07 2015 EXTENSIONS More terms from Alois P. Heinz, Aug 08 2015 Edited by Jon E. Schoenfield, Aug 08 2015 Corrected by Harvey P. Dale, May 25 2018 STATUS approved

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

Last modified December 9 10:28 EST 2022. Contains 358700 sequences. (Running on oeis4.)