A sequence of integers

Level pending

A sequence { a i } i = 1 \{a_i\}_{i=1}^{\infty} of integers is defined by: a n = { 1 if n 3 0 if n = 4 ( a n 1 + a n 2 + a n 3 ) ( m o d 2 ) if n > 4 a_n= \begin{cases} 1 &\mbox{if } n \leq 3 \\ 0 & \mbox{if } n= 4 \\ \left ( a_{n-1} + a_{n-2} + a_{n-3} \right ) \pmod{2} & \mbox{if } n>4 \end{cases} Here n ( m o d 2 ) n \pmod{2} denotes the remainder when n n is divided by 2 2 , i.e. n ( m o d 2 ) = { 0 if n 0 ( m o d 2 ) 1 if n 1 ( m o d 2 ) n \pmod{2}= \begin{cases} 0 & \mbox{if } n \equiv 0 \pmod{2} \\ 1 & \mbox{if } n \equiv 1 \pmod{2} \end{cases} Find the number of integers n n such that 1 n < 25 1 \leq n <25 and a n = 1 a_n= 1 .


The answer is 13.

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.

1 solution

Pebrudal Zanu
Jan 13, 2014

Only list:

a = [ 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 ] a=[1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0]

Total= 13 \fbox{13}

You didn't have to list all the 25 25 values of a n a_n . Just note that it becomes periodic after a while.

Sreejato Bhattacharya - 7 years, 4 months ago

Yup's... Sreejato Bhattacharya...

pebrudal zanu - 7 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...