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

 


a(0) = 0, for n > 0, a(n) = n + A006519(n).
5

%I #27 Oct 21 2019 12:11:59

%S 0,2,4,4,8,6,8,8,16,10,12,12,16,14,16,16,32,18,20,20,24,22,24,24,32,

%T 26,28,28,32,30,32,32,64,34,36,36,40,38,40,40,48,42,44,44,48,46,48,48,

%U 64,50,52,52,56,54,56,56,64,58,60,60,64,62,64,64,128,66,68,68,72,70,72,72,80,74,76,76,80,78,80,80,96,82,84,84,88,86,88,88,96,90,92,92

%N a(0) = 0, for n > 0, a(n) = n + A006519(n).

%C From _M. F. Hasler_, Oct 19 2019: (Start)

%C This sequence is equal to itself multiplied by 2 and interleaved with the positive even numbers: We have a(2n-1) = 2n (n >= 1) from the very definition, since A006519(m) = 1 for odd m. And a(2n) = 2n + A006519(2n) = 2*a(n), using A006519(2n) = 2*A006519(n).

%C The sequence repeats the pattern [A, B, C, C] where in the n-th occurrence C = 4n, B = C - 2, A = C if n is even, A = C + 4 if n = 3 (mod 4), and A = 16*a((n-1)/4) otherwise. (End)

%H Antti Karttunen, <a href="/A285326/b285326.txt">Table of n, a(n) for n = 0..8191</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(0) = 0; for n > 0, a(n) = n + A006519(n).

%F a(n) = A048675(A065642(A019565(n))) = A048675(A285109(A019565(n))).

%F For n >= 1, a(n) = 2*A109168(n).

%F a(n) = 2*A140472(n) and a(2n) = 2*a(n) and a(2^n) = 2^(n+1) for all n >= 0, a(2n-1) = 2n for all n >= 1. - _M. F. Hasler_, Oct 19 2019

%t Table[If[n>0, n + GCD[2^n, n], 0], {n, 0, 100}] (* _Indranil Ghosh_, Apr 20 2017 *)

%o (Scheme)

%o (define (A285326 n) (if (zero? n) n (+ n (A006519 n))))

%o (define (A285326 n) (A048675 (A065642 (A019565 n))))

%o (Python)

%o from sympy import gcd

%o def a(n): return n + gcd(2**n, n) if n>0 else 0 # _Indranil Ghosh_, Apr 20 2017

%o (PARI) a(n) = if(n>0, n + gcd(2^n, n), 0); \\ _Indranil Ghosh_, Apr 20 2017

%o (PARI) A285326(n)=n+bitand(n,-n) \\ Or: {a(n)=-bitand(-n,bitneg(n))}, not faster. - _M. F. Hasler_, Oct 19 2019

%Y Row 2 of A285325 (after the initial zero).

%Y Cf. A006519, A019565, A048675, A065642, A129760, A285109.

%Y Cf. A109168 (same terms divided by 2), also A140472.

%K nonn,base

%O 0,2

%A _Antti Karttunen_, Apr 19 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | 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 23 12:25 EDT 2024. Contains 376164 sequences. (Running on oeis4.)