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.

Previous Showing 11-20 of 22 results. Next

A018219 Table T(a,b) by antidiagonals of winning positions in 3-pile Wythoff game (a square array).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

(a,b,T(a,b)) are the winning positions in 3-pile Wythoff game. A move in k-pile Wythoff is: pick a subset of the k piles and remove the same number of stones from each. Goal: take the last stone.
T(a,b) = T(b,a). If T(a,b)=c then T(a,c)=b and T(b,c)=a.

Examples

			0 2 1 5 7 ...
2 4 0 3 1 ...
1 0 6 8 10 ...
5 3 8 1 4 ...
7 1 10 4 3 ...
T(1,1)=4, since from (114) your opponent can move to (113),(112),(111),(110),(014),(013),(004),(003). You can either win or move to (012) and win a move later.
		

Crossrefs

Rows 0-3: A002251, A018220-A018222. Main diagonal: A051261.
T(a, b)=0 iff A004481(a, b)=0 iff A002251(a)=b.

Programs

  • Mathematica
    mex[ s_ ] := Min[ Complement[ Range[ 0, Max[ {s, -1} ]+1 ], Flatten[ s ] ] ]; f[ s_ ] := Join[ s, s+Table[ i, {i, Length[ s ]} ] ]; T[ a_, b_ ] := T[ a, b ] = mex[ { f[ Table[ T[ a-i, b ], {i, a} ] ], f[ Table[ T[ a, b-i ], {i, b} ] ], f[ Table[ T[ a-i, b-i ], {i, Min[ a, b ]} ] ] } ]

Extensions

Edited and extended by Christian G. Bower, Oct 29 2002

A275895 "Greedy Queens" permutation of the nonnegative integers.

Original entry on oeis.org

0, 2, 4, 1, 3, 8, 10, 12, 14, 5, 7, 18, 6, 21, 9, 24, 26, 28, 30, 11, 13, 34, 36, 38, 40, 15, 17, 44, 16, 47, 19, 50, 52, 20, 55, 57, 59, 22, 62, 23, 65, 27, 25, 69, 71, 73, 75, 77, 29, 31, 81, 83, 85, 32, 88, 33, 91, 37, 35, 95, 97, 99, 101, 39, 104, 106, 41, 109, 42, 112, 43, 115, 117, 119, 45, 122
Offset: 0

Views

Author

N. J. A. Sloane, Aug 23 2016

Keywords

Comments

This permutation is produced by a simple greedy algorithm: starting from the top left corner of an infinite chessboard placed in the fourth quadrant of the plane, walk along successive antidiagonals and place a queen in the first available position where it is not threatened by any of the existing queens. In other words, this permutation satisfies the condition that p(i+d) <> p(i)+-d for all i and d >= 1.
The rows and columns are indexed starting at 0. p(n) = k means that a queen appears in column n in row k. - N. J. A. Sloane, Aug 18 2016
All of A065188 (same for positive integers), A065189, A199134, A275884 should really have started at 0 rather than 1. Then the graph of A065188, for example, would be comparable with the graph of A002251.
That this is a permutation of the nonnegative integers follows from the proof in A269526 that every row and every column in that array is a permutation of the positive integers. In particular, every row and every column contains a 0 (which translates to a queen in the present sequence). - N. J. A. Sloane, Dec 10 2017

Crossrefs

Cf. A065188 (same for positive integers), A065189 (it's inverse), A199134 (indices of a(n) < n), A275884 (complement), A275894 (same for "nonnegative", i.e., this sequence), A275896 (same for A065189), A002251 (Wythoff pairs).

Formula

a(n) = A065188(n+1)-1.

A275894 a(n) = A275884(n+1) - 1.

Original entry on oeis.org

0, 1, 2, 5, 6, 7, 8, 11, 13, 15, 16, 17, 18, 21, 22, 23, 24, 27, 29, 31, 32, 34, 35, 36, 38, 40, 43, 44, 45, 46, 47, 50, 51, 52, 54, 56, 59, 60, 61, 62, 64, 65, 67, 69, 71, 72, 73, 75, 78, 80, 81, 82, 83, 86, 87, 88, 91, 92, 93, 95, 96, 97, 99, 102, 104, 105, 106, 108, 109, 111, 113, 114, 117, 118, 120
Offset: 0

Views

Author

N. J. A. Sloane, Aug 23 2016

Keywords

Comments

A065188, A065189, A199134, and A275884 should really have started at 0 rather than 1. Then the graph of A065188, for example, would be comparable with the graph of A002251.
From Michel Dekking, Jun 24 2023: (Start)
It is the other way around: the sequence A002251 should have offset 1. This is very logical as the sequence A002251 is defined as the swapping of the sequences L = A000201, U = A001950, two sequences which both have offset 1.
The sequence A002251 already occurs in the OEIS with offset 1 as row 1 in sequence A054081.
(End)

Crossrefs

A275893 a(n) = A199134(n+1)-1.

Original entry on oeis.org

3, 4, 9, 10, 12, 14, 19, 20, 25, 26, 28, 30, 33, 37, 39, 41, 42, 48, 49, 53, 55, 57, 58, 63, 66, 68, 70, 74, 76, 77, 79, 84, 85, 89, 90, 94, 98, 100, 101, 103, 107, 110, 112, 115, 116, 119, 122, 127, 128, 131, 132, 135, 140, 142, 143, 145, 150, 151, 153, 155, 159, 162, 166, 168, 170, 171, 176, 177
Offset: 0

Views

Author

N. J. A. Sloane, Aug 23 2016

Keywords

Comments

All of A065188, A065189, A199134, A275884 should really have started at 0 rather than 1. Then the graph of A065188, for example, would be comparable with the graph of A002251.

Crossrefs

A090908 Terms a(k) of A073869 for which a(k) is distinct from a(k-1).

Original entry on oeis.org

1, 3, 4, 6, 8, 9, 11, 12, 14, 16, 17, 19, 21, 22, 24, 25, 27, 29, 30, 32, 33, 35, 37, 38, 40, 42, 43, 45, 46, 48, 50, 51, 53, 55, 56, 58, 59, 61, 63, 64, 66, 67, 69, 71, 72, 74, 76, 77, 79, 80, 82, 84, 85, 87, 88, 90, 92, 93, 95, 97, 98, 100, 101, 103, 105, 106, 108, 110, 111
Offset: 1

Views

Author

Amarnath Murthy, Dec 14 2003

Keywords

Comments

Is this the same as A000201?
The answer is yes: see A090909. - Michel Dekking, Dec 19 2024

Examples

			A073869 = A005206 = 0,1,1,2,3,3,4,4,5,6,6,... The pair (1,2) occurs at k = 3.
		

Crossrefs

Formula

See A000201.

Extensions

More terms from R. J. Mathar, Sep 29 2017
Name corrected by Michel Dekking, Dec 19 2024

A275896 a(n) = A065189(n+1)-1.

Original entry on oeis.org

0, 3, 1, 4, 2, 9, 12, 10, 5, 14, 6, 19, 7, 20, 8, 25, 28, 26, 11, 30, 33, 13, 37, 39, 15, 42, 16, 41, 17, 48, 18, 49, 53, 55, 21, 58, 22, 57, 23, 63, 24, 66, 68, 70, 27, 74, 76, 29, 79, 77, 31, 84, 32, 85, 89, 34, 90, 35, 94, 36, 98, 100, 38, 103, 101, 40, 107, 110, 112, 43, 115, 44, 119, 45, 116, 46
Offset: 0

Views

Author

N. J. A. Sloane, Aug 23 2016

Keywords

Comments

All of A065188, A065189, A199134, A275884 should really have started at 0 rather than 1. Then the graph of A065188, for example, would be comparable with the graph of A002251.

Crossrefs

A054081 Array T by antidiagonals: for n >= 0 and k >= 1, let p(k)=least positive integer not already in a(i), q(k)=p(k)+k+n-1, a(p(k))=q(k), a(q(k))=p(k); then for h>=1, T(n,h)=a(h).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Each row is a self-inverse permutation of N; are the numbers in every column distinct?

Examples

			Row 0: 1 3 2 6 8 4 11 ... = A019444.
Row 1: 2 1 5 7 3 10 4 ... = A002251.
Row 2: 3 5 1 8 2 11 13 ...
		

Extensions

More terms from Sean A. Irvine, Jan 24 2022

A293835 a(n) = smallest number (in absolute value) not yet in the sequence such that the arithmetic mean of the first n terms a(1), a(2), ..., a(n) is an integer; a(1)=1. No two numbers with the same absolute value may appear. Preference is given to positive values of a(n).

Original entry on oeis.org

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

Views

Author

Enrique Navarrete, Oct 16 2017

Keywords

Comments

For n=1: 1/1 is an integer, and so is -1/1, but preference is given to positive values of a(n).
Fixed points so far: 1,8,17,50; i.e., aside from 1, these fixed points occur when sequence changes from 0 to positive or from negative to positive.
One could check the integers in order of appearance in A001057 to see if they are the next term. - David A. Corneth, Nov 13 2017

Examples

			For n=7: (1 + 3 + 2 + 6 - 7 - 5 + 0)/7 is an integer.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = For[k = 0, True, k++, aa = Array[a, n - 1]; If[FreeQ[aa, k | -k], If[IntegerQ[Mean[Append[aa, k]]], Return[k]]; If[IntegerQ[Mean[Append[aa, -k]]], Return[-k]]]];
    Array[a, 100] (* Jean-François Alcover, Dec 09 2017 *)

A367065 a(1)=2, thereafter a(n) is the least positive integer not yet in the sequence such that Sum_{i=1..n} a(i) == 2 (mod n+2).

Original entry on oeis.org

2, 4, 1, 7, 9, 3, 12, 14, 5, 17, 6, 20, 22, 8, 25, 27, 10, 30, 11, 33, 35, 13, 38, 40, 15, 43, 16, 46, 48, 18, 51, 19, 54, 56, 21, 59, 61, 23, 64, 24, 67, 69, 26, 72, 74, 28, 77, 29, 80, 82, 31, 85, 32, 88, 90, 34, 93, 95, 36, 98, 37, 101, 103, 39, 106, 108, 41, 111, 42, 114
Offset: 1

Views

Author

Zenan Sabanac, Nov 03 2023

Keywords

Comments

This is the Avdispahić-Zejnulahi sequence AZ(2). For a positive integer k, the Avdispahić-Zejnulahi sequence AZ(k) is given by: a(1)=k, thereafter a(n) is the least positive integer not yet in the sequence such that Sum_{i=1..n} a(i) == k (mod n+k). It is interesting to note that (AZ(k)) represents a sequence of permutations of the set of positive integers. (See Links section for details concerning AZ(1).)

Crossrefs

A340510 is the AZ(1) sequence. A002251 is the AZ(0) sequence.

Programs

  • Mathematica
    lst={2}; f[s_List]:=Block[{k=1,len=3+Length@lst,t=Plus@@lst},While[MemberQ[s,k]||Mod[k+t,len]!=2,k++]; AppendTo[lst,k]]; Nest[f,lst,100]
  • Python
    z_list = [-1, 2, 4]
    m_list = [-1, 0, 1]
    n = 2
    for n in range(2, 100):
        if m_list[n] in z_list:
            m_list.append(m_list[n] + 1)
            z_list.append(m_list[n+1] + n+2)
        else:
            m_list.append(m_list[n])
            z_list.append(m_list[n+1])
    print(z_list[1:])

A073929 a(1) = 1, a(n) = smallest number not included earlier such that the n-th partial sum (n>1) is divisible by n+1.

Original entry on oeis.org

1, 2, 5, 7, 3, 10, 4, 13, 15, 6, 18, 20, 8, 23, 9, 26, 28, 11, 31, 12, 34, 36, 14, 39, 41, 16, 44, 17, 47, 49, 19, 52, 54, 21, 57, 22, 60, 62, 24, 65, 25, 68, 70, 27, 73, 75, 29, 78, 30, 81, 83, 32, 86, 33, 89, 91, 35, 94, 96, 37, 99, 38, 102, 104, 40, 107, 109, 42, 112, 43
Offset: 1

Views

Author

Amarnath Murthy, Aug 19 2002

Keywords

Comments

a(n) = A002251(n) for 2 < n < 10000. - Georg Fischer, Oct 19 2018

Examples

			4 divides 1+2+5, but does not divide 1+2+3 or 1+2+4, so a(3)=5.
		

Crossrefs

Programs

  • Maple
    s := {1}:summe := 1:a[1] := 1:for j from 2 to 1000 do b := (j+1)-(summe mod (j+1)); i := 0:while(true) do if nops(s union {b+i*(j+1)})-nops(s)=1 then break; fi; i := i+1; od:a[j] := b+i*(j+1):s := s union {b+i*(j+1)}:summe := summe+a[j]:od:c := seq(a[k],k=1..1000);
  • Mathematica
    Nest[Append[#, Block[{k = 2}, While[Nand[FreeQ[#, k], Mod[Total@ # + k, Length@ # + 2] == 0], k++]; k]] &, {1}, 69] (* Michael De Vlieger, May 10 2018 *)
  • PARI
    vecA073929(n)={my(w=1,s=List(vector(100*n,u,u)),t);for(m=2,n,for(i=m,#s,if(!((w+s[i])%(m+1)),t=s[i];w+=t;listpop(s,i);listinsert(s,t,m);break)));Vec(s)[1..n]} \\ R. J. Cano, May 07 2018

Extensions

Corrected and edited by John W. Layman and Sascha Kurz, Aug 21 2002
Offset corrected by R. J. Cano, May 07 2018
Previous Showing 11-20 of 22 results. Next