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!)
A319010 a(0) = 0, a(1) = 1; for n >= 1, a(2*n) = a(2*n-1), a(2*n+1) = 2*(n - a(n)). 1

%I #17 Sep 25 2018 11:55:30

%S 0,1,1,0,0,2,2,6,6,8,8,6,6,8,8,2,2,4,4,2,2,4,4,10,10,12,12,10,10,12,

%T 12,26,26,28,28,26,26,28,28,34,34,36,36,34,34,36,36,26,26,28,28,26,26,

%U 28,28,34,34,36,36,34,34,36,36,10,10,12,12,10,10,12,12,18,18,20,20,18,18,20,20

%N a(0) = 0, a(1) = 1; for n >= 1, a(2*n) = a(2*n-1), a(2*n+1) = 2*(n - a(n)).

%H Altug Alkan, <a href="/A319010/b319010.txt">Table of n, a(n) for n = 0..8190</a>

%H Altug Alkan, <a href="/A319010/a319010.png">An image from line plot of (a(n), A318190(n)) for n = 1..2^12-2</a>

%o (PARI) a = vector(100); print1(0", "); for(k=1, #a, print1 (a[k]=if(k==1, 1, my (n=k\2); if (k%2==0, a[2*n-1], 2*(n-a[n])))", "));

%o (PARI) a(n) = if(n<=1, n, if(n%2==0, a(n-1),2*((n-1)/2-a((n-1)/2))));

%Y Cf. A002487, A303404, A318190.

%K nonn,easy,look

%O 0,6

%A _Altug Alkan_, Sep 07 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 April 20 00:26 EDT 2024. Contains 371798 sequences. (Running on oeis4.)