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.
%I A301337 #14 Mar 24 2024 11:40:44 %S A301337 1,1,2,2,2,3,4,4,6,6,6,7,8,8,10,10,10,11,12,12 %N A301337 Number of steps required in the worst case for two knights to find the princess in a castle with n rooms arranged in a line (Castle and princess puzzle). %C A301337 The main entry for this problem is A300576. In this version there are two knights who are searching for the princess; each knight can search a different room. %H A301337 Dmitry Kamenetsky, <a href="/A301337/a301337.txt">Optimal solutions</a> %F A301337 It seems that for n >= 3: %F A301337 if n = 0 mod 6, then a(n) = (n/6)*4 - 1, %F A301337 if n = 1 or 2 mod 6, then a(n) = floor(n/6)*4, %F A301337 if n = 3, 4 or 5 mod 6, then a(n) = floor(n/6)*4 + 2. %F A301337 i.e., a(n) = A302404(n-2). %e A301337 For n = 1, there is only room to search, so a(1) = 1. %e A301337 For n = 2, the knights search both rooms, so a(2) = 1. %e A301337 For n = 3, the knights can search the first two rooms twice, so a(3) = 2. %e A301337 For n = 4 and 5, the knights can search the second and the fourth rooms twice, so a(4) = 2 and a(5) = 2. %Y A301337 Cf. A300576, A301426. %K A301337 nonn,more %O A301337 1,3 %A A301337 _Dmitry Kamenetsky_, Mar 19 2018