Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
RSolve@@{{a[n]-a[n-10]==101}~Join~Table[a[i+1]==101+10i,{i,0,9}],a[n],n}

I want to get the exact form of general formulas, but RSolve only gives a DifferenceRoot object. I tried FunctionExpand but it does not work.

share|improve this question
    
You can get the generic solution easily with the substitution a[n]->101 Log[b[n]]. The difficult bit seems to be matching your initial condition, though a numerical solution is found quickly. –  b.gatessucks May 19 at 8:52

1 Answer 1

RSolve[a[n] - a[n - 10] == 101, a[n], n] // AbsoluteTiming

also given a DifferenceRoot object, consider a[n-1]-a[n-11]==101, so a[n]-a[n-10]==a[n-1]-a[n-11]

RSolve[a[n] - a[n - 10] == a[n - 1] - a[n - 11], a[n], n]

worked fast. So we can using method of undetermined coefficients

Clear["`*"];
expr = Collect[RSolve[a[n] - a[n - 10] == a[n - 1] - a[n - 11], a[n], n][[1, 1, 2]], 
     _C, ExpToTrig@FullSimplify@ComplexExpand@# &];
list = Table[101 + 10 i, {i, 0, 9}]~Join~{202};
eq = list == Table[expr, {n, 11}];
{res} = expr /. RootReduce@Solve[eq, Array[C, 11], Method -> Rational] // Simplify
(*Table[res,{n,90}]//RootReduce*)

Output: $\left\{\frac{1}{100} \left(1010 n+10 \sqrt{5+2 \sqrt{5}} \sin \left(\frac{\pi n}{5}\right)+2 \sqrt{5 \left(5+2 \sqrt{5}\right)} \sin \left(\frac{2 \pi n}{5}\right)+10 \sqrt{5-2 \sqrt{5}} \sin \left(\frac{3 \pi n}{5}\right)+2 \sqrt{5 \left(5-2 \sqrt{5}\right)} \sin \left(\frac{4 \pi n}{5}\right)-5 i \sin (\pi n)-10 \cos \left(\frac{\pi n}{5}\right)-10 \cos \left(\frac{2 \pi n}{5}\right)-10 \cos \left(\frac{3 \pi n}{5}\right)-10 \cos \left(\frac{4 \pi n}{5}\right)-5 \cos (\pi n)+9045\right)\right\}$

${101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 222, \ 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 333, 343, 353, 363, \ 373, 383, 393, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 505, \ 515, 525, 535, 545, 555, 565, 575, 585, 595, 606, 616, 626, 636, 646, \ 656, 666, 676, 686, 696, 707, 717, 727, 737, 747, 757, 767, 777, 787, \ 797, 808, 818, 828, 838, 848, 858, 868, 878, 888, 898, 909, 919, 929, \ 939, 949, 959, 969, 979, 989, 999}$

By the way, I found Maple solve this equation very quickly.

rsolve({a(n)-a(n-10)=101, seq(a(i+1)=101+10*i, i=0..9)}, a)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.