For a certain sequence of numbers, the sum of the first $n$ numbers in the sequence is given by $n^3+4n$ for all positive integers $n$. What is the fifteenth number in the sequence?
How do you solve this problem the most efficient way?
For a certain sequence of numbers, the sum of the first $n$ numbers in the sequence is given by $n^3+4n$ for all positive integers $n$. What is the fifteenth number in the sequence?
How do you solve this problem the most efficient way?
Solve[Table[Sum[f[i], {i, 1, n}] == n^3 + 4 n, {n, 15}], Array[f, 15]]
(*
{{f[1] -> 5, f[2] -> 11, f[3] -> 23, f[4] -> 41, f[5] -> 65,
f[6] -> 95, f[7] -> 131, f[8] -> 173, f[9] -> 221, f[10] -> 275,
f[11] -> 335, f[12] -> 401, f[13] -> 473, f[14] -> 551,
f[15] -> 635}}
*)
Differences[Table[n^3 + 4 n, {n, 0, 15}]], but that requires a step of reasoning first.
– Brett Champion
Oct 09 '15 at 04:20
FindSequenceFunction on these sequence elements you get 5 - 3*n + 3*n^2 as the nth sequence element and the sum of the first n elements of the sequence returns 4*n + n^3 as required.
– Bob Hanlon
Oct 09 '15 at 06:16
(FindSequenceFunction@ Differences[Prepend[n^3 + 4 n /. n -> Range@10, 0]])@15
(* 635 *)
Might as well...
DifferenceDelta[n^3 + 4 n, n] /. n -> 15 - 1
Let $S_n=\sum^n_{j=1}a_n$. So $a_n=S_n-S_{n-1}$.
5 - 3 n + 3 n^2 /. n -> 15
yields 635. (Mathematica can obviously do this).
DifferenceDelta[] does, made explicit.
– J. M.'s missing motivation
Oct 09 '15 at 08:15
DifferenceDelta. I am happy to delete and acknowledge all the answers get to the same result. :)
– ubpdqn
Oct 09 '15 at 08:19
s(15)-s(14)– Alec Teal Oct 09 '15 at 09:35