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 17 results. Next

A018837 Number of steps for knight to reach (n,0) on infinite chessboard.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The knight starts at (0,0) and we count the least number of steps. Row 1 of the array at A065775. - Clark Kimberling, Dec 20 2010
Apparently also the minimum number of steps of the (1,3)-leaper to reach (n,n) starting at (0,0). - R. J. Mathar, Jan 05 2018

Examples

			a(1)=3 counts these moves: (0,0) to (2,1) to (0,2) to (1,0). - _Clark Kimberling_, Dec 20 2010
		

Crossrefs

Cf. A065775, A183041-A183053, A083219 (essentially the same).
Cf. A018840 for the (2,3)-leaper.

Programs

  • Mathematica
    CoefficientList[Series[x (3 - x + x^2 - x^3 - 2 x^4 + 2 x^5)/((1-x)^2 (1+x) (1+x^2)), {x, 0, 100}], x] (* Vincenzo Librandi, Jan 06 2018 *)
    Array[Which[#==1,3,True,(#+Mod[#,4])/2]&,100,0] (* Elisha Hollander, Aug 05 2021 *)
  • PARI
    concat([0], Vec( x*(3-x+x^2-x^3-2*x^4+2*x^5)/((1-x)^2*(1+x)*(1+x^2)) + O(x^166) ) ) \\ Joerg Arndt, Sep 10 2014
    
  • Python
    def a(n): return 3 if n == 1 else (n + n % 4) // 2 # Elisha Hollander, Aug 05 2021

Formula

a(n) = 2[ (n+2)/4 ] if n even, 2[ (n+1)/4 ]+1 if n odd (n >= 8).
G.f.: x*(3-x+x^2-x^3-2*x^4+2*x^5)/((1-x)^2*(1+x)*(1+x^2)). a(n)=A083219(n), n<>1. - R. J. Mathar, Dec 15 2008
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 where T(.,.) = A065775(.,.). - Clark Kimberling, Dec 20 2010
Sum_{n>=1} (-1)^n/a(n) = 5/3 - 2*log(2). - Amiram Eldar, Sep 10 2023

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

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

A183053 Sums of knight's moves over the square |i|+|j|<=n on infinite chessboard.

Original entry on oeis.org

0, 12, 28, 48, 88, 148, 220, 312, 440, 588, 772, 1000, 1248, 1548, 1908, 2288, 2728, 3244, 3788, 4400, 5096, 5828, 6644, 7552, 8496, 9540, 10692, 11880, 13176, 14596, 16060, 17640, 19352, 21116, 23012, 25048
Offset: 0

Views

Author

Clark Kimberling, Dec 22 2010

Keywords

Comments

Partial sums matching the squares |i|+|j|=n are given by A183052.

Crossrefs

Formula

See A065775.
Empirical g.f.: -4*x*(2*x^12-2*x^11+2*x^10-4*x^9+2*x^8-x^7-x^6-4*x^4-4*x^2-x-3) / ((x-1)^4*(x^2+1)*(x^2+x+1)^2). - Colin Barker, May 04 2014

A183050 Sums of knight's moves to points as in A183049.

Original entry on oeis.org

0, 3, 4, 5, 10, 15, 18, 23, 32, 37, 46, 57, 62, 75, 90, 95, 110, 129, 136, 153, 174, 183, 204, 227, 236, 261, 288, 297, 324, 355, 366, 395, 428, 441, 474, 509, 522, 559, 598, 611, 650, 693, 708, 749, 794, 811, 856, 903, 920, 969, 1020
Offset: 0

Views

Author

Clark Kimberling, Dec 22 2010

Keywords

Examples

			a(3)=5=3+1+1, these summands being the least numbers of knight's moves from (0,0) to the points (3,0), (2,1), (1,2) on the 3rd diagonal in the 1st quadrant - which is 1/4 of a 3rd concentric square about the origin.  See A183052 for sums over the concentric squares.
		

Crossrefs

Formula

See A065775.
Empirical g.f.: x*(2*x^12-2*x^11+2*x^10-4*x^9+2*x^8-x^7-x^6-4*x^4-4*x^2-x-3) / ((x-1)^3*(x^2+1)*(x^2+x+1)^2). - Colin Barker, May 04 2014

A183051 Array of least knight's moves to points on the square |i|+|j|=n on infinite chessboard.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Dec 22 2010

Keywords

Examples

			Top 5 rows:
0
3 3 3 3
2 2 2 2 2 2 2 2
3 1 1 3 1 1 3 1 1 3 1 1
2 2 4 2 2 2 4 2 2 2 4 2 2 2 4 2
Row n has 4n numbers which form a square of points (i.e., unit squares) on an infinite chessboard.  The first 3 of these concentric squares are represented as follows:
....2
..2.3.2
2.3.0.3.2
..2.3.2
....2
		

Crossrefs

Formula

See A065775.

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

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Dec 20 2010

Keywords

Examples

			First five rows:
0
2 3 2
4 1 2 1 4
2 3 2 3 2 3 2
4 3 2 3 2 3 2 3 4
		

Crossrefs

Formula

See A065775.

A183052 Sums of knight's moves from (0,0) to points on the square |i|+|j|=n on infinite chessboard.

Original entry on oeis.org

0, 12, 16, 20, 40, 60, 72, 92, 128, 148, 184, 228, 248, 300, 360, 380, 440, 516, 544, 612, 696, 732, 816, 908, 944, 1044, 1152, 1188, 1296, 1420, 1464, 1580, 1712, 1764, 1896, 2036, 2088, 2236, 2392, 2444, 2600, 2772
Offset: 0

Views

Author

Clark Kimberling, Dec 22 2010

Keywords

Comments

Partial sums of A183053, which counts knight's moves from (0,0) to all points (i,j) such that |i|+|j|<=n.

Examples

			0=0
12=3+3+3+3
16=2+2+2+2+2+2+2+2
20=3+1+1+3+1+1+3+1+1+3+1+1
40=4*(3+3+3+3+3)
		

Crossrefs

Formula

See A065775.
a(n) = 4*A183050(n).
Empirical g.f.: 4*x*(2*x^12-2*x^11+2*x^10-4*x^9+2*x^8-x^7-x^6-4*x^4-4*x^2-x-3) / ((x-1)^3*(x^2+1)*(x^2+x+1)^2). - Colin Barker, May 04 2014

A183042 Least number of knight's moves from (0,0) to the segment of points (0,n), (1,n-1), ..., (n,0) on infinite chessboard.

Original entry on oeis.org

0, 6, 6, 8, 12, 18, 22, 28, 36, 42, 52, 64, 68, 82, 98, 104, 118, 138, 146, 164, 184, 194, 216, 240, 248, 274, 302, 312, 338, 370, 382, 412, 444, 458, 492, 528, 540, 578, 618, 632, 670, 714, 730, 772, 816, 834, 880, 928, 944, 994
Offset: 0

Views

Author

Clark Kimberling, Dec 20 2010

Keywords

Examples

			For n=3, the least number of knight's moves to the points (i.e., squares) (3,0), (2,1), (1,2), (0,3) are 3,1,1,3, respectively, for a total of a(3)=8.
		

Crossrefs

Cf. A065775.

Formula

a(n)=T(n,0)+T(n-1,1)+...+T(0,n), where T is formulated at A065775.
Empirical g.f.: 2*x*(x^13-x^9-3*x^7-x^6-4*x^2-3*x-3) / ((x-1)^3*(x+1)*(x^2+1)*(x^2+x+1)^2). - Colin Barker, May 04 2014

A183044 Sums of least numbers of knight's moves on vertical segments (n,0) to (n,n) on infinite chessboard.

Original entry on oeis.org

0, 5, 7, 10, 14, 21, 27, 38, 44, 57, 67, 82, 92, 111, 123, 144, 158, 181, 197, 224, 240, 269, 289, 320, 340, 375, 397, 434, 458, 497, 523, 566, 592, 637, 667, 714, 744, 795, 827, 880, 914, 969, 1005, 1064, 1100, 1161, 1201, 1264
Offset: 0

Views

Author

Clark Kimberling, Dec 20 2010

Keywords

Comments

Row sums of A183043.

Crossrefs

Formula

Empirical g.f.: x*(2*x^10+2*x^9-2*x^8-4*x^7-5*x^6-x^5+x^4-2*x^3-5*x^2-7*x-5) / ((x-1)^3*(x+1)^2*(x^2+1)*(x^2+x+1)). - Colin Barker, May 04 2014
Showing 1-10 of 17 results. Next