1
$\begingroup$

I have a sequence $a_0 = 1, a_1, a_2, a_3, \dots$ such that $a_4 = a_{24}$ which implies that period repeats after $a_{24}$ to $a_{43}$. Each $a_n$ depends on $a_{n-1}$ only. I need general term for this sequence for any value of $t$ whether $t < 4,\ t > 4,\ t$ can be as large as $10^{25}$.

There is another sequence such that $b_n = b_{n-1} + a_n$, how do I find the general term for this sequence $b$? Please note I am calculating all $a_n$ till the the cycle is found. I am very confused by this question? Currently I am getting answers close to the final answer but not exact ones? Please help.

PS: This is not a homeowork problem, its a algorithmic problem on spoj.

  • 0
    $a_{4}=a_{24}$ does _not_ imply that the sequence repeats after $a_{24}$, unless you have some _additional_ information that you haven't told us (such as, for example, that each $a_n$ depends only on $a_{n-1}$).2012-10-07
  • 0
    @HenningMakholm:yes each a[n] depends on only a[n-1]2012-10-07
  • 0
    @HenningMakholm:can't it be done by just finding the period and all terms upto the period2012-10-07
  • 0
    Yes, with that additional information it is enough to find the terms up to the repeat, and then take the remainder of each higher index modulo 20.2012-10-07
  • 0
    @HenningMakholm:But what about sequence B? What will be the general term for it ? also we need a correction as period starts from 4 not 12012-10-07
  • 0
    Can someone please provide a formal answer?2012-10-07

1 Answers 1