login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A285326 a(0) = 0, for n > 0, a(n) = n + A006519(n). 4
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, 26, 28, 28, 32, 30, 32, 32, 64, 34, 36, 36, 40, 38, 40, 40, 48, 42, 44, 44, 48, 46, 48, 48, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

From M. F. Hasler, Oct 19 2019: (Start)

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

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)

LINKS

Antti Karttunen, Table of n, a(n) for n = 0..8191

Index entries for sequences related to binary expansion of n

FORMULA

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

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

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

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

MATHEMATICA

Table[If[n>0, n + GCD[2^n, n], 0], {n, 0, 100}] (* Indranil Ghosh, Apr 20 2017 *)

PROG

(Scheme)

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

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

(Python)

from sympy import gcd

def a(n): return n + gcd(2**n, n) if n>0 else 0 # Indranil Ghosh, Apr 20 2017

(PARI) a(n) = if(n>0, n + gcd(2^n, n), 0); \\ Indranil Ghosh, Apr 20 2017

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

CROSSREFS

Row 2 of A285325 (after the initial zero).

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

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

Sequence in context: A107748 A005884 A229913 * A079890 A223592 A180444

Adjacent sequences:  A285323 A285324 A285325 * A285327 A285328 A285329

KEYWORD

nonn,base

AUTHOR

Antti Karttunen, Apr 19 2017

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 31 16:23 EDT 2020. Contains 333151 sequences. (Running on oeis4.)