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 10 results.

A004481 Table of Sprague-Grundy values for Wythoff's game (Wyt Queens) read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

T(a,b) = T(b,a).

Examples

			Table begins
   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, ...
   1,  2,  0,  4,  5,  3,  7,  8,  6, 10, 11,  9, ...
   2,  0,  1,  5,  3,  4,  8,  6,  7, 11,  9, ...
   3,  4,  5,  6,  2,  0,  1,  9, 10, 12, ...
   4,  5,  3,  2,  7,  6,  9,  0,  1, ...
   5,  3,  4,  0,  6,  8, 10,  1, ...
   6,  7,  8,  1,  9, 10,  3, ...
   7,  8,  6,  9,  0,  1, ...
   8,  6,  7, 10,  1, ...
   9, 10, 11, 12, ...
  10, 11,  9, ...
  11,  9, ...
  12, ...
  ...
		

References

  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see p. 76.
  • 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?
  • R. K. Guy, The unity of combinatorics, Proc. 25th Iranian Math. Conf, Tehran, (1994), Math. Appl 329 129-159, Kluwer Dordrecht 1995, Math. Rev. 96k:05001.

Crossrefs

A004482-A004487 are rows 1 to 6. Cf. A047708 (main diagonal).
See A317205 for triangle of values on or below main diagonal.
Similar to but different from A004489.
T(a, b)=0 iff A018219(a, b)=0 iff A002251(a)=b.

Programs

  • Mathematica
    mex[list_] := mex[list] = Min[Complement[Range[0, Length[list]], list]];
    move[Wnim, {a_, b_}] := move[Wnim, {a, b}] =
       Union[Table[{i, b}, {i, 0, a - 1}], Table[{a, i}, {i, 0, b - 1}],
        Table[{a - i, b - i}, {i, 1, Min[a, b]}]];
    SpragueGrundy[game_, list_] := SpragueGrundy[game, list] =
       mex[SpragueGrundy[game, #] & /@ move[game, list]];
    t[n_, m_] := SpragueGrundy[Wnim, {n - 1, m - 1}];
    Flatten@Table[t[n - m + 1, m], {n, 11}, {m, n}] (* Birkas Gyorgy, Apr 19 2011 *)
  • PARI
    See Links section.

A274315 First row of infinite Sudoku-type array A269526.

Original entry on oeis.org

1, 3, 2, 6, 4, 5, 10, 11, 13, 8, 14, 18, 7, 20, 19, 9, 12, 24, 26, 23, 25, 29, 16, 15, 35, 31, 38, 40, 37, 39, 41, 17, 43, 42, 47, 46, 45, 52, 27, 21, 22, 51, 58, 53, 60, 50, 56, 62, 64, 63, 67, 66, 68, 73, 72, 59, 74, 28, 77, 76, 70, 71, 30, 87, 32, 83, 84, 33, 34, 89, 88, 92, 91, 36, 98, 93, 96
Offset: 1

Views

Author

N. J. A. Sloane, Jun 29 2016

Keywords

Comments

Conjectured to be a permutation of the natural numbers.
It would be nice to have a formula or recurrence. Note that the first row of the analogous array corresponding to the Wythoff game, A004482, does have a simple formula.
See A295563 for much more about this sequence. - N. J. A. Sloane, Mar 10 2019

Crossrefs

A296339 On an infinite 60-degree sector of hexagonal graph paper, fill in cells by antidiagonals so that each contains the least nonnegative integer such that no line of edge-adjacent cells contains a repeated term.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 10 2017

Keywords

Comments

To find the number to enter in a cell (assuming the sector is oriented as in the illustration in the link), look at all the numbers in the cells directly above the cell, in the cells to the "North-West", and in the cells to the "South-West", and take their "mex" (the smallest missing number).
The 0-cells in the array all lie on a perfectly straight line (in contrast to the situation in A274528). Also a(n) = 0 iff n = 2*m*(m+1) for some m.

Examples

			The initial rows are as follows (however, this does not show the adjancies between the cells correctly - for that, see the illustration in the link):
   0;
   1,  2;
   2,  0,  1;
   3,  1,  2,  4;
   4,  5,  0,  3,  6;
   5,  3,  4,  6,  7,  8;
   6,  4,  5,  0,  3,  9,  7;
   7,  8,  3,  1,  2,  4,  5,  9;
   8,  6,  7,  2,  0,  1,  9,  4,  3;
   9,  7,  8,  5,  1,  2,  6, 10, 11, 12;
  10, 11,  6,  9,  4,  0, ...
  ...
For example, referring to the illustration in the link and NOT to the triangle here, consider the first 5 in the array. The reason this is 5 is because in the column of cells above that cell we can see 2,0,1, to the NW we see 3, and to the SW we see 4, and the smallest missing number is 5.
		

Crossrefs

Two analogs of this for an infinite square chessboard are A269526 (which uses positive numbers) and A274528 (which uses nonnegative numbers).
For the right edge see A296340.
The second column is A004483. - Rémy Sigrist, Dec 11 2017
The third and fourth columns are A004482 and A298801.
See also A274820.

Programs

  • Mathematica
    ab = Table[0, {13}];
    nw = ab;
    A296339 = Reap[For[s = 1, s <= Length[ab], s++, sw = 0; For[c = 1, c <= s, c++, x = BitOr[ab[[c]], BitOr[nw[[s-c+1]], sw]]; v = IntegerExponent[x+1, 2]; Sow[v]; p = 2^v; sw += p; ab[[c]] += p; nw[[s-c+1]] += p]]][[2, 1]] (* Jean-François Alcover, Dec 18 2017, after Rémy Sigrist *) (* I changed the first line, which was ab = Table[0, 13];, to make this compatible with older versions of MMA - N. J. A. Sloane, Feb 03 2018 *)
  • PARI
    See Links section.

Extensions

More terms from Rémy Sigrist, Dec 11 2017

A295563 First row of array in A274528.

Original entry on oeis.org

0, 2, 1, 5, 3, 4, 9, 10, 12, 7, 13, 17, 6, 19, 18, 8, 11, 23, 25, 22, 24, 28, 15, 14, 34, 30, 37, 39, 36, 38, 40, 16, 42, 41, 46, 45, 44, 51, 26, 20, 21, 50, 57, 52, 59, 49, 55, 61, 63, 62, 66, 65, 67, 72, 71, 58, 73, 27, 76, 75, 69, 70, 29, 86, 31, 82, 83, 32, 33, 88, 87, 91, 90, 35, 97, 92, 95
Offset: 0

Views

Author

N. J. A. Sloane, Nov 29 2017

Keywords

Comments

Note this is not a list, this gives the Grundy-value at (0,n) of the Lonely Queens array A274528 regarded as a game.
It would be nice to have a formula or recurrence. Note that the first row of the analogous array corresponding to the Wythoff game, A004482, does have a simple formula.
The points seem to fall on or close to two lines, of slopes about 0.48 and 1.29 (what are these slopes?). See A295564, A295565, A295566, A295567 for the X- and Y-coordinates of the points on the two lines.

Crossrefs

Programs

  • PARI
    See Links section.

A330396 Permutation of the nonnegative integers partitioned into triples [3*k+2, 3*k+1, 3*k] for k >= 0.

Original entry on oeis.org

2, 1, 0, 5, 4, 3, 8, 7, 6, 11, 10, 9, 14, 13, 12, 17, 16, 15, 20, 19, 18, 23, 22, 21, 26, 25, 24, 29, 28, 27, 32, 31, 30, 35, 34, 33, 38, 37, 36, 41, 40, 39, 44, 43, 42, 47, 46, 45, 50, 49, 48, 53, 52, 51, 56, 55, 54, 59, 58, 57, 62, 61, 60, 65, 64, 63, 68, 67, 66, 71, 70, 69, 74, 73, 72, 77, 76, 75, 80, 79, 78, 83, 82
Offset: 0

Views

Author

Guenther Schrack, Mar 03 2020

Keywords

Comments

Partition the nonnegative integer sequence into triples starting with (0,1,2); transpose the first and third elements of the triple, repeat for all triples.
A self-inverse sequence: a(a(n)) = n.
The sequence is an interleaving of A016789 with A016777 and with A008585, in that order.

Crossrefs

Fixed point sequence: A016777.
Relationships:
a(n) = a(n-1) - 1 + 6*A079978(n).
a(n) = 2*a(n-1) - a(n-2) + 6*A049347(n).
a(n) = A074066(n+2) - 2.
a(n) = A113655(n+1) - 1.

Programs

  • MATLAB
    a = zeros(1,10000);
    w = (-1+sqrt(-3))/2;
    fprintf('0 2\n');
    for n = 1:10000
       a(n) = int64((3*n + 2*w^(2*n)*(w + 2) + 2*w^n*(1 - w))/3);
       fprintf('%i %i\n',n,a(n));
    end

Formula

G.f.: (2 - x - x^2 + 3*x^3)/((x-1)^2*(1 + x + x^2)). [corrected by Georg Fischer, Apr 17 2020]
Linear recurrence: a(n) = a(n-1) + a(n-3) - a(n-4) for n > 4.
Simple recursion: a(n) = a(n-3) + 3 for n > 2 with a(0) = 2, a(1) = 1, a(2) = 0.
Negative domain: a(-n) = -(a(n-1) + 1).
Explicit formulas:
a(n) = n + 2 - 2*(n mod 3).
a(n) = 2 - n + 6*floor(n/3).
a(n) = n + 2*(w^(2*n)*(2 + w) + w^n*(1 - w))/3 where w = (-1 + sqrt(-3))/2.

A059249 Tersum n + (n-1); write n and n-1 in base 3 and add mod 3 with no carries.

Original entry on oeis.org

1, 0, 5, 7, 6, 2, 4, 3, 17, 19, 18, 23, 25, 24, 20, 22, 21, 8, 10, 9, 14, 16, 15, 11, 13, 12, 53, 55, 54, 59, 61, 60, 56, 58, 57, 71, 73, 72, 77, 79, 78, 74, 76, 75, 62, 64, 63, 68, 70, 69, 65, 67, 66, 26, 28, 27, 32, 34, 33, 29, 31, 30, 44, 46, 45, 50, 52, 51, 47, 49, 48, 35
Offset: 1

Views

Author

Henry Bottomley, Jan 22 2001

Keywords

Examples

			a(21)=14 since 21 and 20 are written in base 3 as 210 and 202 and so their tersum is 112 in base 3, i.e. 9+3+2=14.
		

Crossrefs

A071770 Tersum n + [n/3] (answer recorded in base 10).

Original entry on oeis.org

0, 1, 2, 4, 5, 3, 8, 6, 7, 12, 13, 14, 16, 17, 15, 11, 9, 10, 24, 25, 26, 19, 20, 18, 23, 21, 22, 36, 37, 38, 40, 41, 39, 44, 42, 43, 48, 49, 50, 52, 53, 51, 47, 45, 46, 33, 34, 35, 28, 29, 27, 32, 30, 31, 72, 73, 74, 76, 77, 75, 80, 78, 79, 57, 58, 59, 61, 62, 60, 56, 54, 55, 69, 70
Offset: 0

Views

Author

Paul D. Hanna, Jun 04 2002

Keywords

Crossrefs

Cf. A004482.
Inverse permutation to A370932.

Programs

  • Maple
    a:= n-> (l-> add(irem(l[i]+l[i-1], 3)*3^(i-2),
             i=2..nops(l)))([convert(n, base, 3)[], 0]):
    seq(a(n), n=0..73);  # Alois P. Heinz, Aug 07 2024
  • PARI
    a(n)={if(n==0, 0, fromdigits((digits(n,3) + concat([0],digits(n\3,3)))%3,3))} \\ Andrew Howroyd, Aug 06 2024
    
  • Python
    from sympy.ntheory import digits
    def a(n):
        d = digits(n, 3)[1:]
        return int(str(d[0]) + "".join(str((d[i]+d[i-1])%3) for i in range(1, len(d))), 3)
    print([a(n) for n in range(75)]) # Michael S. Branicky, Aug 07 2024

Formula

Tersum m + n: write m and n in base 3 and add mod 3 with no carries, e.g. 5 + 8 = "21" + "22" = "10" = 1. See A004482 for references.

Extensions

a(27) corrected by Sean A. Irvine, Aug 06 2024

A004498 Tersum n + 9.

Original entry on oeis.org

9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 1, 2, 3, 4, 5, 6, 7, 8, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 27, 28, 29, 30, 31, 32, 33, 34, 35, 63, 64, 65, 66
Offset: 0

Views

Author

Keywords

Crossrefs

Formula

Tersum m + n: write m and n in base 3 and add mod 3 with no carries; e.g., 5 + 8 = "21" + "22" = "10" = 1.

A298801 Fourth column of triangular array in A296339.

Original entry on oeis.org

4, 3, 6, 0, 1, 2, 5, 9, 12, 7, 8, 15, 10, 11, 18, 13, 14, 21, 16, 17, 24, 19, 20, 27, 22, 23, 30, 25, 26, 33, 28, 29, 36, 31, 32, 39, 34, 35, 42, 37, 38, 45, 40, 41, 48, 43, 44, 51, 46, 47, 54, 49, 50, 57, 52, 53, 60, 55, 56, 63, 58, 59, 66, 61, 62, 69, 64, 65, 72, 67, 68, 75, 70, 71, 78, 73, 74, 81, 76
Offset: 0

Views

Author

N. J. A. Sloane, Feb 02 2018

Keywords

Comments

This was the first column of A296339 for which no simple formula was known (cf. A004483, A004482). (Since these are Grundy values for a certain game, there is a complicated recurrence involving the whole triangle.) The formula below matches the data, and is fairly short (but ugly).

Crossrefs

Formula

It appears that for n >= 8, a(n) = tersum(n,1) + 6 if n == 2 (mod 3), otherwise tersum(n,1) - 3.
Conjectures from Colin Barker, Feb 03 2018: (Start)
G.f.: (4 - x + 3*x^2 - 10*x^3 + 2*x^4 - 2*x^5 + 9*x^6 + 3*x^7 + 2*x^8 - 8*x^9 - 3*x^10 + 4*x^11) / ((1 - x)^2*(1 + x + x^2)).
a(n) = a(n-1) + a(n-3) - a(n-4) for n>11.
(End)

A004499 Tersum n + 10.

Original entry on oeis.org

10, 11, 9, 13, 14, 12, 16, 17, 15, 19, 20, 18, 22, 23, 21, 25, 26, 24, 1, 2, 0, 4, 5, 3, 7, 8, 6, 37, 38, 36, 40, 41, 39, 43, 44, 42, 46, 47, 45, 49, 50, 48, 52, 53, 51, 28, 29, 27, 31, 32, 30, 34, 35, 33, 64, 65, 63, 67
Offset: 0

Views

Author

Keywords

Crossrefs

Formula

Tersum m + n: write m and n in base 3 and add mod 3 with no carries; e.g., 5 + 8 = "21" + "22" = "10" = 1.
Showing 1-10 of 10 results.