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-10 of 12 results. Next

A141395 Antidiagonal sums of the array A051776.

Original entry on oeis.org

1, 4, 9, 10, 28, 56, 72, 64, 105, 92, 119, 102, 82, 120, 169, 122, 170, 304, 404, 588, 795, 1064, 1369, 1602, 2026, 2304, 2766, 3128, 3533, 4080, 4202, 4068, 4187, 4220, 4439, 4638, 5154, 5400, 5762, 5652, 6451, 6532, 6941, 6778, 7568, 7784, 7403, 6350, 6124, 5832
Offset: 1

Views

Author

Gary W. Adamson, Jun 29 2008

Keywords

Examples

			a(4) = 28 = (5 + 8 + 2 + 8 + 5).
		

Crossrefs

Cf. A051776.

Extensions

Definition corrected and terms >= 122 added by R. J. Mathar, May 28 2011

A003987 Table of n XOR m (or Nim-sum of n and m) read by antidiagonals with m>=0, n>=0.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Another way to construct the array: construct an infinite square matrix starting in the top left corner using the rule that each entry is the smallest nonnegative number that is not in the row to your left or in the column above you.
After a few moves the [symmetric] matrix looks like this:
0 1 2 3 4 5 ...
1 0 3 2 5 ...
2 3 0 1 ?
3 2 1
4 5 ?
5
The ? is then replaced with a 6.

Examples

			Table begins
   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, ...
   1,  0,  3,  2,  5,  4,  7,  6,  9,  8, 11, 10, ...
   2,  3,  0,  1,  6,  7,  4,  5, 10, 11,  8, ...
   3,  2,  1,  0,  7,  6,  5,  4, 11, 10, ...
   4,  5,  6,  7,  0,  1,  2,  3, 12, ...
   5,  4,  7,  6,  1,  0,  3,  2, ...
   6,  7,  4,  5,  2,  3,  0, ...
   7,  6,  5,  4,  3,  2, ...
   8,  9, 10, 11, 12, ...
   9,  8, 11, 10, ...
  10, 11,  8, ...
  11, 10, ...
  12, ...
  ...
The first few antidiagonals are
   0;
   1,  1;
   2,  0,  2;
   3,  3,  3,  3;
   4,  2,  0,  2,  4;
   5,  5,  1,  1,  5,  5;
   6,  4,  6,  0,  6,  4,  6;
   7,  7,  7,  7,  7,  7,  7,  7;
   8,  6,  4,  6,  0,  6,  4,  6,  8;
   9,  9,  5,  5,  1,  1,  5,  5,  9,  9;
  10,  8, 10,  4,  2,  0,  2,  4, 10,  8, 10;
  11, 11, 11, 11,  3,  3,  3,  3, 11, 11, 11, 11;
  12, 10,  8, 10, 12,  2,  0,  2, 12, 10,  8, 10, 12;
  ...
[Symmetric] matrix in base 2:
     0    1   10   11  100  101,  110  111 1000 1001 1010 1011 ...
     1    0   11   10  101  100,  111  110 1001 1000 1011  ...
    10   11    0    1  110  111,  100  101 1010 1011  ...
    11   10    1    0  111  110,  101  100 1011  ...
   100  101  110  111    0    1    10   11  ...
   101  100  111  110    1    0    11  ...
   110  111  100  101   10   11   ...
   111  110  101  100   11  ...
  1000 1001 1010 1011  ...
  1001 1000 1011  ...
  1010 1011  ...
  1011  ...
   ...
		

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, NY, 1976, pp. 51-53.
  • Eric Friedman, Scott M. Garrabrant, Ilona K. Phipps-Morgan, A. S. Landsberg and Urban Larsson, Geometric analysis of a generalized Wythoff game, in Games of no Chance 5, MSRI publ. Cambridge University Press, date?
  • D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998; see p. 190. [From N. J. A. Sloane, Jul 14 2009]
  • R. K. Guy, Impartial games, pp. 35-55 of Combinatorial Games, ed. R. K. Guy, Proc. Sympos. Appl. Math., 43, Amer. Math. Soc., 1991.

Crossrefs

Initial rows are A001477, A004442, A004443, A004444, etc. Cf. A051775, A051776.
Cf. A003986 (OR), A004198 (AND), A221146 (carries).
Antidiagonal sums are in A006582.

Programs

  • 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:
    read("transforms") :
    A003987 := proc(n,m)
        XORnos(n,m) ;
    end proc: # R. J. Mathar, Apr 17 2013
    seq(seq(Bits:-Xor(k,m-k),k=0..m),m=0..20); # Robert Israel, Dec 31 2015
  • Mathematica
    Flatten[Table[BitXor[b, a - b], {a, 0, 10}, {b, 0, a}]] (* BitXor and Nim Sum are equivalent *)
  • PARI
    tabl(nn) = {for(n=0, nn, for(k=0, n, print1(bitxor(k, n - k),", ");); print(););};
    tabl(13) \\ Indranil Ghosh, Mar 31 2017
    
  • Python
    for n in range(14):
        print([k^(n - k) for k in range(n + 1)]) # Indranil Ghosh, Mar 31 2017

Formula

T(2i,2j) = 2T(i,j), T(2i+1,2j) = 2T(i,j) + 1.

A048720 Multiplication table {0..i} X {0..j} of binary polynomials (polynomials over GF(2)) interpreted as binary vectors, then written in base 10; or, binary multiplication without carries.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 4, 3, 0, 0, 4, 6, 6, 4, 0, 0, 5, 8, 5, 8, 5, 0, 0, 6, 10, 12, 12, 10, 6, 0, 0, 7, 12, 15, 16, 15, 12, 7, 0, 0, 8, 14, 10, 20, 20, 10, 14, 8, 0, 0, 9, 16, 9, 24, 17, 24, 9, 16, 9, 0, 0, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 0, 0, 11, 20, 27, 32, 27, 20, 27, 32, 27, 20, 11, 0
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Comments

Essentially same as A091257 but computed starting from offset 0 instead of 1.
Each polynomial in GF(2)[X] is encoded as the number whose binary representation is given by the coefficients of the polynomial, e.g., 13 = 2^3 + 2^2 + 2^0 = 1101_2 encodes 1*X^3 + 1*X^2 + 0*X^1 + 1*X^0 = X^3 + X^2 + X^0. - Antti Karttunen and Peter Munn, Jan 22 2021
To listen to this sequence, I find instrument 99 (crystal) works well with the other parameters defaulted. - Peter Munn, Nov 01 2022

Examples

			Top left corner of array:
  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 ...
  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
  0  2  4  6  8 10 12 14 16 18 20 22 24 26 28 30 ...
  0  3  6  5 12 15 10  9 24 27 30 29 20 23 18 17 ...
  ...
From _Antti Karttunen_ and _Peter Munn_, Jan 23 2021: (Start)
Multiplying 10 (= 1010_2) and 11 (= 1011_2), in binary results in:
     1011
  *  1010
  -------
   c1011
  1011
  -------
  1101110  (110 in decimal),
and we see that there is a carry-bit (marked c) affecting the result.
In carryless binary multiplication, the second part of the process (in which the intermediate results are summed) looks like this:
    1011
  1011
  -------
  1001110  (78 in decimal).
(End)
		

Crossrefs

Cf. A051776 (Nim-product), A091257 (subtable).
Carryless multiplication in other bases: A325820 (3), A059692 (10).
Ordinary {0..i} * {0..j} multiplication table: A004247 and its differences from this: A061858 (which lists further sequences related to presence/absence of carry in binary multiplication).
Carryless product of the prime factors of n: A234741.
Binary irreducible polynomials ("X-primes"): A014580, factorization table: A256170, table of "X-powers": A048723, powers of 3: A001317, rearranged subtable with distinct terms (comparable to A054582): A277820.
See A014580 for further sequences related to the difference between factorization into GF(2)[X] irreducibles and ordinary prime factorization of the integer encoding.
Row/column 3: A048724 (even bisection of A003188), 5: A048725, 6: A048726, 7: A048727; main diagonal: A000695.
Associated additive operation: A003987.
Equivalent sequences, as compared with standard integer multiplication: A048631 (factorials), A091242 (composites), A091255 (gcd), A091256 (lcm), A280500 (division).
See A091202 (and its variants) and A278233 for maps from/to ordinary multiplication.
See A115871, A115872 and A277320 for tables related to cross-domain congruences.

Programs

  • Maple
    trinv := n -> floor((1+sqrt(1+8*n))/2); # Gives integral inverses of the triangular numbers
    # Binary multiplication of nn and mm, but without carries (use XOR instead of ADD):
    Xmult := proc(nn,mm) local n,m,s; n := nn; m := mm; s := 0; while (n > 0) do if(1 = (n mod 2)) then s := XORnos(s,m); fi; n := floor(n/2); # Shift n right one bit. m := m*2; # Shift m left one bit. od; RETURN(s); end;
  • Mathematica
    trinv[n_] := Floor[(1 + Sqrt[1 + 8*n])/2];
    Xmult[nn_, mm_] := Module[{n = nn, m = mm, s = 0}, While[n > 0, If[1 == Mod[n, 2], s = BitXor[s, m]]; n = Floor[n/2]; m = m*2]; Return[s]];
    a[n_] := Xmult[(trinv[n] - 1)*((1/2)*trinv[n] + 1) - n, n - (trinv[n]*(trinv[n] - 1))/2];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Mar 16 2015, updated Mar 06 2016 after Maple *)
  • PARI
    up_to = 104;
    A048720sq(b,c) = fromdigits(Vec(Pol(binary(b))*Pol(binary(c)))%2, 2);
    A048720list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0, oo, for(col=0, a, i++; if(i > up_to, return(v)); v[i] = A048720sq(col, a-col))); (v); };
    v048720 = A048720list(up_to);
    A048720(n) = v048720[1+n]; \\ Antti Karttunen, Feb 15 2021

Formula

a(n) = Xmult( (((trinv(n)-1)*(((1/2)*trinv(n))+1))-n), (n-((trinv(n)*(trinv(n)-1))/2)) );
T(2b, c)=T(c, 2b)=T(b, 2c)=2T(b, c); T(2b+1, c)=T(c, 2b+1)=2T(b, c) XOR c - Henry Bottomley, Mar 16 2001
For n >= 0, A003188(2n) = T(n, 3); A003188(2n+1) = T(n, 3) XOR 1, where XOR is the bitwise exclusive-or operator, A003987. - Peter Munn, Feb 11 2021

A003991 Multiplication table read by antidiagonals: T(i,j) = i*j, i>=1, j>=1.

Original entry on oeis.org

1, 2, 2, 3, 4, 3, 4, 6, 6, 4, 5, 8, 9, 8, 5, 6, 10, 12, 12, 10, 6, 7, 12, 15, 16, 15, 12, 7, 8, 14, 18, 20, 20, 18, 14, 8, 9, 16, 21, 24, 25, 24, 21, 16, 9, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 11, 20, 27, 32, 35, 36, 35, 32, 27, 20, 11, 12, 22, 30, 36, 40, 42, 42, 40, 36, 30, 22, 12
Offset: 1

Views

Author

Keywords

Comments

Or, triangle X(n,m) = T(n-m+1,m) read by rows, in which row n gives the numbers n*1, (n-1)*2, (n-2)*3, ..., 2*(n-1), 1*n.
Radius of incircle of Pythagorean triangle with sides a=(n+1)^2-m^2, b=2*(n+1)*m and c=(n+1)^2+m^2. - Floor van Lamoen, Aug 16 2001
A permutation of A061017. - Matthew Vandermast, Feb 28 2003
In the proof of countability of rational numbers they are arranged in a square array. a(n) = p*q where p/q is the corresponding rational number as read from the array. - Amarnath Murthy, May 29 2003
Permanent of upper right n X n corner is A000442. - Marc LeBrun, Dec 11 2003
Row 12 gives total number of partridges, turtle doves, ... and drummers drumming that you have received at the end of the Twelve Days of Christmas song. - Alonso del Arte, Jun 17 2005
Consider a particle with spin S (a half-integer) and 2S+1 quantum states |m>, m = -S,-S+1,...,S-1,S. Then the matrix element = sqrt((S+m+1)(S-m)) of the spin-raising operator is the square-root of the triangular (tabl) element T(r,o) of this sequence in row r = 2S, and at offset o=2(S+m). T(r,o) is also the intensity || of the transition between the states |m> and |m+1>. For example, the five transitions between the 6 states of a spin S=5/2 particle have relative intensities 5,8,9,8,5. The total intensity of all spin 5/2 transitions (relative to spin 1/2) is 35, which is the tetrahedral number A000292(5). - Stanislav Sykora, May 26 2012
Sum_{k=0..2n-2} (-1)^k*a(A000124(2n-2)+k) = n. See A098359. - Charlie Marion, Apr 22 2013
T(n, k) is also the (k-1)-superdiagonal sum of an n X n Toeplitz matrix M(n) whose first row consists of successive positive integer numbers 1, ..., n. - Stefano Spezia, Jul 12 2019
From Eric Lengyel, Jun 28 2023: (Start)
X(n, m+1) is the number of degrees of freedom that an m-dimensional flat geometry (point, line, plane, etc.) has when embedded in an n-dimensional Euclidean space.
X(n+1, m+1) is the number of degrees of freedom that an m-ball has when embedded in an n-dimensional Euclidean space. (End)
T(n, k) is also the average number of steps it takes a person to fall off a board of length n+k, if the person starts a random walk at k. - Ruediger Jehn, May 12 2025

Examples

			The array T starts in row n=1 with columns m>=1 as:
   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
   2   4   6   8  10  12  14  16  18  20  22  24  26  28  30
   3   6   9  12  15  18  21  24  27  30  33  36  39  42  45
   4   8  12  16  20  24  28  32  36  40  44  48  52  56  60
   5  10  15  20  25  30  35  40  45  50  55  60  65  70  75
   6  12  18  24  30  36  42  48  54  60  66  72  78  84  90
   7  14  21  28  35  42  49  56  63  70  77  84  91  98 105
   8  16  24  32  40  48  56  64  72  80  88  96 104 112 120
   9  18  27  36  45  54  63  72  81  90  99 108 117 126 135
  10  20  30  40  50  60  70  80  90 100 110 120 130 140 150
The triangle X(n, m) begins
   n\m  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
   1:   1
   2:   2  2
   3:   3  4  3
   4:   4  6  6  4
   5:   5  8  9  8  5
   6:   6 10 12 12 10  6
   7:   7 12 15 16 15 12  7
   8:   8 14 18 20 20 18 14  8
   9:   9 16 21 24 25 24 21 16  9
  10:  10 18 24 28 30 30 28 24 18 10
  11:  11 20 27 32 35 36 35 32 27 20 11
  12:  12 22 30 36 40 42 42 40 36 30 22 12
  13:  13 24 33 40 45 48 49 48 45 40 33 24 13
  14:  14 26 36 44 50 54 56 56 54 50 44 36 26 14
  15:  15 28 39 48 55 60 63 64 63 60 55 48 39 28 15
  ... Formatted by _Wolfdieter Lang_, Dec 02 2014
		

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 46.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 5-6.

Crossrefs

Main diagonal gives squares A000290. Antidiagonal sums are tetrahedral numbers A000292. See A004247 for another version.

Programs

  • Magma
    /* As triangle */ [[k*(n-k+1): k in [1..n]]: n in [1..15]]; // Vincenzo Librandi, Jul 12 2019
  • Maple
    seq(seq(i*(n-i),i=1..n-1),n=2..10); # Robert Israel, Dec 14 2015
  • Mathematica
    Table[(x + 1 - y) y, {x, 13}, {y, x}] // Flatten (* Robert G. Wilson v, Oct 06 2007 *)
    f[n_] := Table[SeriesCoefficient[E^(x + y) (1+ x - y +x*y-y^2), {x, 0, i}, {y, 0, j}]*i!*j!, {i, n, n}, {j, 0, n}]; Flatten[Array[f, 11,0]] (* Stefano Spezia, Jul 12 2019 *)
  • PARI
    A003991(n,k) = if(k<1 || n<1,0,k*n)
    

Formula

Rectangular array: T(n, m) = n*m, n>=1, m>= 1.
Triangle X(n, m) = T(n-m+1, m) = (n-m+1)*m.
Sum_{i=1..n} Sum_{j=1..n} a(n) = A000537(n) [Sum of first n cubes; or n-th triangular number squared.] Determinant of all n X n contiguous subarrays of A003991 is 0. - Gerald McGarvey, Sep 26 2004
G.f. as rectangular array: x*y/((1 - x)^2*(1 - y)^2).
a(n) = i*j, where i=floor((1+sqrt(8n-7))/2), j=n-i*(i-1)/2. - Hieronymus Fischer, Aug 08 2007
As an infinite lower triangular matrix equals A000012 * A002260; where A000012 = (1; 1,1; 1,1,1; ...) and A002260 = (1; 1,2; 1,2,3; ...). - Gary W. Adamson, Oct 23 2007
As a linear array, the sequence is a(n) = A002260(n)*A004736(n) or a(n) = ((t*t+3*t+4)/2-n)*(n-(t*(t+1)/2)), where t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 17 2012
G.f. as linear array: (x - 3*x^2 + Sum_{k >= 0} ((k+2-x-(k+1)*x^2)*x^((k^2+3*k+4)/2)))/(1-x)^3. - Robert Israel, Dec 14 2015
E.g.f. as triangle: exp(x+y)*(1 + x - y + x*y - y^2). - Stefano Spezia, Jul 12 2019
a(n) = (1/2)*t + (n - 1/4)*t^2 - (1/4)*t^4 - n^2 + n, where t = floor(sqrt(2*n) + 1/2). - Ridouane Oudra, Nov 21 2020
a(n) = A003989(n) * A003990(n) = A059895(n) * A059896(n) = A059895(n)^2 * A059897(n). - Antti Karttunen, Dec 13 2021
T(n,k) = A002620(n+k) - A002620(n-k). - Michel Marcus, Jan 06 2023
T(n,k) = number of sums |x-y|+|y-z| = k, where x,y,z are in {1,2,...,n} and x < y < z. - Clark Kimberling, Jan 22 2024
E.g.f. as rectangular array: x*y*exp(x+y). - Stefano Spezia, Jun 27 2025

Extensions

More terms from Michael Somos

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 19 1999

Keywords

Comments

Note on an algorithm, R. J. Mathar, May 29 2011: (Start)
Let N* denote the Nim-product and N+ the Nim-sum (A003987) of two numbers, and let * and + denote the usual multiplication and addition.
To compute n N* m, write n and m separately as Nim-sums with the aid of the binary representation of n = n0 + n1*2 + n2*4 + n3*8 + n4*16.. and m = m0 + m1*2 + m2*4 + m3*8 + m4*16... . Because Nim-summation is the same as the binary XOR-function, the + may then be replaced by N+ in both sums:
n = Nim-sum_i 2^a(i) and m = Nim-sum_j 2^b(j) with two integer sequences a(i) and b(j).
Because N+ and N* are the operations in a field, N+ and N* are distributive, which is used to write the product over the sums as a double-Nim-sum over Nim-products:
n N* m = Nim-sum_{i,j} 2^a(i) N* 2^b(j) .
What remains is to compute the Nim-products of powers of 2.
Splitting a(i) and b(j) separately into (ordinary) products of Fermat numbers A001146 (i.e., writing a(i) and b(j) in binary), and noting that the ordinary product of distinct Fermat numbers equals the Nim-product of distinct Fermat numbers,
2^a(i) N* 2^b(j) = 2^(2^A0) N* 2^(2^A1) N* ... N* 2^(2^B0) N* 2^(2^B1) N* ... for two binary integer sequences A and B.
This finite product is regrouped by pairing the cases for the same bit in the A-sequence and in the B-sequence. If the bit is set in both sequences, use that the Nim-square of a Fermat number is 3/2 times (ordinary multiple of) that Fermat number; if the bit is set only in one of the two sequences, use (again) that the Nim-product of distinct Fermat numbers is the ordinary product.
Due to the potential presence of the Nim-squares, this leaves in general a Nim-product which is treated by recursion.
This algorithm is implemented in the Maple program in the b-file. nimprodP2() calculates the Nim-product of two powers of 2. (End)

Examples

			The table begins:
  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 ...
  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
  0  2  3  1  8 10 11  9 12 14 15 13  4  6  7  5 ...
  0  3  1  2 12 15 13 14  4  7  5  6  8 11  9 10 ...
  0  4  8 12  6  2 14 10 11 15  3  7 13  9  5  1 ...
  0  5 10 15  2  7  8 13  3  6  9 12  1  4 11 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;
  • PARI
    NP_table=Map(); NP(x,y)={ if(x<2 || y<2, x*y, mapisdefined(NP_table, if(y>x, [x,y]=[y,x], [x,y])), mapget(NP_table,[x,y]), x==3, y-1, x==2, 3, my(F=4); until(!F *= F, if(x<2*F, F=if(x>F, bitxor(NP(F,y), NP(x-F,y)), yi, bitxor(NP(t,i), NP(t,y-i)), NP(F\2*3, NP(t/F,i/F))); break(3))); if(y==t, F=NP(F\2*3, NP(t/F,t/F)); break(2))); if(x<2*t, F=bitxor(NP(t,y), NP(x-t,y)); break(2)))); mapput(NP_table,[x,y], F); F)} \\ M. F. Hasler, Jan 18 2021
    A051775(n,m="")={if(m!="", NP(n,m), NP((1+m=sqrtint(8*n+1)\/2)*m/2-n-1, n-m*(m-1)/2))} \\ Then A051775(n) = a(n) [flattened sequence, cf. A025581 & A002262], A051775(n,m) = T(n,m): for example, {matrix(6,15,m,n, A051775(m,n))} - M. F. Hasler, Jan 22 2021

A212200 Multiplicative order of n in nim-multiplication.

Original entry on oeis.org

1, 3, 3, 15, 15, 15, 15, 5, 15, 5, 15, 15, 5, 5, 15, 85, 85, 255, 255, 85, 85, 255, 255, 85, 85, 255, 255, 255, 255, 85, 85, 255, 255, 255, 255, 85, 255, 85, 255, 255, 255, 255, 255, 255, 85, 255, 85, 255, 85, 85, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 85, 85, 255, 255, 51, 255, 255, 255, 51, 255, 255, 17, 255, 85, 255, 17, 255, 85
Offset: 1

Views

Author

N. J. A. Sloane, May 03 2012

Keywords

Comments

For n <= 255, computed using R. J. Mathar's Maple programs from A051775. a(256) = 21845 from J. H. Conway and Alex Ryba, May 04 2012
Apparently, all terms belong to A001317, and A001317(k) appears 2^k times. - Rémy Sigrist, Jun 14 2020
From Jianing Song, Aug 10 2022: (Start)
The observation above is incorrect. Note that {0,1,...,2^2^k-1} together with the nim operations makes a field isomorphic to GF(2^2^k). This means that:
- Every number is a divisor of a number of the form 2^2^k-1, and every divisor of 2^2^k-1 for some k appears;
- If d is a divisor of 2^2^k-1 for some k, then d appears phi(d) times among {a(1),a(2),...,a(2^2^m-1)} for all m >= k, phi = A000010. This means that if d > 1, and k is the smallest number such that d | 2^2^k-1, then d can only appear among {a(2^2^(k-1)),...a(2^2^k-1)}.
So the correct result should be: all terms are divisors of numbers of the form 2^2^k-1, and each divisor d appears phi(d) times.
For example, 641 would appear 640 times in this sequence, among {a(2^32),...,a(2^64-1)}, although to determine their positions is hard. (End)

Examples

			The nim-products 4*4*...*4 are (cf. A051775): 4, 4^2=6, 4^3=4*6=14, 4^4=4*14=5, 4^5=2, 4^6=8, ..., 4^14=15, 4^15=1, so 4 has order a(4) = 15.
		

References

  • J. H. Conway, On Numbers and Games, Academic Press, Chapter 6.

Crossrefs

A051917 Inverse of n under Nim (or Conway) multiplication.

Original entry on oeis.org

1, 3, 2, 15, 12, 9, 11, 10, 6, 8, 7, 5, 14, 13, 4, 170, 160, 109, 107, 131, 139, 116, 115, 228, 234, 92, 89, 73, 77, 220, 209, 85, 214, 80, 219, 199, 179, 203, 184, 66, 226, 70, 236, 156, 247, 149, 248, 255, 182, 189, 240, 120, 164, 174, 127, 142, 100, 98, 134
Offset: 1

Views

Author

David A. Madore, Dec 18 1999

Keywords

Comments

The Conway product makes N into a field of characteristic 2. This is the inverse function for that field.

Examples

			a(4)=15 because the Conway product of 4 and 15 is 1. And a(15)=4.
		

References

  • E. R. Berlekamp, J. H. Conway and R. K. Guy, ``Winning Ways'', p. 443.
  • J. H. Conway, ``On Numbers and Games'', chapter 6.

Crossrefs

Cf. A051776.

Extensions

More terms from John W. Layman, Mar 01 2001

A006042 The nim-square of n.

Original entry on oeis.org

0, 1, 3, 2, 6, 7, 5, 4, 13, 12, 14, 15, 11, 10, 8, 9, 24, 25, 27, 26, 30, 31, 29, 28, 21, 20, 22, 23, 19, 18, 16, 17, 52, 53, 55, 54, 50, 51, 49, 48, 57, 56, 58, 59, 63, 62, 60, 61, 44, 45, 47, 46, 42, 43, 41, 40, 33, 32, 34, 35, 39, 38, 36, 37, 103, 102, 100, 101, 97, 96, 98, 99
Offset: 0

Views

Author

Keywords

Comments

This is a permutation of the natural numbers; A160679 is the inverse permutation. - Jianing Song, Aug 10 2022

References

  • J. H. Conway, On Numbers and Games. Academic Press, NY, 1976, pp. 51-53.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Diagonal of A051775. Without 0, diagonal of A051776.
Column 2 of array in A335162.
Other nim k-th powers: A051917 (k=-1), A160679 (k=1/2), A335170 (k=3), A335535 (k=4), A335171 (k=5), A335172 (k=6), A335173 (k=7), A335536 (k=8).

Programs

Formula

a(n) = A051775(n,n).
From Jianing Song, Aug 10 2022: (Start)
If n = Sum_j 2^e(j), then a(n) is the XOR of A006017(e(j))'s. Proof: let N+ = XOR and N* denote the nim addition and the nim multiplication, then n N* n = (Sum_j 2^e(j)) N* (Sum_j 2^e(j)) = (Nim-sum_j 2^e(j)) N* (Nim-sum_j 2^e(j)) = (Nim-sum_j (2^e(j) N* 2^e(j))) N+ (Nim-sum_{i
For example, for n = 11 = 2^0 + 2^1 + 2^3, a(11) = A006017(0) XOR A006017(1) XOR A006017(3) = 1 XOR 3 XOR 13 = 15.
More generally, if n = Sum_j 2^e(j), k is a power of 2, then the nim k-th power of n is the XOR of (nim k-th power of 2^e(j))'s. (End)

Extensions

a(1)-a(49) confirmed, a(50)-a(71) added by John W. Layman, Nov 05 2010
a(0) prepended by Jianing Song, Aug 10 2022

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

Original entry on oeis.org

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

Author

N. J. A. Sloane, Dec 20 1999

Keywords

Examples

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

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

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) = A051776(n,m).

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

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-10 of 12 results. Next