A252729 Start with 1, add 1, subtract 2, multiply by 3, add 4, subtract 5, multiply by 6, add 7, etc.
1, 2, 0, 0, 4, -1, -6, 1, -7, -63, -53, -64, -768, -755, -769, -11535, -11519, -11536, -207648, -207629, -207649, -4360629, -4360607, -4360630, -104655120, -104655095, -104655121, -2825688267, -2825688239, -2825688268, -84770648040, -84770648009
Offset: 1
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Maple
A252729 := proc(n) option remember; if n =1 then 1; elif modp(n,3) = 2 then procname(n-1)+n-1; elif modp(n,3) = 0 then procname(n-1)-(n-1); elif modp(n,3) = 1 then procname(n-1)*(n-1); fi ; end proc: seq(A252729(n),n=1..32) ; # R. J. Mathar, Mar 20 2015
-
Mathematica
nxt[{n_,a_}]:={n+1,Which[Mod[n+1,3]==1,a+n+1,Mod[n+1,3]==2,a-(n+1),True, a*(n+1)]}; Transpose[NestList[nxt,{0,1},35]][[2]] (* Harvey P. Dale, Mar 29 2015 *)