• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Somebody help me out with a brain teaser...

Joined
7/25/10
Messages
862
Points
38
"When 13 is inputted into a certain formula, the result is 7. Under the same formula, 2352 yields 16, 246 yields 14, 700 yields 16, and 1030 yields 14.

If 9304 is inputted, what would be the result? "









Highlight for answer:
-------------------------------------
19
-------------------------------------

I don't get why though... *thinks harder*
 
My idea is:

13= 13 --> 7
2352= (2^4)*3*(7^2) --> 2^4
246=2*3*41 --> 2*7
700=(2^2)*(5^2)*7 --> 2^4
1030=2*5*103 ---> 2*7


So, if the number can be written only using prime factors that are <13, the result is 2^4, else is 7* (numbers of factors that are <=13) [do not consider the one as a prime factor].

This fits all the numbers you have written.
If this is the right answer, we can say:

9304= 2*1163 ==> 2 factors && (1 factor <13) ----> 7*1=7

This led to 9304-->7
 
That's not the answer though #-o
(highlight the first post for the answer...)
 
Also, your 246 gets you 2*3*7 according to your rule, which is 42.
Anybody else :$
 
Also, your 246 gets you 2*3*7 according to your rule, which is 42.
Anybody else :$


246=2*3*41. 1 factor is >13, so the formula is 7*(n°factors <=13)
The numbers of factors <=13 are 2: 2 and 3.

so 246 gives 2*7=14, as you said in the first post.
 
@Andy
Yeah, I was thinking it could be
1) Sum of digits
2) Modulo
3) Different bases?? (EDIT as of 12/16... I called it :P. J/k. Well done aix!)

@Fred ah... so number of factors, I see. Still, it's not the supplied answer. :\

It has to be something more elegant, because otherwise you could define an arbitrary function :$
 
@Andy
Yeah, I was thinking it could be
1) Sum of digits
2) Modulo
3) Different bases??

@Fred ah... so number of factors, I see. Still, it's not the supplied answer. :\

It has to be something more elegant, because otherwise you could define an arbitrary function :$



Yeah, I think it too, But this was the first solution that came up in my mind ;)
 
Possible solution

Here's a possible solution:

Write out the number in binary with no leading zeroes. The result is 2*n1+n0, where n1 is the number of 1s in the binary representation, and n0 is the number of zeroes.
 
Here's a possible solution:

Write out the number in binary with no leading zeroes. The result is 2*n1+n0, where n1 is the number of 1s in the binary representation, and n0 is the number of zeroes.

100%. Well done aix.
 
@aix
Thanks! You're brilliant :O (Nice first post too ;) )

@Byron
I couldn't :/
It's just not online.
LOL
 
Well done! I was thinking along the binary route myself having tried out several other routes (remainders, bases, summing the digits etc.)



Here's a possible solution:

Write out the number in binary with no leading zeroes. The result is 2*n1+n0, where n1 is the number of 1s in the binary representation, and n0 is the number of zeroes.
 
Back
Top