Finding the nth term of a series
Asked Answered
D

1

0

Find the n'th term of DJ(i).

Given DJ(i) is the number of times i is present in DJ(i)

The array DJ(i) is as shown:

   i       1 2 3 4 5 6 7 8 9 10 ..... 
DJ(i)      1 2 2 3 3 4 4 4 5  5 .....

I want the nth term of the series DJ(i). I have to carry out some further calculations with the term.

Donnydonnybrook answered 14/10, 2012 at 11:57 Comment(10)
I don't get this part >"Given DJ(i) is the number of times i is present in DJ(i)" or maybe the example isn't complete ?Cestar
It is complete....actually DJ(1)=1 and DJ(2)=2Donnydonnybrook
DJ(i) = number of times i is present in DJ(i) => this doesn't make sense ! it's like you're telling me Y = number*i present in Y ?_? For example Y = DJ(8) = 1 because "8" is present only once in Y ... Or am i missing something ?Cestar
@HamZaDzCyberDeV after the index 2, the definition is very correct.Donnydonnybrook
Would you then please explain why DJ(1)=(1), DJ(2)=2, DJ(3)=2, DJ(4)=3, DJ(5)=3,DJ(6)=4 ... If i don't understand the logic behind it, how can i help you then?Cestar
@HamZaDzCyberDeV See number of times 2 appears is 2. Therefore DJ(3)=2, now since DJ(i) has to be a monotonic sequence, the result follows. Now we have DJ(3)=2, it implies that 3 is present twice in the list. Therefore DJ(4)=3 and DJ(5)=3....and so on..could you get the logic?Donnydonnybrook
@AakashAnuj the logic is still unclear. Post more of the seriesAlejandraalejandrina
@HamZaDzCyberDeV refer to the post below (the table) for the seriesDonnydonnybrook
@AakashAnuj after knowing the sequence name, i searched on the net, and i got the idea thx ! I think you may compute the terms until nth term. Which programming language are you using ?Cestar
@HamZaDzCyberDeV I am using C. Computation is easy. The only thing that remains is finding the n'th term.Donnydonnybrook
S
2

Look up the value in this table or compute yourself the table in the programming language of your choice (left as an easy exercise). Also check this SO answer and OEIS.

Seize answered 14/10, 2012 at 20:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.