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-9 of 9 results.

A065775 Array T read by diagonals: T(i,j)=least number of knight's moves on a chessboard (infinite in all directions) needed to move from (0,0) to (i,j).

Original entry on oeis.org

0, 3, 3, 2, 2, 2, 3, 1, 1, 3, 2, 2, 4, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 2, 2, 2, 4, 4, 5, 3, 3, 3, 3, 3, 3, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 3, 3, 3, 3, 5, 5, 5, 6, 6, 4, 4, 4, 4, 4, 4, 4, 6, 6, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 6, 6, 6, 6, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7
Offset: 0

Views

Author

Stewart Gordon, Dec 05 2001

Keywords

Examples

			From _Clark Kimberling_, Dec 20 2010: (Start)
T(i,j) for -2<=i<=2 and -2<=j<=2:
  4 1 2 1 4=T(2,2)
  1 2 3 2 1=T(2,1)
  2 3 0 3 2=T(2,0)
  1 2 3 2 1=T(2,-1)
  4 1 2 1 4=T(2,-2)
Corner of the array, T(i,j) for i>=0, j>=0: [Corrected Oct 14 2016]
  0 3 2 3 2 3 4...
  3 2 1 2 3 4 3...
  2 1 4 3 2 3 4...
  3 2 3 2 3 4 2... (End)
		

Crossrefs

Identical to A049604 except for T(1, 1).
For number of knight's moves to various subsets of the chessboard, see A018837, A183041-A183053.

Formula

From Clark Kimberling, Dec 20 2010: (Start)
T(i,j) is given in cases:
Case 1: row 0
T(0,0)=0, T(1,0)=3, and for m>=1,
T(4m-2,0)=2m, T(4m-1,0)=2m+1, T(4m,0)=2m,
T(4m+1,0)=2m+1.
Case 2: row 1
T(0,1)=3, T(1,1)=2, and for m>=1,
T(4m-2,1)=2m-1, T(4m-1,1)=2m, T(4m,1)=2m+1,
T(4m+1,1)=2m+2.
Case 3: columns 0 and 1
(column 0 = row 0); (column 1 = row 1).
Case 4: For i>=2 and j>=2,
T(i,j)=1+min{T(i-2,j-1),T(i-1,j-2)}.
Cases 1-4 determine T in the 1st quadrant;
all other T(i,j) are easily obtained by symmetry. (End)

A187180 Parse the infinite string 0101010101... into distinct phrases 0, 1, 01, 010, 10, ...; a(n) = length of n-th phrase.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 06 2011

Keywords

Examples

			The sequence begins
   1   1
   2   3   2   3
   4   5   4   5
   6   7   6   7
   8   9   8   9
  10  11  10  11 ...
		

Crossrefs

See A187180-A187188 for alphabets of size 2 through 10.
Essentially the same as A106249 and A018837.

Programs

  • Maple
    1,1,seq(op(2*i*[1,1,1,1]+[0,1,0,1]), i=1..100); # Robert Israel, Oct 15 2015
  • Mathematica
    Join[{1},LinearRecurrence[{1, 0, 0, 1, -1},{1, 2, 3, 2, 3},119]] (* Ray Chandler, Aug 26 2015 *)
    CoefficientList[Series[(x^5 - 2 x^4 + x^3 + x^2 + 1)/((x - 1)^2 (x + 1) (x^2 + 1)), {x, 0, 150}], x] (* Vincenzo Librandi, Oct 16 2015 *)
  • PARI
    a(n) = if(n==1, 1, (1 + (-1)^n + (1-I)*(-I)^n + (1+I)*I^n + 2*n) / 4); \\ Colin Barker, Oct 15 2015
    
  • PARI
    Vec(x*(x^5-2*x^4+x^3+x^2+1) / ((x-1)^2*(x+1)*(x^2+1)) + O(x^100)) \\ Colin Barker, Oct 15 2015

Formula

Consider more generally the string 012...k012...k012...k012...k01... with an alphabet of size B, where k = B-1. The sequence begins with B 1's, and thereafter is quasi-periodic with period B^2, and increases by B in each period.
For the present example, where B=2, the sequence begins with two 1's and thereafter increases by 2 in each block of 4: (1,1) (2,3,2,3), (4,5,4,5), (6,7,6,7), ...
From Colin Barker, Oct 15 2015: (Start)
a(n) = (1+(-1)^n+(1-i)*(-i)^n+(1+i)*i^n+2*n)/4 for n>1, where i = sqrt(-1).
G.f.: x*(x^5-2*x^4+x^3+x^2+1) / ((x-1)^2*(x+1)*(x^2+1)). (End)
From Wesley Ivan Hurt, May 03 2021: (Start)
a(n) = a(n-1)+a(n-4)-a(n-5).
a(n) = floor((n+1+(-1)^floor((n+1)/2))/2) for n > 1. (End)

A183043 Triangular array, T(i,j)=number of knight's moves to points on vertical segments (n,0), (n,1),...,(n,n) on infinite chessboard.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Dec 20 2010

Keywords

Comments

Stated another way, T(n,k) = distance from square (0,0) at center of an infinite open chessboard to square (n,k) via shortest knight path, for 0<=k<=n. - Fred Lunnon, May 18 2014

Examples

			Triangle starts:
0,
3,2,
2,1,4,
3,2,3,2,
2,3,2,3,4,
3,4,3,4,3,4,
4,3,4,3,4,5,4,
5,4,5,4,5,4,5,6,
4,5,4,5,4,5,6,5,6,
5,6,5,6,5,6,5,6,7,6
...
See examples under A242511.
		

References

  • Fred Lunnon, Knights in Daze, to appear.

Crossrefs

Programs

  • Magma
    // See link for recursive & explicit algorithms. - Fred Lunnon, May 18 2014

Formula

See A065775.

Extensions

Edited by N. J. A. Sloane, May 23 2014
Offset corrected by Alois P. Heinz, Sep 10 2014

A083219 a(n) = n - 2*floor(n/4).

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 14, 15, 16, 17, 16, 17, 18, 19, 18, 19, 20, 21, 20, 21, 22, 23, 22, 23, 24, 25, 24, 25, 26, 27, 26, 27, 28, 29, 28, 29, 30, 31, 30, 31, 32, 33, 32, 33, 34, 35, 34, 35, 36, 37, 36, 37, 38
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 22 2003

Keywords

Comments

Conjecture: number of roots of P(x) = x^n - x^(n-1) - x^(n-2) - ... - x - 1 in the left half-plane. - Michel Lagneau, Apr 09 2013
a(n) is n+2 with its second least significant bit removed (see A021913(n+2) for that bit). - Kevin Ryde, Dec 13 2019

Crossrefs

Cf. A083220, A129756, A162751 (second highest bit removed).
Essentially the same as A018837.

Programs

Formula

a(n) = A083220(n)/2.
a(n) = a(n-1) + n mod 2 + (n mod 4 - 1)*(1 - n mod 2), a(0) = 0.
G.f.: x*(1+x+x^2-x^3)/((1-x)^2*(1+x)*(1+x^2)). - R. J. Mathar, Aug 28 2008
a(n) = n - A129756(n). - Michel Lagneau, Apr 09 2013
Bisection: a(2*k) = 2*floor((n+2)/4), a(2*k+1) = a(2*k) + 1, k >= 0. - Wolfdieter Lang, May 08 2017
a(n) = (2*n + 3 - 2*cos(n*Pi/2) - cos(n*Pi) - 2*sin(n*Pi/2))/4. - Wesley Ivan Hurt, Oct 02 2017
a(n) = A162330(n+2) - 1 = A285869(n+3) - 1. - Kevin Ryde, Dec 13 2019
E.g.f.: ((1 + x)*cosh(x) - cos(x) + (2 + x)*sinh(x) - sin(x))/2. - Stefano Spezia, May 27 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*log(2) - 1. - Amiram Eldar, Aug 21 2023

A106249 Expansion of (1-x+x^2+x^3)/((1+x)*(1+x^2)*(1-x)^2).

Original entry on oeis.org

1, 0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 14, 15, 16, 17, 16, 17, 18, 19, 18, 19, 20, 21, 20, 21, 22, 23, 22, 23, 24, 25, 24, 25, 26, 27, 26, 27, 28, 29, 28, 29, 30, 31, 30, 31, 32, 33, 32, 33, 34, 35, 34, 35, 36, 37, 36, 37, 38
Offset: 0

Views

Author

Paul Barry, Apr 27 2005

Keywords

Comments

Conjecture: number of roots of x^n + 1 in the left half-plane for n > 0. - Michel Lagneau, Oct 31 2012
Maximum bias of polyominoes with n+1 squares. Define the bias of a polyomino to be the difference between the number of black squares and the number of white squares when chessboard coloring is applied to the polyomino. Maximum bias for the value n is defined to be the maximum value of bias among all polyominoes of n squares. - John Mason, Dec 24 2013

Crossrefs

Cf. A008611.

Programs

  • GAP
    List([0..80],n->((n-1) mod 4)/2+(n+1)/2-1); # Muniru A Asiru, Oct 07 2018
  • Maple
    a:= n-> n-1 - 2*floor((n-1)/4):
    seq(a(n), n=0..75);  # Alois P. Heinz, Jan 24 2021
  • Mathematica
    CoefficientList[Series[(1 - x + x^2 + x^3)/(1 - x - x^4 + x^5), {x, 0, 100}], x] (* Vincenzo Librandi, Dec 31 2013 *)
    LinearRecurrence[{1,0,0,1,-1},{1,0,1,2,3},80] (* Harvey P. Dale, May 07 2018 *)
  • PARI
    a(n)=([0,1,0,0,0; 0,0,1,0,0; 0,0,0,1,0; 0,0,0,0,1; -1,1,0,0,1]^n*[1;0;1;2;3])[1,1] \\ Charles R Greathouse IV, Sep 02 2015
    

Formula

G.f.: (1-x+x^2+x^3)/(1-x-x^4+x^5)=(1+x^2+2x^3+x^4+2x^5+x^6)/(1-x^4)^2.
a(n) = sum{k=0..n, -mu(k mod 4)}.
a(n) = cos(Pi*n/2)/2-sin(Pi*n/2)/2+(-1)^n/4+(2n+1)/4.
a(n) = sum{k=0..n, Jacobi(2^k, 2k+1)} [Conjecture]. - Paul Barry, Jul 23 2005
a(n) = sum{k=0..n, Product{j=1..k, ((-1)^j)^(k-j+1)}}. - Paul Barry, Nov 09 2007
a(n) = A083219(n-1). - R. J. Mathar, Aug 28 2008
a(n) = numbers of times cos(-Pi/n+2k*Pi/n) < 0 for k = 0..n-1. - Michel Lagneau, Nov 02 2012
a(n) = ((n - 1) mod 4)/2 + (n+1)/2 - 1. - John Mason, Dec 24 2013
a(n) = A018837(n-1) for n > 2. - Georg Fischer, Oct 07 2018

Extensions

John Mason's contributions corrected for offset by Eric M. Schmidt, Dec 30 2013

A183041 Least number of knight's moves from (0,0) to (n,1) on infinite chessboard.

Original entry on oeis.org

3, 2, 1, 2, 3, 4, 3, 4, 5, 6, 5, 6, 7, 8, 7, 8, 9, 10, 9, 10, 11, 12, 11, 12, 13, 14, 13, 14, 15, 16, 15, 16, 17, 18, 17, 18, 19, 20, 19, 20, 21, 22, 21, 22, 23, 24, 23, 24, 25, 26, 25, 26, 27, 28, 27, 28, 29, 30, 29, 30, 31, 32, 31, 32, 33, 34, 33, 34, 35, 36
Offset: 0

Views

Author

Clark Kimberling, Dec 20 2010

Keywords

Comments

Row 2 of the array at A065775.
Apparently a(n)=A162330(n), n>0. - R. J. Mathar, Jan 29 2011

Examples

			a(0)=3 counts (0,0) to (2,1) to (1,3) to (0,1).
		

Crossrefs

Programs

  • Python
    def a(n):
      if n < 2: return [3, 2][n]
      m, r = divmod(n, 4)
      return [2*m+1, 2*m+2][r%2]
    print([a(n) for n in range(70)]) # Michael S. Branicky, Mar 02 2021

Formula

T(0,1)=3, T(1,1)=2, and for m>=1,
T(4m-2,1)=2m-1, T(4m-1,1)=2m, T(4m,1)=2m+1, T(4m+1,1)=2m+2.
G.f.: (2*x^5-2*x^4+x^3-x^2-x+3) / ((x-1)^2*(x+1)*(x^2+1)). - Colin Barker, Feb 19 2014

A183049 Array of least knight's moves to points (n,0), (n-1,1), ..., (1,n-1) on infinite chessboard.

Original entry on oeis.org

0, 3, 2, 2, 3, 1, 1, 2, 2, 4, 2, 3, 3, 3, 3, 3, 4, 4, 2, 2, 2, 4, 5, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 3, 3, 3, 3, 5, 5, 6, 6, 4, 4, 4, 4, 4, 4, 4, 6, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 4, 4, 4, 4, 4, 6, 6, 6, 7, 7, 7, 5, 5, 5, 5, 5
Offset: 1

Views

Author

Clark Kimberling, Dec 22 2010

Keywords

Comments

The n points (n,0), (n-1,1), ..., (1,n-1) lie in a diagonal in the first quadrant. Adjoining the matching points in the other quadrants yields the square |i|+|j|=n, as in A183051. For a description of the infinite chessboard, see A065775.

Examples

			First 6 rows (after the initial 0):
3
2 2
3 1 1
2 2 4 2
3 3 3 3 3
4 4 2 2 2 4
These numbers occupy positions on the chessboard as
indicated here, starting at the left bottom corner:
..4
..3 4
..2 3 2
..1 4 3 2
..2 1 2 3 4
0 3 2 3 2 3 4 ... (This row is A018837.)
		

Crossrefs

Formula

See A065775.

A246924 8 X 8 square array read by rows: T(i,j) = number of moves of a knight to reach the square (i,j) when starting from the square (1,2).

Original entry on oeis.org

3, 0, 3, 2, 3, 2, 3, 4, 2, 3, 2, 1, 2, 3, 4, 3, 1, 2, 1, 4, 3, 2, 3, 4, 2, 3, 2, 3, 2, 3, 4, 3, 3, 2, 3, 2, 3, 4, 3, 4, 4, 3, 4, 3, 4, 3, 4, 5, 3, 4, 3, 4, 3, 4, 5, 4, 4, 5, 4, 5, 4, 5, 4, 5
Offset: 1

Views

Author

Frieder Mittmann, Sep 07 2014

Keywords

Crossrefs

A246925 8 X 8 square array read by rows: T(i,j) = number of moves of a knight to reach the square (i,j) when starting from the corner square (1,1).

Original entry on oeis.org

0, 3, 2, 3, 2, 3, 4, 5, 3, 4, 1, 2, 3, 4, 3, 4, 2, 1, 4, 3, 2, 3, 4, 5, 3, 2, 3, 2, 3, 4, 3, 4, 2, 3, 2, 3, 4, 3, 4, 5, 3, 4, 3, 4, 3, 4, 5, 4, 4, 3, 4, 3, 4, 5, 4, 5, 5, 4, 5, 4, 5, 4, 5, 6
Offset: 1

Views

Author

Frieder Mittmann, Sep 07 2014

Keywords

Comments

The initial position needs no moves to be reached and is set to value 0
Read by rows:
a(1) a(2) .... a(8)
a(9) a(10) .... a(16)
....
....
a(57) a(58) .... a(64)

Crossrefs

Cf. A018837, A246924. See A065775 for the analog on an infinite board.
Showing 1-9 of 9 results.