mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2015-12-11, 00:28   #12
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

5×271 Posts
Default

Haha, oops. I just submitted it to them, but now realised I only used 3 operations! I wonder if that will make me look like a fool or get me extra nerd points.
lavalamp is offline   Reply With Quote
Old 2015-12-11, 02:17   #13
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

250516 Posts
Default

Well, now that they explained that in their world sin() is also an "operation", it is not all that interesting.
Then, LaurV is exactly right, and precisely one operation is enough.
Batalov is offline   Reply With Quote
Old 2015-12-11, 02:35   #14
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

5·271 Posts
Default

I interpret their clarification to mean any standard math operations a programming language could perform natively, or perhaps functions in a standard math library. That's still a tricky challenge, however I did not use any of these in my solution.
lavalamp is offline   Reply With Quote
Old 2016-01-03, 15:35   #15
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

22·7·53 Posts
Default

The official solution is at: https://www.research.ibm.com/haifa/p...ember2015.html

My posted solution was similar to Dan Dima's solution, my another (not submitted) solution:
let d=sum(n=0,255,G(n)/256^n)+1/(256^256), where G() is the function for the EBCDIC letters into ASCII letters transformation, so G(129)=97 etc. then for h(n)=floor(d*256^n)%256 it is easy to see that h(n)=G(n) for every 0<=n<256 what was needed. In full form:

h(n)=floor(0.000000000000000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000000000000002116\
0871574023119343370726678609983331272809167795795371266002282812403796908468340\
1062120093394372785917997751852761389112682180034805416796769614756139395745340\
5316874418644225900820937735649889844185731317514412265218783789287435962695391\
6769618658126318692786005267883838614428630160146494263512345061469631963959879\
0847363623041992288026861287030630015653184034834413849332424159194251604138428\
0840024700654399175511236611888422369348515979897369815022618085414673227312285\
9200860264474643110935217054506660650588083317038524670978053386313535289037283\
0940299114102533990167415637892657794585932762593581402197984330138310070498970\
1147361623418615666834026027060449459530324938506075839327252338*256^n)%256

(note: added 1/(256^256) to avoid precision problems)

In some sense this is a much better solution than the posted since we can code every f:Z_+>Z_m function using at most 4 operations.
R. Gerbicz is offline   Reply With Quote
Old 2016-01-06, 10:23   #16
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

54B16 Posts
Default

Mine was also similar to Dan's, but I don't feel as though his is quite so nice since it uses base 10.

The solution from Yan-Wu He is pretty beautiful though. Very nice 3 operation code using numbers that will handily fit inside a long int or even a double without loss of precision.

This was mine:
f(x) = n \ 128^x % 128

Where \ is integer division and n is 493 digits (1638 bits):

Code:
8660314991803751929461825923499426172658629134394367739779900947281057156471620670172581000271320265552857681513609896807258827213701656448003504939921977203999655544729545098561245769135132614624165711458986648644217231693992750110296972675461802376918477577190333909894402187783439723363380673978509841172906208789840686903659306840369831419292555756879108408590085051899189147701931633211690537069463072665259675689054778847243664513870245828869524606392755862278941061726515154178688417792
The code for generating n:
Code:
n=0;
l=65;

for(i=193,233,

	if(i<=201 || (209<=i && i<=217) || (226<=i && i<=233),
		n += 128^i * l;
		l++
	);

);

l=97;

for(i=129,169,

	if(i<=137 || (145<=i && i<=153) || (162<=i && i<=169),
		n += 128^i * l;
		l++
	);

);
This code could also be adapted to convert any character to any other.
lavalamp is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
December 2017 Batalov Puzzles 4 2018-01-04 04:33
December 2016 Xyzzy Puzzles 11 2017-01-24 12:27
December 2014 Xyzzy Puzzles 13 2015-01-02 19:41
Conference in Amsterdam 1-2 December fivemack Information & Answers 6 2011-12-12 13:13
Server update in December ltd Prime Sierpinski Project 4 2010-12-17 13:14

All times are UTC. The time now is 03:16.


Sat Jul 17 03:16:55 UTC 2021 up 50 days, 1:04, 1 user, load averages: 1.38, 1.41, 1.35

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.