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！為了進一步推廣聊天頻道的使用，我將不再透過發文來宣布下一場比賽的時間，我會在聊天頻道中提前公佈比賽時間！

justyy68 · 2 months agovoted, resteeeeemed and correct answer submitted... like last time :P

kenchung62 · 2 months agowish that you can win again! :P

justyy68 · 2 months agoSolution: https://steemit.com/cn/@justyy/bruteforce-solution-to-mathematics-programming-competition-5

kenchung62 · 2 months agoGreat, I will include your answer in my next post! Thanks :)

firstamendment51 · 2 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.

tzs41 · 2 months agoSame. I solved it manually in a few minutes. This question is not challenging at all.

kenchung62 · 2 months agowow that's really quick!

whd49 · 2 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 :)

ghyassine23 · 2 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

nomanijaz39 · 2 months agoExcellent post..

tking7779856 · 2 months agoSubmitted. Hope I got it right this time!

kenchung62 · 2 months agoThanks for joining!

ratticus54 · 2 months agoNice and relatively simple logic puzzle. Entered and upvoted

kenchung62 · 2 months agogreat!

jamhuery60 · 2 months agoIs it Valid Number ?

firstamendment51 · 2 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.

ionlysaymeep49 · 2 months agomeep

firstamendment51 · 2 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.

ionlysaymeep49 · 2 months agomeep

pizzachain51 · 2 months ago| E - N |

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

pizzachain51 · 2 months agothat is?

kenchung62 · 2 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

pizzachain51 · 2 months agoAhhhh Thanks!

cauchycauchy26 · 2 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! 😊

kenchung62 · 2 months agoglad that you enjoy it! :)

yenipaola51 · 2 months agoExcellent contest, and send my answer, @kenchung

kenchung62 · 2 months agogreat, thanks for joining!

yenipaola51 · 2 months agoI hope to stay in the finalists, the numbers are my passion @kenchung

alanman51 · 2 months agoSomeone got it done in minutes?? Not me. Took me about an hour or two.

Submitted answer, upvoted, and resteemed. :)

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

armandocat63 · 2 months agoI solved the problem using prolog 😼

Happy to provide the code once the competition ends!

Submitted answer, upvoted, and resteemed.

🐾

kenchung62 · 2 months agogreat, please do provide your code after the competition ends! I have heard of prolog but forgot how to write already haha

armandocat63 · 2 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

🐾

kenchung62 · 2 months agoGreat thanks! I will include your solution in my next post. A very well-written post!

misalen56 · 2 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!!

kenchung62 · 2 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!