Figure-It-Out Function! - Part 1: For 4 years

Algebra Level 5

A function f : Z Z f:\mathbb{Z}\rightarrow\mathbb{Z} , has the following conditions

  • f ( n ) = f ( n 1 ) + 2 f ( n 2 ) 2 f(n)=\frac{f(n-1)+2f(\frac{n}{2})}{2} , if n n is even

  • f ( n ) = f ( n ) + 2 f ( n 1 2 ) 2 f(n)=\frac{f(n)+2f(\frac{n-1}{2})}{2} , if n n is odd

If f ( 1 ) = 2 f(1)=2 , find f ( 2011 ) f ( 2012 ) f ( 2013 ) f ( 2014 ) f ( 3 ) f ( 4 ) f ( 10 ) f ( 12 ) f ( 18 ) f ( 52 ) f ( 60 ) f ( 502 ) \frac{f(2011)f(2012)f(2013)f(2014)}{f(3)f(4)f(10)f(12)f(18)f(52)f(60)f(502)}

This problem is part of the Figure-It-Out Function! series


The answer is 186.

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.

6 solutions

Prakhar Gupta
Mar 12, 2015

We have the second formula as for any odd:- f ( n ) = f ( n ) + 2 f ( n 1 2 ) 2 f(n) = \dfrac{f(n) + 2 f(\dfrac{n-1}{2})}{2} Put n = 2 t + 1 n = 2t+1 , so that above formula is true for any natural t t . 2 f ( 2 t + 1 ) = f ( 2 t + 1 ) + 2 f ( t ) 2f(2t+1) = f(2t+1) + 2f(t) f ( 2 t + 1 ) = 2 f ( t ) f(2t+1) = 2f(t) Similarly put n = 2 t n=2t in the first formula and we get:- 2 f ( 2 t ) = f ( 2 t 1 ) + 2 f ( t ) 2f(2t)= f(2t-1) +2f(t) From previous eqation:- 2 f ( 2 t ) = f ( 2 t 1 ) + f ( 2 t + 1 ) 2f(2t) = f(2t-1)+f(2t+1) Hence we see that terms of f ( n ) f(n) are in A P AP . Also we can see that f ( 3 ) = 2 f ( 1 ) = 4 f(3) = 2 f(1)=4 From the definition of AP f ( n ) = f ( 1 ) + ( n 1 ) d f(n) = f(1) +(n-1)d f ( 3 ) = f ( 1 ) + 2 d f(3) = f(1) + 2d 4 = 2 + 2 d 4 = 2 + 2d d = 1 d=1 Hence f ( n ) = 2 + n 1 f(n) = 2 + n-1 f ( n ) = n + 1 f(n) = n+1

Drop TheProblem
Nov 1, 2014
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#include<iostream>
#include<stdio.h>
using namespace std;
int f(int n){
        if (n==1) return 2;
        if(n%2==0) {return (f(n-1)+2*f(n/2))/2;}
        else {return 2*f((n-1)/2);}
}
int main(){   
int N=f(2011)*f(2012)*f(2013)*f(2014);
int D=f(3)*f(4)*f(10)*f(12)*f(18)*f(52)*f(60)*f(502);
cout<<N/D;
system("pause");
    return 0;
}
N/D=186

Plugging the simple cases: one can conjecture that f(n) = n + 1.

We use induction to prove this:

Base cases: n = 0, f(0) = 0 + 1 = 1 as plugged. n = 1, f(1) = 1 + 1 = 2 as given.

Assume f(n) = n + 1 for any n.

If n + 1 is even (implies that n is odd):

f(n + 1) = [f(n) + 2f([n + 1]/2)]/2

From f(n):

f(n) = 2 f([n-1]/2) as plugged from the given.

This implies:

f(n+1) = f([n - 1]/2) + f([n + 1]/2)

And if n + 1 is odd:

Plugging from the given gives f(n + 1) = 2 f(n/2).

Equating both f(n + 1) = f(n + 1) especially when n is part of integer set.

f([n - 1]/2) + f([n + 1]/2) = 2 f(n/2).

This is where we use Jensen's Inequality. Since f''(n) = 0, this is the equality case of Jensen. Hence, the induction is proved.

Hs N
Sep 10, 2014

The first step is to realise that the odd part is a rather elaborate way of writing that f ( n ) = 2 f ( n 1 2 ) f(n)=2f(\frac{n-1}{2}) . After calculating the image of the first few numbers, we start to suspect that this is a rather complicated way of describing the function f ( n ) = n + 1 f(n)=n+1 , which one can indeed show it is. As a result the given quotient equals 2012 2013 2014 2015 4 5 11 13 19 53 61 503 \frac{2012\cdot2013\cdot2014\cdot2015}{4\cdot5\cdot11\cdot13\cdot19\cdot53\cdot61\cdot503} , where all factors in the denominator are chosen nicely and cansel out good part of the numerator. All that's left in the end is 2 3 31 = 186 2\cdot3\cdot31 = \boxed{186} .

Kenny Lau
Aug 29, 2014

Java:

public class brilliant{
    public static void main(String args[]){
        double f[] = new double[2015];
        f[1] = 2;
        for(int i=2;i<2015;i++){
            if(i%2==0) f[i]=(f[i-1]+2*f[i/2])/2;
            else f[i] = 2*f[i/2];
        }
        System.out.println(f[2011]*f[2012]*f[2013]*f[2014]/f[3]/f[4]/f[10]/f[12]/f[18]/f[52]/f[60]/f[502]);
    }
}

Very simple question, just put up the values: f(0)=1 f(1)=2 f(2)=3

Hence, f(n)=n+1

How do you know those values?

Calvin Lin Staff - 6 years, 10 months ago

Log in to reply

We are given that f(1)=2 and all other values can be find out from given conditions for f(n) and hence, series will be obtained

Kïñshük Sïñgh - 6 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...