login
Minimum number of steps for a knight to reach (n,n) on an infinite chessboard.
2

%I #42 Aug 14 2022 18:06:22

%S 0,2,4,2,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,16,16,16,18,18,

%T 18,20,20,20,22,22,22,24,24,24,26,26,26,28,28,28,30,30,30,32,32,32,34,

%U 34,34,36,36,36,38,38,38,40,40,40,42,42,42,44,44,44

%N Minimum number of steps for a knight to reach (n,n) on an infinite chessboard.

%C Apparently also the minimum number of steps of the (1,3)-leaper to reach (2n,0) starting at (0,0). The (1,3)-leaper cannot reach (2n+1,0). - _R. J. Mathar_, Jan 05 2018

%H Vincenzo Librandi, <a href="/A018838/b018838.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).

%F a(n) = 2*ceiling(n/3) = 2*A002264(n+2), n >= 3.

%F G.f.: 2*x*(x^5-x^4-x^2+x+1)/((x-1)^2*(x^2+x+1)). - _Colin Barker_, Oct 04 2012

%t Join[{0,2,4},Table[2*Ceiling[n/3],{n,3,70}]] (* _Harvey P. Dale_, Jul 27 2012 *)

%t CoefficientList[Series[2 x (x^5 - x^4 - x^2 + x + 1)/((x - 1)^2 (x^2 + x + 1)), {x, 0, 100}], x] (* _Vincenzo Librandi_, Oct 16 2013 *)

%t LinearRecurrence[{1,0,1,-1},{0,2,4,2,4,4,4},70] (* _Harvey P. Dale_, Nov 03 2019 *)

%o (Magma) [0,2,4] cat [2*Ceiling(n/3): n in [3..80]]; // _Vincenzo Librandi_, Oct 16 2013

%o (PARI) a(n)=if(n>2, (n+2)\3*2, 2*n) \\ _Charles R Greathouse IV_, Feb 10 2017

%K nonn,easy,nice

%O 0,2

%A _N. J. A. Sloane_, _Marc LeBrun_