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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A050074 a(n) = |a(n-1) - a(m)| for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1, a(2) = 2, and a(3) = 3. 0

%I #13 May 16 2020 02:01:20

%S 1,2,3,1,0,1,2,0,1,1,1,0,0,1,2,0,1,1,1,0,0,0,1,0,1,1,1,0,0,1,2,0,1,1,

%T 1,0,0,0,1,0,1,1,0,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,1,0,0,1,2,0,1,1,1,0,

%U 0,0,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0

%N a(n) = |a(n-1) - a(m)| for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1, a(2) = 2, and a(3) = 3.

%p a := proc(n) option remember;

%p `if`(n < 4, [1,2,3][n], abs(a(n - 1) - a(Bits:-Iff(n - 2\$2) + 3 - n)))

%p end:

%p seq(a(n), n = 1..90); # _Petros Hadjicostas_, Nov 08 2019

%o (PARI) lista(nn) = {nn = max(nn, 3); my(va = vector(nn)); va[1] = 1; va[2] = 2; va[3] = 3; for(n=4, nn, va[n] = abs(va[n-1] - va[2 - n + 2*2^logint(n-2, 2)])); va; } \\ _Petros Hadjicostas_, May 15 2020

%K nonn

%O 1,2

%A _Clark Kimberling_

%E Name edited by _Petros Hadjicostas_, Nov 08 2019

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 September 10 00:26 EDT 2024. Contains 375769 sequences. (Running on oeis4.)