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

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).

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 4, 4, 6, 6, 6, 7, 8, 8, 10, 10, 10, 11, 12, 12
Offset: 1

Views

Author

Dmitry Kamenetsky, Mar 19 2018

Keywords

Comments

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.

Examples

			For n = 1, there is only room to search, so a(1) = 1.
For n = 2, the knights search both rooms, so a(2) = 1.
For n = 3, the knights can search the first two rooms twice, so a(3) = 2.
For n = 4 and 5, the knights can search the second and the fourth rooms twice, so a(4) = 2 and a(5) = 2.
		

Crossrefs

Formula

It seems that for n >= 3:
if n = 0 mod 6, then a(n) = (n/6)*4 - 1,
if n = 1 or 2 mod 6, then a(n) = floor(n/6)*4,
if n = 3, 4 or 5 mod 6, then a(n) = floor(n/6)*4 + 2.
i.e., a(n) = A302404(n-2).

A303046 Number of minimum total dominating sets in the n-Moebius ladder.

Original entry on oeis.org

1, 6, 9, 8, 25, 3, 196, 56, 9, 20, 121, 3, 1521, 154, 9, 32, 289, 3, 5776, 300, 9, 44, 529, 3, 15625, 494, 9, 56, 841, 3, 34596, 736, 9, 68, 1225, 3, 67081, 1026, 9, 80, 1681, 3, 118336, 1364, 9, 92, 2209, 3, 194481, 1750, 9, 104, 2809, 3, 302500, 2184, 9
Offset: 1

Views

Author

Eric W. Weisstein, Apr 17 2018

Keywords

Comments

Sequence extrapolated to n = 1 using recurrence. - Andrew Howroyd, Apr 18 2018

Crossrefs

Programs

  • Mathematica
    Table[Piecewise[{{3, Mod[n, 6] == 0}, {(n (n + 5)/6)^2, Mod[n, 6] == 1}, {n (2 n + 5)/3, Mod[n, 6] == 2}, {9, Mod[n, 6] == 3}, {2 n, Mod[n, 6] == 4}, {n^2, Mod[n, 6] == 5}}], {n, 200}]
    LinearRecurrence[{0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, -10, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 1}, {1, 6, 9, 8, 25, 3, 196, 56, 9, 20, 121, 3, 1521, 154, 9, 32, 289, 3, 5776, 300, 9, 44, 529, 3, 15625, 494, 9, 56, 841, 3}, 200]
    Rest @ CoefficientList[Series[3 x^6/(1 - x^6) - 9 x^3/(-1 + x^6) + 4 x^4 (2 + x^6)/(-1 + x^6)^2 - x^5 (25 + 46 x^6 + x^12)/(-1 + x^6)^3 - 2 x^2 (3 + 19 x^6 + 2 x^12)/(-1 + x^6)^3 - x (1 + 191 x^6 + 551 x^12 + 121 x^18)/(-1 + x^6)^5, {x, 0, 200}], x]
  • PARI
    a(n)=my(k=n\6,r=n%6);if(r<3, if(r==0, 3, if(r==1, n^2*(k+1)^2, n*(4*k+3))), if(r==3, 9, if(r==4, 2*n, n^2))) \\ Andrew Howroyd, Apr 18 2018

Formula

From Andrew Howroyd, Apr 18 2018: (Start)
a(n) = 5*a(n-6) - 10*a(n-12) + 10*a(n-18) - 5*a(n-24) + a(n-30) for n > 30.
a(6k) = 3, a(6k+1) = (6*k+1)^2*(k+1)^2, a(6k+2) = (6*k+2)*(4*k+3), a(6k+3) = 9, a(6k+4) = (6*k+4)*2, a(6k+5) = (6*k+5)^2. (End)
a(3k) = 6 - 3*(-1)^k. - Eric W. Weisstein, Apr 19 2018

Extensions

a(1)-a(2) and terms a(14) and beyond from Andrew Howroyd, Apr 18 2018
Showing 1-2 of 2 results.