cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A051776 Table T(n,m) = Nim-product of n and m, read by antidiagonals, for n >= 1, m >= 1.

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 4, 1, 1, 4, 5, 8, 2, 8, 5, 6, 10, 12, 12, 10, 6, 7, 11, 15, 6, 15, 11, 7, 8, 9, 13, 2, 2, 13, 9, 8, 9, 12, 14, 14, 7, 14, 14, 12, 9, 10, 14, 4, 10, 8, 8, 10, 4, 14, 10, 11, 15, 7, 11, 13, 5, 13, 11, 7, 15, 11, 12, 13, 5, 15, 3, 3, 3, 3, 15, 5
Offset: 1

Views

Author

N. J. A. Sloane, Dec 19 1999

Keywords

Examples

			Table begins:
  1  2  3  4  5  6 ...
  2  3  1  8 10 11 ...
  3  1  2 12 15 13 ...
  4  8 12  6  2 14 ...
		

References

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

Crossrefs

Programs

  • Maple
    We continue from A003987: to compute a Nim-multiplication table using (a) an addition table AT := array(0..NA, 0..NA) and (b) a nimsum procedure for larger values; MT := array(0..N,0..N); for a from 0 to N do MT[a,0] := 0; MT[0,a] := 0; MT[a,1] := a; MT[1,a] := a; od: for a from 2 to N do for b from a to N do t1 := {}; for i from 0 to a-1 do for j from 0 to b-1 do u1 := MT[i,b]; u2 := MT[a,j];
    if u1<=NA and u2<=NA then u12 := AT[u1,u2]; else u12 := nimsum(u1,u2); fi; u3 := MT[i,j]; if u12<=NA and u3<=NA then u4 := AT[u12,u3]; else u4 := nimsum(u12,u3); fi; t1 := { op(t1), u4}; #t1 := { op(t1), AT[ AT[ MT[i,b], MT[a,j] ], MT[i,j] ] }; od; od;
    t2 := sort(convert(t1,list)); j := nops(t2); for i from 1 to nops(t2) do if t2[i] <> i-1 then j := i-1; break; fi; od; MT[a,b] := j; MT[b,a] := j; od; od;

Formula

T(n,m) = A051775(n,m).

A051933 Triangle T(n,m) = Nim-sum (or XOR) of n and m, read by rows, 0<=m<=n.

Original entry on oeis.org

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
Offset: 0

Views

Author

N. J. A. Sloane, Dec 20 1999

Keywords

Examples

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

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.

Crossrefs

Cf. A224915 (row sums), A003987 (array), A051910 (Nim-product).
Other triangles: A080099 (AND), A080098 (OR), A265705 (IMPL), A102037 (CNIMPL), A002262 (k).

Programs

  • 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
    
  • Julia
    using IntegerSequences
    A051933Row(n) = [Bits("XOR", n, k) for k in 0:n]
    for n in 0:10 println(A051933Row(n)) end  # Peter Luschny, Sep 25 2021
  • 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:
    # Alternative:
    A051933 := (n, k) -> Bits:-Xor(n, k):
    seq(seq(A051933(n, k), k=0..n), n=0..12); # Peter Luschny, Sep 23 2019
  • Mathematica
    Flatten[Table[BitXor[m, n], {m, 0, 12}, {n, 0, m}]] (* Jean-François Alcover, Apr 29 2011 *)

Extensions

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

A051911 Triangle T(n,m) = Nim-product of n and m, read by rows, 1<=n<=m.

Original entry on oeis.org

1, 2, 3, 3, 1, 2, 4, 8, 12, 6, 5, 10, 15, 2, 7, 6, 11, 13, 14, 8, 5, 7, 9, 14, 10, 13, 3, 4, 8, 12, 4, 11, 3, 7, 15, 13, 9, 14, 7, 15, 6, 1, 8, 5, 12, 10, 15, 5, 3, 9, 12, 6, 1, 11, 14, 11, 13, 6, 7, 12, 10, 1, 9, 2, 4, 15, 12, 4, 8, 13, 1, 9, 5, 6, 10, 2, 14, 11, 13, 6, 11, 9, 4, 15, 2, 14, 3, 8
Offset: 1

Views

Author

N. J. A. Sloane, Dec 20 1999

Keywords

Comments

A051910 with the first column (the zeros) removed.

Examples

			Triangle starts
1;
2,  3;
3,  1,  2;
4,  8, 12,  6;
5, 10, 15,  2,  7;
6, 11, 13, 14,  8, 5;
7,  9, 14, 10, 13, 3,  4;
8, 12,  4, 11,  3, 7, 15, 13;
		

References

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

Crossrefs

Extensions

More terms (taken from the Conway reference) from Joshua Zucker, May 03 2006
Showing 1-3 of 3 results.