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.

A004278 1, 3 and the positive even numbers.

This page as a plain text file.
%I A004278 #46 Dec 27 2017 01:47:05
%S A004278 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,
%T A004278 48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,
%U A004278 94,96,98,100,102,104
%N A004278 1, 3 and the positive even numbers.
%C A004278 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
%H A004278 Iain Fox, <a href="/A004278/b004278.txt">Table of n, a(n) for n = 1..10000</a>
%H A004278 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1)
%F A004278 From _Iain Fox_, Dec 21 2017: (Start)
%F A004278 G.f.: (x + x^5)/(1 - x)^2.
%F A004278 a(n) = 2*a(n-1) - a(n-2), n > 2 and n is not 5.
%F A004278 a(n) = 2*n - 2 + floor((4/Pi)*arctan(2 - n)).
%F A004278 (End)
%F A004278 E.g.f.: 2*e^x*(x - 1) + 3 + 2*x + x^2/2. - _Iain Fox_, Dec 22 2017
%F A004278 a(n) = (abs(4 - n) + 3*n - 4)/2. - _Iain Fox_, Dec 23 2017
%t A004278 Sort[Join[{1,3},2*Range[60]]] (* _Harvey P. Dale_, Feb 04 2015 *)
%o A004278 (Haskell)
%o A004278 a004278 n = if n <= 3 then n else 2 * (n - 2)
%o A004278 a004278_list = [1, 2, 3] ++ [4, 6 ..]
%o A004278 -- _Reinhard Zumkeller_, Nov 10 2012
%o A004278 (PARI) first(n) = Vec((x + x^5)/(x - 1)^2 + O(x^(n+1))) \\ _Iain Fox_, Dec 21 2017
%Y A004278 Cf. A005843.
%K A004278 easy,nonn
%O A004278 1,2
%A A004278 _N. J. A. Sloane_
%E A004278 Offset corrected by _Reinhard Zumkeller_, Nov 10 2012