A162764 Minimal total number of floors that an elevator must move to get n persons waiting, respectively, on floors i = 1, 2, ..., n, to their destination floors n-i+1 (= n, n-1, ..., 1), if the elevator can hold up to C = 4 persons at a time and starts at floor 1, and no passenger may get off the elevator before reaching his destination.
0, 2, 4, 6, 8, 10, 12, 14, 16, 22, 26, 32, 36, 40, 44
Offset: 1
Examples
a(2)=2 because at n=2 the elevator needs to move a total of only 2 floors to transport everyone to his or her destination: the elevator loads the person at floor 1, moves to floor 2 (a move of 1 floor), unloads, loads the person at floor 2, moves to floor 1 (another move of 1 floor), and unloads. From _M. F. Hasler_, May 01 2019: (Start) Up to n = 2*C+1 = 9 here, one may simply load all passengers in the lower half, deposit them at their destinations on the way up to floor n, then load the passengers in the upper half and deposit them at their destinations on the way down to floor 1, for a total of a(n) = 2(n-1) moves. From n = 10 on, a(n) > 2(n-1). For n = 10, the smallest solution which does not require a person to get off before their final destination and back in the elevator at a later time is the following: we can transport persons waiting on floors 1 through 4 to their destination floors 7 through 10, then load those waiting on floors 10, 9, 8 and 7, deposit the last one at floor 4 (9 + 6 floors moved so far), transport the person from floor 5 to floor 6 (+ 2 floors moved), then the one at floor 6 and the other three passengers to their destinations at floors 5, 3, 2 and 1 (+ 5 floors), for a total of 9 + 6 + 2 + 5 = 22 moves. It seems impossible to solve the problem in fewer moves unless one allows a passenger to get out and later in again. For n = 11 we can follow the same plan, inserting an additional floor, where the elevator never stops, between the 5th and 6th floor. This adds 4 more floors to the total distance, for a(11) = a(10) + 4 = 26. For n = 12 we transport 4 passengers up to floor 12, then drop passengers 8 and 9 at floors 4 & 3, move passengers 5 & 6 to floors 7 & 8, then take remaining passengers down to their destinations on the way to floor 1. (We always load a passenger whenever we can.) This takes a(12) = 11 + 9 + 5 + 7 = 32 floors. Analogous to n = 11, we have a(13) = a(12) + 4 = 36. (End)
Crossrefs
Programs
-
PARI
A162764(n,C=4)=2*n-2+if(n>2*C+3,A162764(n-2*C,C)+C,n>2*C+1,2*n-4*C) \\ Proved to be an upper bound (cf. comments); conjectured to be exact for all n. - M. F. Hasler, May 15 2019
Formula
a(n) = 2n - 2 for n < 2C + 2 = 10, a(n) <= 2n - 2 + C + a(n - 2C) for n > 2C + 1 (cf. comments for proof), with equality for all known values except n = 10 & 11 where a(n) = 4n - 18; conjectured to be exact for all n > 2C + 3 = 11. - M. F. Hasler, May 15 2019
G.f.: 2*x*(1 + x^8 - x^9 + x^10 - x^11)/((1 - x)^3*(1 + x)*(1 + x^2)*(1 + x^4)) (conjectured). - M. F. Hasler, May 15 2019
Extensions
Edited by Jon E. Schoenfield, Dec 02 2013
Edited by M. F. Hasler, May 01 2019
Comments