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!)
A252729 Start with 1, add 1, subtract 2, multiply by 3, add 4, subtract 5, multiply by 6, add 7, etc. 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Harvey P. Dale, Table of n, a(n) for n = 1..1000

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 *)

PROG

(LibertyBasic)

input "How many terms? "; nt:a=1

1 print a; ", "; :n=n+1:a=a+n

print a; ", "; :n=n+1:a=a-n

print a; ", "; :n=n+1:a=a*n

if n<nt then goto 1 else end

CROSSREFS

Sequence in context: A106235 A288098 A118965 * A121552 A158118 A212137

Adjacent sequences:  A252726 A252727 A252728 * A252730 A252731 A252732

KEYWORD

sign,easy

AUTHOR

Edwin McCravy, Dec 20 2014

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 April 8 22:35 EDT 2020. Contains 333330 sequences. (Running on oeis4.)