Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
Dan_ wrote:
Meeeh.... I'd say no, IMO the equation has to result in an integer to count. And (2?)! + √2 = 7,41 isn't really that close to 7 anyway. But this is just my opinion.
yep, I'll put that into the header before uploading it... a second please...
I put it here
Beware, it's a windows file and linux users will have to change the location.
The ouput is unicode for the square root symbol, the windows shell isn't unicode compatible, but notepad is. Piping into file helps.
No not that at the moment, I hardcoded that for speed. And because I didn't want yet another foreach loop in it :)
I tested up to a search depth of 20 unary functions after each expression (sic!) and I didn't find a 3527. I think it's safe to assume that number can't be built from four 4s (using this set of functions).
Edit:
FODA, where exactly comes that limiar factor from? I searched a bit for this problem now and
1. none of them uses the ? operator,
2. no webpage in a language I speak knows something about a limiar factor...
We're using ? to represent the sum from 1 to whatever. In math, it's usually denoted with a capital sigma, but it's easier to type as ? for this little game.
Well, you could also think of it as signifying the nth triangular number, which is commonly written as T_n. So just imagine that the ? is the T_ part and whatever follows is the subscript.
Yes I know it both as sum and as triangular number. In that case one could even add the tetrahedral numbers.
I just wondered about the ? convention and the term "limiar factor" FODA used on the first page.
Btw. did anyone extend my script to cope with three 3s and five 5s by now?
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
its in the book "The Art of Computer Programming, second edition, vol. 1 / Fundamental Algorithms" by "Donald E. Knuth - Stanford University - Addison-Wesley Publishing Company".
i dont know anything else about it
That's easy enough, Dacicus, here you go:
(4 * 4)? + !4 = 145
(Note that I didn't actually use subfactorials in my solution. There are a whole bunch of operators you guys are neglecting that, though they perhaps remove some of the challenge, extend the boundaries of what's possible by leaps and bounds. For example, the decimal point, floor, cieling, the bar over repeating decimals, nth roots, subfactorials, etc. Floor and cieling are particularly good. To find 3527, for example, all you have to do is find a way to generate a number between (3526^4 + 1) and (3528^4 - 1) with three 4's, take the 4th root of it, and round it in the appropriate direction.)
Well the challenge was to do it with the set of functions given. As some people poited out before there are hundreds of weird functions out there.
As for using floor and ceiling, that is cheating. Leaving discrete values is like noclips in a shooter. It's a different thing if you get real integers out of it, like the direct computation of fibonacci numbers. Could prove valuable in a five 5 challenge.
But to make zebra happy I included subfactorials up to !8 into the script.
5783 seems to be the barrier then.
I agree that using subfactorials are cheating, it was not given as one of the tools you could use...
Though, i don't think you can call 5783 a barrier, since there are greater number that can be done with 4 4's, actually there are an infinity of numbers that can be done thiw way...
First of all, I had a bug in the code, the actual barrier with subfactorials is 3947.
The 3527 solution provided by the script is:
3527 = [(√4 * 4!)? * (√4)?] - !√4
And the term "barrier" is for me the first number that cannot be displayed in the way that is subject here. The fact that you can get infinite numbers with the rules is trivial. I'm open to better names though.
As I recall, that was not the challenge at all:
Floor and ceiling are incredibly common, easy to understand, and have widely accepted symbolic representations. If you would like to limit yourself to a few smybols/functions, then so be it. But since you guys are already cheating according to the rules of the "normal" game, I figured the sky was the limit.
If you so desire, here are some other widely accepted symbols that might extend "the barrier" :
Double factorial: ‼
5‼ = 5*3*1
6‼ = 6*4*2
Hyperpower: ↑
2↑2 = 2^2
3↑3 = 3^3^3
4↑4 = 4^4^4^4
2↑5 = 2^2^2^2^2
Extended hyperpowers: ↑↑, ↑↑↑, ↑↑↑↑ ...
n↑↑m = n↑n↑...↑n (m times)
n↑↑↑m = n↑↑n↑↑..↑↑n (m times)
etc.
Perhaps you should group operations according to their desirability, and have your script come up with a purity factor based on how low it has to stoop to come up with a solution.
Some proposals for the levels of purity:
Most pure: + - * / () concatenate
Less pure: ^ √ . vinculum
Less pure: x!
Less pure: ? !x ‼ ↑
Less pure: floor cieling
An interesting exercise is determining the amount of 4 necessary to make the integer in question using whichever purity level.
Of course, I can define a series of functions that returns an particular integer when feed a four. Making *any* mathematical symbol a bit trivial.
Build a man a fire, warm him for a day,
Set a man on fire, warm him for the rest of his life.
Well, we were at least restricted to functions or operators that have a (presumably widely accepted) symbolic representation. Though that disallows logarithms (which I disagree with), it also eliminates arbitrary functions that make the exercise trivial.