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.

Aakash Anuj
  • 3,773
  • 7
  • 35
  • 47
  • 1
    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 ? – HamZa Oct 14 '12 at 12:27
  • It is complete....actually DJ(1)=1 and DJ(2)=2 – Aakash Anuj Oct 14 '12 at 12:54
  • 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 ? – HamZa Oct 14 '12 at 13:01
  • @HamZaDzCyberDeV after the index 2, the definition is very correct. – Aakash Anuj Oct 14 '12 at 13:06
  • 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? – HamZa Oct 14 '12 at 13:11
  • @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? – Aakash Anuj Oct 14 '12 at 13:27
  • 1
    @AakashAnuj the logic is still unclear. Post more of the series – Aniket Inge Oct 14 '12 at 20:17
  • 1
    @HamZaDzCyberDeV refer to the post below (the table) for the series – Aakash Anuj Oct 15 '12 at 07:17
  • @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 ? – HamZa Oct 15 '12 at 07:59
  • @HamZaDzCyberDeV I am using C. Computation is easy. The only thing that remains is finding the n'th term. – Aakash Anuj Oct 15 '12 at 09:25

1 Answers1

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.

Community
  • 1
  • 1
Stefano M
  • 4,267
  • 2
  • 27
  • 45