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

%I

%S 1,1,-5,-1,6,-5,2,6,25,35,-24,5,18,-4,-30,-14,31,25,44,-24,-10,12,11,

%T -30,-5,31,-125,-97,126,-175,-144,176,120,154,-119,-25,12,26,-90,-50,

%U 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

%N 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).

%H Altug Alkan, <a href="/A318553/b318553.txt">Table of n, a(n) for n = 1..10934</a>

%H Altug Alkan, <a href="/A318553/a318553.png">A scatterplot of a(n) for 4*3^8 <= n <= 5*3^8-1</a>

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

%o (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])))", "));

%o (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))))

%Y Cf. A305865.

%K sign,look

%O 1,3

%A _Altug Alkan_, Aug 28 2018

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 September 26 06:32 EDT 2022. Contains 356987 sequences. (Running on oeis4.)