login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A004278
1, 3 and the positive even numbers.
3
1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104
OFFSET
1,2
COMMENTS
a(n) is the maximum number of turns that player A needs to identify with certainty the location of the coin that player B has hidden in one box in a row of n + 1 boxes. Player A starts by opening one of the boxes to see if the coin is in that box. After that, B secretly relocates the coin from its current box to one of the neighboring boxes, except when n = 1. In that case the game ends before B can relocate the coin. On each turn player A opens one box and when player A can tell in which box the coin is located, the game ends. Can be proved. - Bob Andriesse, Dec 22 2017
FORMULA
From Iain Fox, Dec 21 2017: (Start)
G.f.: (x + x^5)/(1 - x)^2.
a(n) = 2*a(n-1) - a(n-2), n > 2 and n is not 5.
a(n) = 2*n - 2 + floor((4/Pi)*arctan(2 - n)).
(End)
E.g.f.: 2*e^x*(x - 1) + 3 + 2*x + x^2/2. - Iain Fox, Dec 22 2017
a(n) = (abs(4 - n) + 3*n - 4)/2. - Iain Fox, Dec 23 2017
MATHEMATICA
Sort[Join[{1, 3}, 2*Range[60]]] (* Harvey P. Dale, Feb 04 2015 *)
PROG
(Haskell)
a004278 n = if n <= 3 then n else 2 * (n - 2)
a004278_list = [1, 2, 3] ++ [4, 6 ..]
-- Reinhard Zumkeller, Nov 10 2012
(PARI) first(n) = Vec((x + x^5)/(x - 1)^2 + O(x^(n+1))) \\ Iain Fox, Dec 21 2017
CROSSREFS
Cf. A005843.
Sequence in context: A032954 A158023 A004271 * A333183 A068670 A371925
KEYWORD
easy,nonn
EXTENSIONS
Offset corrected by Reinhard Zumkeller, Nov 10 2012
STATUS
approved