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.

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

This page as a plain text file.
%I A018837 #66 Sep 10 2023 01:42:49
%S A018837 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,
%T A018837 15,16,17,16,17,18,19,18,19,20,21,20,21,22,23,22,23,24,25,24,25,26,27,
%U A018837 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
%N A018837 Number of steps for knight to reach (n,0) on infinite chessboard.
%C A018837 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
%C A018837 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
%H A018837 Vincenzo Librandi, <a href="/A018837/b018837.txt">Table of n, a(n) for n = 0..2000</a>
%H A018837 Francis N. Castro, Oscar E. González and Luis A. Medina, <a href="https://doi.org/10.2140/involve.2018.11.127">Generalized exponential sums and the power of computers</a>, Involve, Vol. 11 (2018), Issue 1, pp. 127-142. Also, <a href="http://emmy.uprrp.edu/lmedina/papers/asympgen/index.html">authors' copy</a>.
%H A018837 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).
%F A018837 a(n) = 2[ (n+2)/4 ] if n even, 2[ (n+1)/4 ]+1 if n odd (n >= 8).
%F A018837 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
%F A018837 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
%F A018837 Sum_{n>=1} (-1)^n/a(n) = 5/3 - 2*log(2). - _Amiram Eldar_, Sep 10 2023
%e A018837 a(1)=3 counts these moves: (0,0) to (2,1) to (0,2) to (1,0). - _Clark Kimberling_, Dec 20 2010
%t A018837 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 *)
%t A018837 Array[Which[#==1,3,True,(#+Mod[#,4])/2]&,100,0] (* _Elisha Hollander_, Aug 05 2021 *)
%o A018837 (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
%o A018837 (Python) def a(n): return 3 if n == 1 else (n + n % 4) // 2 # _Elisha Hollander_, Aug 05 2021
%Y A018837 Cf. A065775, A183041-A183053, A083219 (essentially the same).
%Y A018837 Cf. A018840 for the (2,3)-leaper.
%K A018837 nonn,easy
%O A018837 0,2
%A A018837 _N. J. A. Sloane_, _Marc LeBrun_