login
A393532
The difference between the maximum and minimum voucher costs for n distinct positive integer vouchers v_1, v_2, ..., v_n, where the cost is defined as v_1 + v_1*v_2 + v_2*v_3 + ... + v_(n-1)*v_n.
1
0, 1, 4, 10, 22, 39, 64, 96, 138, 189, 252, 326, 414, 515, 632, 764, 914, 1081, 1268, 1474, 1702, 1951, 2224, 2520, 2842, 3189, 3564, 3966, 4398, 4859, 5352, 5876, 6434, 7025, 7652, 8314, 9014, 9751, 10528, 11344, 12202, 13101, 14044, 15030, 16062, 17139, 18264
OFFSET
1,3
COMMENTS
The question originated from the first puzzle 'Low Budget' in the book Mathematical Puzzles and Curiosities.
REFERENCES
I. David, T. Khovanova, and Y. Shpilman, Mathematical Puzzles and Curiosities, World Scientific, 2026, p. 2.
FORMULA
a(n) = n*(n^2+3*n-19)/6 + (51-3*(-1)^n)/12, for n > 1.
a(n) = A110610(n) - A393145(n).
G.f.: x^2*(1 + x + 2*x^3 - 2*x^4)/((1 - x)^4*(1 + x)). - Stefano Spezia, Feb 20 2026
From Enrique Navarrete, Feb 26 2026: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) - 2*a(n-3) + 3*a(n-4) - a(n-5) for n > 6.
E.g.f.: (1/12)*(2*x^3 + 12*x^2 - 30*x + 51)*exp(x) - (1/4)*exp(-x) - 2*x - 4. (End)
EXAMPLE
For n=4, the minimum cost is achieved by buying 4 vouchers in the following order: 3, 2, 1, 4. The cost is 3+3*2+2*1+1*4=15. The maximum cost is achieved when we buy 4 vouchers in the following order: 2, 4, 3, 1. The cost is 2+2*4+4*3+3*1=25. Thus, a(4) = 25-15 = 10.
MATHEMATICA
A393532[n_] := If[n == 1, 0, (2*n*(n*(n + 3) - 19) - 3*(-1)^n + 51)/12]; Array[A393532, 50] (* or *)
LinearRecurrence[{3, -2, -2, 3, -1}, {0, 1, 4, 10, 22, 39}, 50] (* Paolo Xausa, Feb 25 2026 *)
PROG
(PARI) a(n)= binomial(n+2, 3) - 7*n\2 + 4 - 2*(1==n); \\ Ruud H.G. van Tol, Mar 04 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Tanya Khovanova and PRIMES STEP junior group, Feb 18 2026
STATUS
approved