Thursday, February 17, 2011

An in(cr)edible recipe_Part_001 <3 :)

Hi pa..!!

Please Listen to Me...at-least one time...!?!

{ Time is running out..!! Hope you ARE listening...!? :-/ Hmmm.. :-( }

I just want you to do something fer me, & I promise YOU to show you something so incredible..!!!! :)

If I give you a +ve integer, 'n' to start with, you should go on giving me the smallest integer that is a multiple of (n-1) such that it is greater than or equal to 'n', STORE the result, & go on till you reach n=2, at which point the result does NOT change...
Okay..? :) 

JUST do that, and I shall show you a MAGICAL new thingy...!! :)
But don't stop...continue with this value 6 & the value 3 as your new 'n'...
i.e.., 6 gives way to 3-1=2*3=6 (n-1 is now 2)
and now, you can verify that considering n=2 , the answer remains the same =  6

Hence, given n=4 the final answer should be 6.

i.e.., 6 gives way to 3-1=2*3=6 (n-1 is now 2)
and now, you can verify that considering n=2 , the answer remains the same =  6
Hence, given n=4 the final answer should be 6.

Hence, given n=4 the final answer should be 6.
Or...to take another example, given n=5, the answer should be 10
{5-->8(by 4)-->9(by 3)-->10(by 2)-->10(by 1)-->STOP}


E.g., fer n=4, u start, & first come up with 6 (temporary result) by considering (n-1)=3


Or....given n=10, the answer should be 34. 
HOW..?
Here's HOW...
{10-->18(by 9)-->24(by 8)-->28(by 7)-->30(by 6)-->30(by 5)-->32(by 4)-->33(by 3)-->34(by 2)-->34(by 1)-->STOP}



So LET us imagine this PROCESS of generating the ANSWER, given a +ve integer 'n' input...as a Black-box...!

In Mathematical terms...let me call it a Function 'f' mapping an input 'n' (+ve integer) to some other +ve integer.

Thus, we have, 

f(1)=1,
f(4)=6,
f(5)=10,
f(10)=34
:
:
and so on...


[Can u write a simple function or manually build a table like this..for different values of +ve integers..?]

AHEM..!!

JUSST keep this function in mind...be READY..!!

For WHAT I shall unveil to YOU...is going to be one amazing surprise...!!!!!

I Promise..!!!!



(To be continued. . .)



[
PS: 

Not that I want to keep you waiting...no way...I myself can't wait...!! 

As I have said, Time is running out...& i have to SHARE soo many beautiful thingies..!!

It's just that I may have to spend some more energy/focus on R&D...! :)

I shall try & come up with a 'black-box' (function) of my own & try to graph some results...which shall be a fitting tribute to this incredible thingy we're going to witness..!

Am sure you shall agree...SOOON....!! ;) :)

Get Ready...to be SURPRISED...!!!
]




5 comments:

  1. eradosa recipie ? ha.. ha.. sweet pi(e) ;)

    lookin fwd 4da answr :)

    btw, to rCurse the number generation here is parmula ! had to split function into two as needed to take care of depth...


    public class Main {
    int f(int n) {
    return f_(n, n);
    }

    int f_(int m, int i) {
    return (i < 2) ? m : f_(((m - 1) / i + 1) * i, i - 1);
    }
    }

    ReplyDelete
  2. @Prashant -- Yes darling...!!!
    it's gonna be the recipie u wanted/thought of..!
    Make a table (or hashmap) of n v/s f(n) values...fer say n in [1,30]. The fun begins frem there. :)

    ReplyDelete
  3. ya the fun(ction)'s with me olready !!
    but dont want to ruin this suspens-ion ;) so will hold it till the next post !

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Sure @Prashant darling!
    Me too have a one-liner punction ready!
    But stuck due to fermat-praablems..!! :-(
    (oops..i meant FORMAT not Fermat k ?? ;) :))
    Will try egain teday...! :)

    ReplyDelete

Pleeze do give me YOUr (in)valuable feedback...!
Thanks a lot in deed.. :)