Mathematics × Programming Competition #5

^{Designed by @nicolemoker}

26/8/2017 UTC 17:00 - 2/9/2017 UTC 17:00

*For Chinese version please scroll to the bottom. 中文版請見文末。*

## Question

Complete the 4 × 4 puzzle above using the numbers 1 to 16 without repetition, subject to the following constraints:

- A, B, J, K can only be filled with the numbers 2, 4, 6 or 8
- E + F = 26
- K + O = 9
- B + K = 14
- A + L = 9
- C + I = 25
- A + G = 13
- C + P = 24
- B + M = 9
- A + K = 12
- D + E = 25
- | E - N | = 4

Answer submission

Please submit your answer through this link. Type your answer as a list of numbers from A to P separated by commas, for example “1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16”.

Rules

- This competition will last for 7 days. After that, no more submission will be accepted.
- Participants who submit the answer as a comment below this post will be
**disqualified**. - Participants can submit an unlimited number of solutions, however only the latest answer will be considered.
- You have to upvote this post in order to be eligible for the competition.

Prizes

- Prize pool balance carried forward = 0 SBD
- SBD payout of this post will be added to the prize pool.
- The
**first 3 participants**plus**5 randomly chosen participants**who gave the correct numerical answer will share the prize pool equally. Thanks to @steemstem who kindly sponsored this competition, the**first, second and third**participants who gave the correct numerical answer will get additional**7.5, 5 and 2.5 Steem**respectively! - Those who
**resteemed**this post will have 400% higher chance to win in the lucky draw! - If not all prizes are given out, they will be accumulated for the next competition.
- @kenchung reserves all the rights to disqualify any suspected cheating players and to decide the distribution of prizes among the winner(s).

The steemSTEM project (@steemstem) is a community-supported project aiming to increase the quality and the visibility of STEM (STEM is the acronym for Science, Technology, Engineering and Mathematics) articles on Steemit. Please support steemSTEM by following @steemstem, joining the chat channel and following the curation trail on Streemian! In order to further promote the use of the chat channel, I will stop announcing the time of next competition via a post. Instead I will announce the time in advance in the chat channel!

數學 × 程式編寫比賽 (第五回)

^{Designed by @nicolemoker}

26/8/2017 UTC 17:00 - 2/9/2017 UTC 17:00

## 問題

以1至16完成以上之4 × 4 拼圖，數字不能重覆，並需符合以下限制：

- A, B, J, K 只可由 2, 4, 6, 8 四個數字填上
- E + F = 26
- K + O = 9
- B + K = 14
- A + L = 9
- C + I = 25
- A + G = 13
- C + P = 24
- B + M = 9
- A + K = 12
- D + E = 25
- | E - N | = 4

答案提交

請經此連結提交答案。請將你的答案由A至P順序列出並以逗號分隔，例如 “1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16”。

規則

- 此比賽為時7天，其後將不會再接受新答案。
- 嚴禁在回覆公開答案，否則將被取消資格。
- 參加者可以重覆提交答案，但比賽終結時只會考慮最後提交的答案。
- 你必須upvote此帖方能參加比賽。

獎品

- 累積獎池現為 0 SBD。
- 此帖文的 SBD 金額將會加入獎池。
- 首三名以及另外五名隨機抽出並給出正確數字答案的參賽者將平分獎池。
- 另外感謝 @steemstem 的贊助，首三名給出正確數字答案的參賽者將獲得額外的 7.5, 5 及2.5 Steem!
- Resteem此帖文者將有額外400％的得獎機會！
- 若有獎金未被發放，將累積至下一次比賽的獎池。
- 本人保留一切最終權利，包括但不限於取消任何疑似作弊者的資格並決定獲獎者的獎勵分配。

steemSTEM（@steemstem）是一個由steemit社群支持的項目，旨在宣傳STEM（STEM是科學，技術，工程和數學的首字母縮略詞）。 請通過以下方式來支持steemSTEM：追蹤@steemSTEM，加入聊天頻道和加入Streemian！為了進一步推廣聊天頻道的使用，我將不再透過發文來宣布下一場比賽的時間，我會在聊天頻道中提前公佈比賽時間！

justyy (70)· 8 months agovoted, resteeeeemed and correct answer submitted... like last time :P

kenchung (63)· 8 months agowish that you can win again! :P

justyy (70)· 8 months agoSolution: https://steemit.com/cn/@justyy/bruteforce-solution-to-mathematics-programming-competition-5

kenchung (63)· 8 months agoGreat, I will include your answer in my next post! Thanks :)

firstamendment (52)· 8 months agoDid it by hand (or at least I think I did), but I wonder if taking the time to write out code and executing it would have been quicker. naturally for loops tend to be wasteful, but there are ways to optimize it using the rules.

tzs (41)· 8 months agoSame. I solved it manually in a few minutes. This question is not challenging at all.

kenchung (63)· 8 months agowow that's really quick!

whd (60)· 8 months agoI will give you a little hint about tools you should use. Take a look on prolog programming language which is great for constraint logic programming :)

ghyassine (10)· 8 months agoFollow me and upvote my post , why ? because i'll do the same

https://steemit.com/life/@ghyassine/follow-me-and-upvote-my-post-why-because-i-ll-do-the-same

nomanijaz (39)· 8 months agoExcellent post..

tking77798 (59)· 8 months agoSubmitted. Hope I got it right this time!

kenchung (63)· 8 months agoThanks for joining!

ratticus (56)· 8 months agoNice and relatively simple logic puzzle. Entered and upvoted

kenchung (63)· 8 months agogreat!

jamhuery (61)· 8 months agoIs it Valid Number ?

firstamendment (52)· 8 months agothe answer is looking for a list of numbers separated by commas. So, yes, it is a [list of] valid number[s]. Not sure if you need quotes or not.

ionlysaymeep (49)· 8 months agomeep

firstamendment (52)· 8 months ago@ionlysaymeep you can only leave your answer through the link, do not post your answer here even if it is meep which isn't a valid number.

ionlysaymeep (49)· 8 months agomeep

pizzachain (55)· 8 months ago| E - N |

What does that mean??? Is it just normal E - N or what else could it mean???kenchung (63)· 8 months agothat's the absolute sign, a mathematical symbol

pizzachain (55)· 8 months agothat is?

kenchung (63)· 8 months agoit turns negative values to positive. e.g. | -2 | = 2, | 3 | = 3

for more properties of this function you may try to google it

pizzachain (55)· 8 months agoAhhhh Thanks!

cauchycauchy (26)· 8 months agoThank you for the contest! Since I graduated a year ago I don't do many logical thinking problems anymore so this was super fun for me! 😊

kenchung (63)· 8 months agoglad that you enjoy it! :)

yenipaola (58)· 8 months agoExcellent contest, and send my answer, @kenchung

kenchung (63)· 8 months agogreat, thanks for joining!

yenipaola (58)· 8 months agoI hope to stay in the finalists, the numbers are my passion @kenchung

alanman (53)· 8 months agoSomeone got it done in minutes?? Not me. Took me about an hour or two.

Submitted answer, upvoted, and resteemed. :)

kenchung (63)· 8 months agoye I dun think I can do this in minutes too! Never mind the good news is you still got the answer eventually :)

armandocat (63)· 8 months agoI solved the problem using prolog 😼

Happy to provide the code once the competition ends!

Submitted answer, upvoted, and resteemed.

🐾

kenchung (63)· 8 months agogreat, please do provide your code after the competition ends! I have heard of prolog but forgot how to write already haha

armandocat (63)· 8 months agoHi, I posted my prolog solution to the problem as promised 😼

https://steemit.com/contest/@armandocat/mathematics-programming-competition-5-prolog-solution

Hope you like it! If you can, please help spread my post to others. I'd like to do this even for future contents if you think this could be a good idea for the people that read and try out these problems.

Thanks

Armando

🐾

kenchung (63)· 8 months agoGreat thanks! I will include your solution in my next post. A very well-written post!

misalen (56)· 8 months agoLove mathematics and problems. Glad that I come across that post. Excellent idea. After like a 15 minutes I participated. :D

Greetings from Turkey!!

kenchung (63)· 8 months agoHi there! :) So glad to see this competition has reached the other side of the world haha

Best of luck, wish you can win!