Recurrent sequence is such that and for .
Find the value of:
Notation: denotes the floor function .
Try using a code
All of my problems are original .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Here are some terms
a 1 = k , a 2 = 2 k + 1 , a 3 = 3 k + 2 a 4 = 8 k + 7 , a 5 = 1 0 k + 9 , a 6 = 1 2 k + 1 1 , a 7 = 1 4 k + 1 3 , a 8 = 1 6 k + 1 5 a 9 = 2 7 k + 2 6 , a 1 0 = 3 0 k + 2 9 , a 1 1 = 3 3 k + 3 2 , a 1 2 = 3 6 k + 3 5 , a 1 3 = 3 9 k + 3 8 , a 1 4 = 4 2 k + 4 1 , a 1 5 = 4 5 k + 4 4
We can see that for blocks for size 3 , 5 , 7 , … , the Common difference of coefficient of k and constant term is constant and equal to coefficient of k in a n . It is also obvious as for consecutive odd ranges, square root is same number.
Above Question Can Be Solved By Breaking It into blocks of size 3 , 5 , 7 … respectively. This results in a time complexity O ( n )
Here is the code: