cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Small Sunday Teaser

LucMeekes
23-Emerald III

Small Sunday Teaser

The collapsed area contains the function NumberGenerator() that produces a new number for every supplied (integer) number. Three results are shown. Your task is to come up with a/the definition of the function such that it computes the (correct) value associated with 433 (and any other number in Z).

LucMeekes_1-1679222350386.png

 

As you will find out, I've limited the function to just the three first input numbers with:

LucMeekes_2-1679222479668.png

Where the red placeholder should contain the code to implement the actual functionality.

To not spoil the fun for others, I'll accept solutions in Prime or Mathcad as either one of:

- the function NumberGenerator(), limited to the same input range, in a collapsed locked area, dated later than the timestamp above. The password should be the result of NumberGenerator(pw), and pw is supplied along.

- submitted to me in a PM (in case you're limited to express).

 

Success!
Luc

 

4 REPLIES 4
Werner_E
25-Diamond I
(To:LucMeekes)


@LucMeekes wrote:

The collapsed area contains the function NumberGenerator() that produces a new number for every supplied (integer) number. Three results are shown. Your task is to come up with a/the definition of the function such that it computes the (correct) value associated with 433 (and any other number in Z).

 


Hmmm, "correct" value ???

There is an infinite number of "correct" values - choosing the one you have in mind would mean we have to polish our crystal balls and go into some mindreading session, which I sure am not good at.

Even if you would limit the results to integers, (which you didn't - you only limited the input values to integers) there would be an infinite number of possible functions we could use which all will give the correct result for the three given values, but possibly all different results for 433.

Find one of them attached.
The password is MY "correct" result for 433, but chances are it is not yours  - and of course the password is kind of senseless here as anybody could evaluate NumberGenX(433) 😉

 

EDIT: I added a different puzzle and I apologize because its quite old and well known. Thats also the reason why the collapsed region is not password protected

Werner_E_0-1679235049691.png

 

f(1)=7 f(2)=9 f(3)=11 f(4)=13 f(5)=15 f(6)=19 f(7)=22 f(8)=?

Werner_E
25-Diamond I
(To:LucMeekes)

OK, its already Monday and as nobody so far has contributed a solution - at least not the one you had in mind - I hereby do.

Format Prime 4, pw=4711

My function is not limited to integers, but probably one can argue the the results never should be negative ...?

I added one number to the list of allowed numbers to demonstrate

Werner_E_0-1679330306215.png

 

I also added another puzzle

Werner_E_2-1679331860241.png

The input numbers have to be positive integers. You may try any number, they are not limited.

 

 

 

LucMeekes
23-Emerald III
(To:Werner_E)

Indeed, it's monday. Sorry to have kept you waiting.

I got the following PM's:

LucMeekes_0-1679348896809.png

LucMeekes_1-1679348929894.png

TTokoro got the gist of the algorithm, but the implementation was flawed, resulting in NumberGenerator(433)=16909.

Fred also got the gist, and fabricated two implementations, the first also with the result 16909, the second with the (correct!) result 1699.

And today you (Werner) also found that algorithm. I was able to unlock your area with the password generated from 4711. The code of your function doesn't run in Prime express, because it uses programming. On the other hand it does allow floating point numbers, which my implementation doesn't.

 

Attached is my solution, which now allows a few more input values.

 

Luc

Announcements

Top Tags