11
$\begingroup$

I have these numbers and I couldn't guess the pattern of this question it might be easy or it might be hard whatever these are the numbers $$ f(43) = 13\\ f(79) = 40\\ f(111) = 120\\f(138)=161\\f(169) = 247\\f(256) = ??? $$ I tried to sum digits of the number but get nothing can any one help /:

$\endgroup$
  • 4
    $\begingroup$ Can you tell us a bit about where this puzzle comes from? $\endgroup$ – Gareth McCaughan Nov 28 '17 at 16:42
  • 13
    $\begingroup$ There are an infinite number of functions that will agree at the 5 points given but have different values at 256. $\endgroup$ – chepner Nov 28 '17 at 21:44
  • 2
    $\begingroup$ @chepner This objection applies to any "what's next in this sequence" question. Please move along. $\endgroup$ – David Richerby Nov 29 '17 at 9:26
28
$\begingroup$

The answer is:

619

Reason: f(x*10 + y) = … where x: N, y: [0, 9]

Because: $f(x*10+y) = x^2 - y$ $$f(43) = 4^2 -3 = 13$$ $$f(79) = 7^2 - 9 = 40$$ $$f(111) = 11^2 - 1 = 120$$ $$f(138) = 13^2 - 8 = 161$$ So: $$f(256) = 25^2 - 6 = 619$$

$\endgroup$
  • $\begingroup$ Why not explain notation like f(x*10 + y) = … where x: N, y: [0, 9]? $\endgroup$ – user28434 Nov 29 '17 at 15:49
  • $\begingroup$ @user28434 As you wish $\endgroup$ – rudra Nov 29 '17 at 16:00
15
$\begingroup$

@rudha I am not allowed to make comments yet. I like your answer.

Since I am new to this notation style, I found the notation confusing because:

Using $f(xy)$ notation, $f(111)$ is ambiguous to me, as $x$ could be $1$, and $y$ could be $11$, such that $f(111)$ could also become $1^2 - 11$ resulting in $-10$. But, even before that, I thought $xy$ meant $x \times y$.

So, I just wanted to reformat it in the imperative style I am used to:

$$ f(xy) = x^2 - y $$ becomes: $$ f(z) = \lfloor z/10 \rfloor^2 - (z\bmod10)\,,$$ which becomes, in pseudocode: $$ f(z) = \mathrm{power}( \mathrm{floor}(z/10) , 2) - ( \mathrm{modulus}(z,10) ) $$

So, in JavaScript (which is easy to test in web browsers) it would be:

function f(z) { return Math.pow( Math.floor(z/10), 2) - z%10; }

$\endgroup$
  • $\begingroup$ It could also be shown as f(x \Vert y), which produces $f(x \Vert y)$, as long as you clarify the meaning. $\Vert$ is a symbol commonly used for digit concatenation, per Wolfram Mathworld and Math.SE. (I do like showing the explicit formula for a single number $z$, but I think this conveys @rudra's intention better.) $\endgroup$ – No don't shown my real name Nov 28 '17 at 22:11
5
$\begingroup$

I believe the answer is:

3166

Reasoning:

By calculating the quartic regression equation (See Wolframalpha.com) the number 256 can be substituted into the equation yielding f(256)= 3166

$\endgroup$
  • 1
    $\begingroup$ Welcome to Puzzling! (Take the Tour!) To be a puzzle and not an "identify the mathematical sequence" question, this would have to be something that goes beyond mechanically fitting a formula to the literal numbers and then grinding out the next entry (see, for example, our guidance to number sequence posters). See other answers which would be more in the spirit of what to expect, and see if you can come up with a reasonable but interesting pattern! $\endgroup$ – Rubio Nov 28 '17 at 23:44
  • $\begingroup$ btw it's wolframalpha not wolframalfa $\endgroup$ – MCMastery Nov 29 '17 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.