Code puzzle thread +_+

And he's the guy who complained when I placed a partial reasoning within spoiler tags as too spoilerish! :lol:

I am not sure why the sum wasn't named but still mentioned?

Spoiler :
Because it's actually not needed? You may have missed the key clue there.
 
I got the same answer because I reasoned that the smallest digit has to be unique and the other two were not, because the solver didn't need to know the order of the digits.
 
Spoiler :
In fact I adapted a puzzle I remember reading in a newspaper a loooong time ago.

The original puzzle read something like that:
Two mathematicians meet in the street and greet one another.
"Hey nice to see you! Long time no see. How are you, how's the family?"
"We're doing great, thank you. How about you? Still a hardened celibate?"
"Still indeed. Hey, you have three sons, don't you, but sorry, can't remember how old they are?"
"Haha... What if I told you the product of their ages is 36?"
"C'mon, you know that's not enough information."
"Righty so. See the building over there? Count the windows. That's the sum of their ages."
"Still not enough."
"And if I told you my eldest is red-haired?"
"Gotcha."

My adaptation is weaker:
- It limits the solutions set : 12,3,1 for instance needn't be considered when the answer is made of digits instead of ages.
- The introduction of the notion of sequence allows the alternate reasonning Arakhor used, bypassing the need to figure out that the sum has to be 13.
- It loses out on the cool factor of the initial reaction "What? How is the kid being red-haired supposed to help??" Until you realize that it doesn't, the clue being the fact there is an eldest.
 
A pretty unusual number of windows though.
Speaking of math, is there a formula to establish the shortest number of steps for a solution of a given digit riddle? Also for knowing the maximum number. I feel there must be.
 
This is easy to solve in a number of ways, but personally I thought of a slight Gödelization :)

1724253042918.png
 
Last edited:
Spoiler :

Red and Blue signs can't be both false (unless the sleeping bag was cut up), so we know that:
- the sleeping bag is either in the blue tent or the red tent
- Green and Yellow signs are false.
As such, Green sign is useless: we already know the bag isn't in the yellow tent.
But Yellow sign gives the answer: Blue tent it is.

The number of "truths" and "lies" is the determining factor here, as with those statements, the answer could be any tent:
Red : 2T 2F
Yellow : 4T 0F
Blue : 1T 3F
Green : 3T 1F

Wondering if such a puzzle could be set where providing that information wouldn't be necessary...
 
Same idea, although you could try making it fancy with prime divisors - though not with general polynomials, as everything here is known and in that a number.
Spoiler :
Say that any true statement has a value of 2, any false an integer value of not 2=>any product including the (by definition) only true statement will be divisible by 2^x with x Ε N x=1 but not divisible by 2^x with x Ε N and x>1 (ie its prime factors include 2 only once). We see that statements bd and bc (because they are either false/false or true/true) if divisible by 2^x they are also that for x E N, x>1<=> statement bd, bc are either not divisible by 2 or divisible by 2^x with x Ε N, x>1=>statement bdc therefore carries over that quality of bd,bc as it is comprised of them=> statement a has to be true since it's the only one left=>red is true and the bag is in blue.
 
Last edited:
Ok, since no one is posting, here is one (it's a basic algebra problem).
Show that the difference of squares of any two odd numbers (ie they don't have to be consecutive), will always be a multiple of 8 (eg 11x11- 7x7=72=8x9).
 
Been a looong time since I've done any algebra.

Spoiler :

Let's try and brute-force this.
The "difference of squares of any two odd numbers" can be expressed as:
with a,b E N, b > 0
(2(a+b)+1)² - (2a+1)²
= (4a² + 4b² + 4a + 4b + 8ab + 1) - (4a² + 4a + 1)
= 4b² + 4b + 8ab
= 4(b² + b + 2ab)
which is a multiple of 8 if b² + b is a multiple of 2.
b² + b = b(b+1) which is indeed a multiple of 2 for b E N, b > 0.
 
Been a looong time since I've done any algebra.

Spoiler :

Let's try and brute-force this.
The "difference of squares of any two odd numbers" can be expressed as:
with a,b E N, b > 0
(2(a+b)+1)² - (2a+1)²
= (4a² + 4b² + 4a + 4b + 8ab + 1) - (4a² + 4a + 1)
= 4b² + 4b + 8ab
= 4(b² + b + 2ab)
which is a multiple of 8 if b² + b is a multiple of 2.
b² + b = b(b+1) which is indeed a multiple of 2 for b E N, b > 0.
Nice. My own approach was a bit different, yours is a little more elegant imo.
Spoiler :
The two odd numbers can be written as 2a+1, 2b+1, with a,b Ε Ν (this includes the general trivial case a=b=>0=8(0), as well as the complement a≠b). Then we get (2a+1)^2-(2b+1)^2= (dif of squares) (2a+1+2b+1)(2a-2b)=2(a+b+1)(2)(a-b)=4(a+b+1)(a-b). Let a-b=x, then a+b=x+2b=>4(x+2b+1)(x), which if x is even, makes x+1 odd and x+1+2b also odd=>4(odd)(even)=4(even)=8(integer), and if x is odd, makes x+1 even and x+1+2b also even=>4(even)(odd)=4(even)=8(integer).
 
Last edited:
Ok... Trying to brute-force someone else posting a riddle finally.
Here is another one, with this goal in mind:
A number of orks went to eat at an ork market. Due to their custom, they would split the bill, each ork paying the same regardless of how much they ate. Humans were on the menu, as always, but the orks had been carrying three human carcasses with them when they sat down to eat, and the ork-waiter wasn't paying attention and thought those three were also orks. So at first the bill came back, for each ork to pay as if there were three more ork customers. Then the mistake had to be corrected, so each real ork ended up paying 9 (ork) dollars more than he was asked to pay before. In total, what all orks together paid, was 84 dollars.
Can you find how many real orks were dining?
 
Spoiler :

Wasn't expecting a 2nd degree equation there...
N : actual number or orks
p : price for an individual meal

orks pay 84 total in the end
=> pxN = 84

each ork has to pay an extra 9 bucks after the waiter produced individual bills by dividing the total price with the wrong number of orks
=> pxN / (N+3) = p - 9
=> p = 3N + 9

Injecting that in the first formula:
=> N² + 3N - 28 = 0
Which has N = 4 as a positive integer solution.

So there were 4 orks, and the meal cost 21$.
 
Which is the correct answer ?

1. All of the below.
2. None of the below.
3. All of the above.
4. One of the above.
5. None of the above.
6. None of the above.
 
I think:

Spoiler :
If 1 was correct, then (say) 6 would be correct, which implies 1 is false => 1 is false.
If 2 was correct then 4 would be false=>either none above 4 are correct and 2 is false, or more than one are correct but 1=>2 is false and 2=>1 is false and 3 implies 1 and 2 are true=>2 is false.
3 has already been shown to be false (because 1^2 can't be true)
4 has already been shown to be false because if it was true then neither 1,2 or 3 can be true.
5 isn't negated by anything that preceded it. If it was negated by 6, then it would mean there was at least one true statement before 5, which we have shown to be false. Therefore 6 is also false and 5 is the correct answer.
 
Well, here is something hideous I found with the first googling:

1724684138000.png


Pay no attention to the pompous or trolling or both "only for genius" bit, he is greek :shake: ;)

And while I did solve this before posting, my method was not as clean as I would have wanted (ie it involved checking results, despite having an overall formula). Maybe there is an elegant method, but I am not aware of it currently :o

(note: by ABC, BCD, he obviously means the number as a whole, not a product of three numbers)
 
Last edited:
Might be a better way indeed of solving it, but it seems straightforward enough.

Spoiler :

ABC divisible by 3,4,5 => divisible by 60 => C = 0
BCD divisible by 5,8 => divisible by 40 => D = 0
=> "BCD" also divisible by 100 => divisible by 200
=> B E {2, 4, 6, 8} => B = 2 since the other digits have been explicitly excluded
=> AB a multiple of 6 which ends with "2" => AB E {12,42,72}
=> A = 7 since 1 and 4 have been explicitly excluded

The code is 7 2 0 0
 
Top Bottom