Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

B Nth term of periodic sequence

  1. Jul 16, 2016 #1
    Say we have a periodic sequencs, ABCDABCDABCDA... etc. We would normally call A term 1, B term 2, C term 3, etc. However, to find the nth term, do we need to designate A as term 0, B as term 1, etc? Since we would use n mod 4 to find the nth term, wouldn't this mean that 4, 8, 12, etc would have to correspond to 0 rather than 1, this showing that we have to start the sequence ordering from 0 rather than 1?
    Wouldn't this be in contrast to other sequences such as geometric and arithmetic that start at 1 rather than 0?
     
  2. jcsd
  3. Jul 17, 2016 #2

    andrewkirk

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    We can write it either way. It depends on how we index the four-element vocabulary set and also on how we index the elements of the sequence. Since either can start at 0 or 1, there are four different ways we can do this. Here are two of them:

    Least compact method (both start at 1):
    ##V_1=`A',\ V_2=`B',\ V_3=`C', \ V_4=`D'## then the sequence ##s_n##, numbered starting at 1, has ##s_n=V_{(1+(n-1)\mod 4)}##

    Most compact method (both start at 0):
    ##V_0=`A',\ V_1=`B',\ V_2=`C', \ V_3=`D'## then the sequence ##s_n##, numbered starting at 0, has ##s_n=V_{(n\mod 4)}##
     
  4. Jul 17, 2016 #3
    So although both ways of numbering are possible, starting at 0 is probably the simplest way for periodic sequences?
     
  5. Jul 17, 2016 #4

    andrewkirk

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Yes. This issue often comes up in programming computers. Deciding whether to index a vector starting with zero or one can significantly affect the verbosity of the code that refers to that vector. Usually, but not always, I have found it is better to start at 0. But not all computer languages allow array indexing to start with numbers other than 1.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Nth term of periodic sequence
  1. Fibonacci nth term (Replies: 9)

  2. Nth term (Replies: 5)

Loading...