You are not logged in. Please login at www.codechef.com to post your questions!

×

Can anyone help me with Spiral Numbers from Dementia 2012 - IIT Mandi Contest?

Hello friends can someone tell me how to approach this problem ??

@vijju123 @kaushal101 @mohit_negi @taran_1407 @vivek_1998299 @meooow @john_smith_3

asked 14 Apr, 07:07

harrypotter0's gravatar image

3★harrypotter0
1499
accept rate: 2%


Analyze the pattern. Here, it seems that difference between 2 consecutive results is :

$N_{i + 1} - N_{i} = 8i + 1 \quad \forall \quad i >= 0 \quad; \quad N_0 = 0$

Use this to come up with formula for $N_i$. I came up with this quadratic formula:

$(4i - 7)(i - 1)$

https://www.codechef.com/viewsolution/18244780

link

answered 14 Apr, 09:09

fr4nkesti3n's gravatar image

4★fr4nkesti3n
663
accept rate: 16%

edited 14 Apr, 19:36

Thanks for your efforts :) Could you explain how did you get that quadratic equation ?

(14 Apr, 12:21) harrypotter03★

On using summation on RHS I came up with 4ii+5*i+1 as the answer.

(14 Apr, 12:38) harrypotter03★
1

@harrypotter0 tbh I was really sleepy when I came up with the equation so I can't remember the exact procedure I went through. To come up with an equation for $n^{th}$ term:

Let a function $f(x) = 8x + 1$

Then, $N_1 = f(0) , \quad N_2 = f(0) + f(1)$ and so on So $N_i = \sum_{n=0}^{i-1} f(i)$

Use sum of n terms to get a formula:

$N_i = 8(0 + 1 + 2 + ... + (i-1)) + (1 + 1 + ...(i\quad times)... + 1)$

$N_i = i(4i - 3)$

My equation is just for $(i - 1)^{th}$ term instead of $i^{th}$ term.

(14 Apr, 19:50) fr4nkesti3n4★
1

@harrypotter0 I forgot to add that your expression gives $(i + 1)^{th}$ term, otherwise its same.. :D

(14 Apr, 22:28) fr4nkesti3n4★
1

@fr4nkesti3n I got it now thanks :)

(15 Apr, 10:04) harrypotter03★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,221
×1,881
×89
×7
×4

question asked: 14 Apr, 07:07

question was seen: 101 times

last updated: 15 Apr, 10:04