OFFSET
0,4
COMMENTS
a(n) is essentially the case 0 of the polygonal numbers. The polygonal numbers are defined as P_k(n) = Sum_{i=1..n}((k-2)*i-(k-3). Thus P_0(n) = 2*n - n^2 and a(n) = -P_0(n). - Peter Luschny, Jul 08 2011
For n >= 3, the denominator of the probability of winning the prize by switching from the initial choice of doors in a generalized Monty Hall problem with n doors: After a prize has been placed behind exactly one of the n doors at random, a contestant chooses a door. Then the host, who knows where the prize is, deliberately opens exactly one unchosen door that does not hide the prize (picked at random by the host among such doors when there is a choice) and then gives the contestant an opportunity to switch to any other door not yet opened. The numerator of this probability is n-1 (incidentally, gcd(n-1, n*(n-2)) = 1). The probability of winning by switching minus the probability of winning by not switching is thus (n-1)/(n*(n-2)) - 1/n = 1/a(n), which approaches zero as n approaches infinity, but nevertheless makes the switching strategy better for every finite n >= 3. The winning probability is 2/3 from switching in the classic 3-door Monty Hall problem; we have 3/8 and 4/15, respectively, in the 4- and 5-door generalizations. (The above analysis was independent but is consistent with the even more general "N-doors" section of the Wikipedia article, other parts of which make clear the historical importance of wording this problem as carefully as possible. See also A122774.) - Rick L. Shepherd, May 31 2014, clarified Oct 29 2015
For n > 1, a(n) is the largest integer k such that k + n^2 is a multiple of k + n. - Derek Orr, Sep 04 2014
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
Wikipedia, Monty Hall problem.
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
G.f.: x*(3*x-1)/(1-x)^3. - Paul Barry, Mar 27 2007
E.g.f.: exp(x)*(x^2-x). - Paul Barry, Mar 27 2007
a(n) = 2*n + a(n-1) - 3 (with a(0)=0). - Vincenzo Librandi, Aug 08 2010
From Amiram Eldar, Feb 17 2023: (Start)
Sum_{n>=3} 1/a(n) = 3/4.
Sum_{n>=3} (-1)^(n+1)/a(n) = 1/4. (End)
MAPLE
MATHEMATICA
Table[ n^2 - 2*n, {n, 0, 60} ] (* George E. Antoniou *)
LinearRecurrence[{3, -3, 1}, {0, -1, 0}, 80] (* Vladimir Joseph Stephan Orlovsky, Feb 23 2012 *)
PROG
(PARI) a(n)=n^2-2*n;
(PARI) concat(0, Vec(x*(3*x-1)/(1-x)^3 + O(x^100))) \\ Altug Alkan, Oct 30 2015
(Haskell)
a067998 n = n * (n - 2)
a067998_list = scanl (+) 0 [-1, 1 ..]
-- Reinhard Zumkeller, Aug 26 2013
(Magma) [n^2-2*n : n in [0..50]]; // Wesley Ivan Hurt, Sep 04 2014
CROSSREFS
KEYWORD
easy,sign
AUTHOR
George E. Antoniou, Feb 06 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Feb 08 2002
STATUS
approved