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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A318553 a(1) = 1, a(n) = -5*a(n/3) if n is divisible by 3, a(n) = n - a(n-1) if n + 1 is divisible by 3, otherwise a(n) = n + a(n-1). 1
1, 1, -5, -1, 6, -5, 2, 6, 25, 35, -24, 5, 18, -4, -30, -14, 31, 25, 44, -24, -10, 12, 11, -30, -5, 31, -125, -97, 126, -175, -144, 176, 120, 154, -119, -25, 12, 26, -90, -50, 91, 20, 63, -19, 150, 196, -149, 70, 119, -69, -155, -103, 156, -125, -70, 126, -220, -162, 221, 120, 181, -119, 50, 114, -49, -60, 7, 61 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
MATHEMATICA
a[1]=1; a[n_] := a[n] = Switch[Mod[n, 3], 0, -5 a[n/3], 1, n + a[n-1], 2, n - a[n-1]]; Array[a, 68] (* Giovanni Resta, Sep 05 2018 *)
PROG
(PARI) a = vector(99); for(n=1, #a, print1 (a[n]=if(n<=1, 1, if (n%3==0, -5*a[n/3], if(n%3==1, n+a[n-1], n-a[n-1])))", "));
(PARI) a(n) = if(n==1, 1, if(n%3==0, -5*a(n/3), if(n%3==1, n+a(n-1), n-a(n-1))))
CROSSREFS
Cf. A305865.
Sequence in context: A343344 A200644 A318265 * A176909 A131944 A228475
KEYWORD
sign,look
AUTHOR
Altug Alkan, Aug 28 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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 10 18:14 EDT 2024. Contains 374211 sequences. (Running on oeis4.)