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!)
A153587 a(n) = n mod (A062383(n) - n). 1

%I #9 Jul 01 2022 04:48:36

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

%T 4,6,8,10,12,14,16,18,20,1,4,7,10,13,0,4,8,12,4,9,4,1,0,1,4,4,0,1,0,0,

%U 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42

%N a(n) = n mod (A062383(n) - n).

%H Michel Marcus, <a href="/A153587/b153587.txt">Table of n, a(n) for n = 0..1024</a>

%F a(n) = n mod A080079(n), for n > 0. - _Michel Marcus_, Jan 28 2018

%o (C) int A062383(int n) { if(n==0) return 1; return 2*(A062383(n/2)); }

%o int a(int n) { return n % (A062383(n)-n); }

%o (PARI) b(n) = if (n, 2*b(n\2), 1);

%o a(n) = n % (n - b(n)); \\ _Michel Marcus_, Jan 28 2018

%o (Python)

%o def A153587(n): return n % ((1 << n.bit_length())-n) # _Chai Wah Wu_, Jun 30 2022

%Y Cf. A062383, A080079.

%K easy,nonn

%O 0,6

%A J. Z. Bradley (jzbradley(AT)gmail.com), Dec 29 2008

%E More terms from _Michel Marcus_, Jan 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 April 24 05:49 EDT 2024. Contains 371918 sequences. (Running on oeis4.)