login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A038712 Let k be the exponent of highest power of 2 dividing n (A007814); a(n) = 2^(k+1)-1. 40
1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 31, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 63, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 31, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 127, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 31, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 63, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

n XOR n-1, i.e., nim-sum of a pair of consecutive numbers.

Denominator of quotient sigma(2*n)/sigma(n). - Labos Elemer, Nov 04 2003

a(n) = the Towers of Hanoi disc moved at the n-th move, using standard moves with discs labeled (1, 3, 7, 15, ...) starting from top (smallest = 1). - Gary W. Adamson, Oct 26 2009

Equals row sums of triangle A168312. - Gary W. Adamson, Nov 22 2009

a(n) = A086799(2*n) - 2*n. - Reinhard Zumkeller, Aug 07 2011

In the binary expansion of n, delete everything left of the rightmost 1 bit, and set all bits to the right of it. - Ralf Stephan, Aug 22 2013

Every finite sequence of positive integers summing to n may be termwise dominated by a subsequence of the first n values in this sequence [see Bannister et al., 2013]. - David Eppstein, Aug 31 2013

LINKS

R. Zumkeller, Table of n, a(n) for n = 1..10000

M. J. Bannister, Z. Cheng, W. E. Devanny, and D. Eppstein, Superpatterns and universal point sets, 21st Int. Symp. Graph Drawing, 2013, arXiv:1308.0403 [cs.CG], 2013.

Klaus Brockhaus, Illustration of A038712 and A080277

D. Eppstein, 1317131 and majorization by subsequences

Fabrizio Frati, M. Patrignani, V. Roselli, LR-Drawings of Ordered Rooted Binary Trees and Near-Linear Area Drawings of Outerplanar Graphs, arXiv preprint arXiv:1610.02841 [cs.CG], 2016.

R. Stephan, Some divide-and-conquer sequences ...

R. Stephan, Table of generating functions

R. Stephan, Divide-and-conquer generating functions. I. Elementary sequences, arXiv:math/0307027 [math.CO], 2003.

Index entries for sequences related to Nim-sums

Index entries for sequences related to binary expansion of n

FORMULA

a(n) = A110654(n-1) XOR A008619(n). - Reinhard Zumkeller, Feb 05 2007

a(n) = 2^A001511(n) - 1 = 2*A006519(n) - 1 = 2^(A007814(n)+1) - 1.

Multiplicative with a(2^e) = 2^(e+1)-1, a(e^p) = 1, p > 2. - Vladeta Jovovic, Nov 06 2001

Sum_{n>0} a(n)*x^n/(1+x^n) = Sum_{n>0} x^n/(1-x^n). Inverse Moebius transform of A048298. - Vladeta Jovovic, Jan 02 2003

From Ralf Stephan, Jun 15 2003: (Start)

G.f.: Sum(k>=0} 2^k*x^2^k/(1 - x^2^k).

a(2*n+1) = 1, a(2*n) = 2*a(n)+1. (End)

Equals A130093 * [1, 2, 3, ...]. - Gary W. Adamson, May 13 2007

Sum_{i=1..n} (-1)^A000120(n-i)*a(i) = (-1)^(A000120(n)-1)*n. - Vladimir Shevelev, Mar 17 2009

Dirichlet g.f.: zeta(s)/(1 - 2^(1-s)). - R. J. Mathar, Mar 10 2011

a((2*n-1)*2^p) = 2^(p+1)-1, p >= 0. - Johannes W. Meijer, Feb 01 2013

a(n) = A000225(A001511(n)). - Omar E. Pol, Aug 31 2013

a(n) = A000203(n)/A000593(n). - Ivan N. Ianakiev and Omar E. Pol, Dec 14 2017

EXAMPLE

a(6) = 3 because 110 XOR 101 = 11 base 2 = 3.

MAPLE

nmax:=98: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p) := 2^(p+1)-1 od: od: seq(a(n), n=1..nmax); # Johannes W. Meijer, Feb 01 2013

MATHEMATICA

Table[Denominator[DivisorSigma[1, 2*n]/DivisorSigma[1, n]], {n, 1, 128}]

Table[BitXor[(n + 1), n], {n, 0, 100}] (* Vladimir Joseph Stephan Orlovsky, Jul 19 2011 *)

PROG

(C) int a(int n) { return n ^ (n-1); } // Russ Cox, May 15 2007

(Haskell)

import Data.Bits (xor)

a038712 n = n `xor` (n - 1) :: Integer  -- Reinhard Zumkeller, Apr 23 2012

(PARI) vector(66, n, bitxor(n, n+1)) \\ Joerg Arndt, Sep 01 2013

CROSSREFS

A038713 translated from binary, diagonals of A003987 on either side of main diagonal.

Cf. A062383. Partial sums give A080277.

Bisection of A089312. Cf. A088837.

a(n)-1 is exponent of 2 in A089893(n).

Cf. A130093.

This is Guy Steele's sequence GS(6, 2) (see A135416).

Cf. A168312, A220466.

Sequence in context: A021991 A112132 A053381 * A065745 A268670 A227873

Adjacent sequences:  A038709 A038710 A038711 * A038713 A038714 A038715

KEYWORD

easy,nonn,mult

AUTHOR

Henry Bottomley, May 02 2000

EXTENSIONS

Definition corrected by N. J. A. Sloane, Sep 07 2015 at the suggestion of Marc LeBrun

Name corrected by Wolfdieter Lang, Aug 30 2016

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 25 13:30 EST 2018. Contains 299654 sequences. (Running on oeis4.)