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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051933 Triangle T(n,m) = Nim-sum (or XOR) of n and m, read by rows, 0<=m<=n. 5
0, 1, 0, 2, 3, 0, 3, 2, 1, 0, 4, 5, 6, 7, 0, 5, 4, 7, 6, 1, 0, 6, 7, 4, 5, 2, 3, 0, 7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15, 0, 9, 8, 11, 10, 13, 12, 15, 14, 1, 0, 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, 11, 10, 9, 8, 15, 14, 13, 12, 3, 2, 1, 0, 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

0,4

REFERENCES

E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see p. 60.

J. H. Conway, On Numbers and Games, Academic Press, p. 52.

LINKS

R. J. Mathar and R. Zumkeller, Rows n = 0..127 of triangle, flattened first 50 rows by R. J. Mathar

Index entries for sequences related to Nim-sums

EXAMPLE

{0},

{1,0},

{2,3,0},

{3,2,1,0}, ...

MAPLE

nimsum := proc(a, b) local t1, t2, t3, t4, l; t1 := convert(a+2^20, base, 2); t2 := convert(b+2^20, base, 2); t3 := evalm(t1+t2); map(x->x mod 2, t3); t4 := convert(evalm(%), list); l := convert(t4, base, 2, 10); sum(l[k]*10^(k-1), k=1..nops(l)); end; # memo: adjust 2^20 to be much bigger than a and b

AT := array(0..N, 0..N); for a from 0 to N do for b from a to N do AT[a, b] := nimsum(a, b); AT[b, a] := AT[a, b]; od: od:

MATHEMATICA

Flatten[Table[BitXor[m, n], {m, 0, 12}, {n, 0, m}]] (* Jean-Fran├žois Alcover, Apr 29 2011 *)

PROG

(Haskell)

import Data.Bits (xor)

a051933 n k = n `xor` k :: Int

a051933_row n = map (a051933 n) [0..n]

a051933_tabl = map a051933_row [0..]

-- Reinhard Zumkeller, Aug 02 2014, Aug 13 2013

CROSSREFS

Cf. A051776, A003987, A051775, A051776, A051910, A051911.

Cf. A002262, A080098 (OR), A080099 (AND).

Cf. A265705 (IMPL).

Sequence in context: A137998 A080593 A193682 * A234963 A131900 A082116

Adjacent sequences:  A051930 A051931 A051932 * A051934 A051935 A051936

KEYWORD

tabl,nonn,easy,nice,hear,look

AUTHOR

N. J. A. Sloane, Dec 20 1999

EXTENSIONS

More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999

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 March 26 00:51 EDT 2017. Contains 284111 sequences.