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!)
A038713 a(n) = n XOR (n-1), i.e., nim-sum of sequential pairs, written in binary. 3
1, 11, 1, 111, 1, 11, 1, 1111, 1, 11, 1, 111, 1, 11, 1, 11111, 1, 11, 1, 111, 1, 11, 1, 1111, 1, 11, 1, 111, 1, 11, 1, 111111, 1, 11, 1, 111, 1, 11, 1, 1111, 1, 11, 1, 111, 1, 11, 1, 11111, 1, 11, 1, 111, 1, 11, 1, 1111, 1, 11, 1, 111, 1, 11, 1, 1111111, 1, 11, 1, 111, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..1000

Index entries for sequences related to Nim-sums

FORMULA

a(n) = (10^A001511(n) - 1)/(10 - 1).

Multiplicative with a(2^e) = (10^(e+1) - 1)/9, a(p^e)=1 if p odd.

Multiplicative with a(p^e) = (10^e - 1)/9 if p = 2, 1 otherwise.

G.f.: Sum_{k>=0} 10^k * x^(2^k) / (1 - x^(2^k)). - Ilya Gutkovskiy, Dec 15 2020

EXAMPLE

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

MATHEMATICA

Table[(10^IntegerExponent[2*n, 2] - 1)/9, {n, 100}] (* Vincenzo Librandi, Mar 11 2013 *)

PROG

(PARI) a(n)=if(n<1, 0, (10^(valuation(n, 2)+1)-1)/9) /* Michael Somos, Apr 28 2005 */

(MAGMA) [(10^(Valuation(n, 2)+1)-1)/9: n in [1..70]]; // Vincenzo Librandi, Mar 11 2013

CROSSREFS

Cf. A038712 translated to binary, A001511 translated to unary (repeated 1's).

Sequence in context: A289092 A104490 A164851 * A130556 A277932 A290676

Adjacent sequences:  A038710 A038711 A038712 * A038714 A038715 A038716

KEYWORD

mult,easy,nonn

AUTHOR

Henry Bottomley, May 02 2000

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 September 24 12:17 EDT 2021. Contains 347642 sequences. (Running on oeis4.)