- 50.9k
- 11
- 133
- 364
Description
###Description
ChickenChicken McNugget numbers are numbers that can be expressed as a sum of 6\6ドル\$, 9\9ドル\$ or 20 \20ドル\$- the initial sizes of the famous Chicken McNuggets boxes sold by McDonald's. In that sum, a number may occur more than once, so 6 + 6 = 12\6ドル + 6 = 12\$ is such a number too, and the number must "contain" at least one of the mentioned sizes. The first Chicken McNugget numbers are:
6
9
6 +たす 6 =わ 12
6 +たす 9 =わ 15
9 +たす 9 =わ 6 +たす 6 +たす 6 =わ 18
20
6 +たす 6 +たす 9 =わ 21
...
\begin{align*}&6\\ &9\\ &6 + 6 = 12\\ &6 + 9 = 15\\ &9 +たす 9 =わ 6 +たす 6 +たす 6 =わ 18\\ &20\\ &6 + 6 + 9 = 21\\ &\dots \end{align*}
Challenge
###Challenge YourYour task is to write a program or function, that, given a positive integer, determines whether this number can be expressed in the described way, therefore is such a Chicken McNugget number. It should then output a truthy or falsy value based on its decision. ###Test cases
Test cases
6 -> true
7 -> false
12 -> true
15 -> true
21 -> true
40 -> true
42 -> true
This is code-golf, so the shortest answer in bytes wins and the standard loopholes apply!
###Description
Chicken McNugget numbers are numbers that can be expressed as a sum of 6, 9 or 20 - the initial sizes of the famous Chicken McNuggets boxes sold by McDonald's. In that sum, a number may occur more than once, so 6 + 6 = 12 is such a number too, and the number must "contain" at least one of the mentioned sizes. The first Chicken McNugget numbers are:
6
9
6 +たす 6 =わ 12
6 +たす 9 =わ 15
9 +たす 9 =わ 6 +たす 6 +たす 6 =わ 18
20
6 +たす 6 +たす 9 =わ 21
...
###Challenge Your task is to write a program or function, that, given a positive integer, determines whether this number can be expressed in the described way, therefore is such a Chicken McNugget number. It should then output a truthy or falsy value based on its decision. ###Test cases
6 -> true
7 -> false
12 -> true
15 -> true
21 -> true
40 -> true
42 -> true
This is code-golf, so the shortest answer in bytes wins and the standard loopholes apply!
Description
Chicken McNugget numbers are numbers that can be expressed as a sum of \6ドル\$, \9ドル\$ or \20ドル\$- the initial sizes of the famous Chicken McNuggets boxes sold by McDonald's. In that sum, a number may occur more than once, so \6ドル + 6 = 12\$ is such a number too, and the number must "contain" at least one of the mentioned sizes. The first Chicken McNugget numbers are:
\begin{align*}&6\\ &9\\ &6 + 6 = 12\\ &6 + 9 = 15\\ &9 +たす 9 =わ 6 +たす 6 +たす 6 =わ 18\\ &20\\ &6 + 6 + 9 = 21\\ &\dots \end{align*}
Challenge
Your task is to write a program or function, that, given a positive integer, determines whether this number can be expressed in the described way, therefore is such a Chicken McNugget number. It should then output a truthy or falsy value based on its decision.
Test cases
6 -> true
7 -> false
12 -> true
15 -> true
21 -> true
40 -> true
42 -> true
This is code-golf, so the shortest answer in bytes wins and the standard loopholes apply!
###Description
Chicken McNugget numbers are numbers that can be expressed as a sum of 6, 9 or 20 - the initial sizes of the famous Chicken McNuggets boxes sold by McDonald's. In that sum, a number may occur more than once, so 6 + 6 = 12 is such a number too, and the number must "contain" at least one of the mentioned sizes, therefore, 0 is not a ChickenMc Nugget number. The first Chicken McNugget numbers are:
6
9
6 +たす 6 =わ 12
6 +たす 9 =わ 15
9 +たす 9 =わ 6 +たす 6 +たす 6 =わ 18
20
6 +たす 6 +たす 9 =わ 21
...
###Challenge Your task is to write a program or function, that, given ana positive integer greater than or equal to zero, determines whether this number can be expressed in the described way, therefore is such a Chicken McNugget number. It should then output a truthy or falsy value based on its decision. ###Test cases
0 -> false
6 -> true
7 -> false
12 -> true
15 -> true
21 -> true
40 -> true
42 -> true
This is code-golf, so the shortest answer in bytes wins and the standard loopholes apply!
###Description
Chicken McNugget numbers are numbers that can be expressed as a sum of 6, 9 or 20 - the initial sizes of the famous Chicken McNuggets boxes sold by McDonald's. In that sum, a number may occur more than once, so 6 + 6 = 12 is such a number too, and the number must "contain" at least one of the mentioned sizes, therefore, 0 is not a ChickenMc Nugget number. The first Chicken McNugget numbers are:
6
9
6 +たす 6 =わ 12
6 +たす 9 =わ 15
9 +たす 9 =わ 6 +たす 6 +たす 6 =わ 18
20
6 +たす 6 +たす 9 =わ 21
...
###Challenge Your task is to write a program or function, that, given an integer greater than or equal to zero, determines whether this number can be expressed in the described way, therefore is such a Chicken McNugget number. It should then output a truthy or falsy value based on its decision. ###Test cases
0 -> false
6 -> true
7 -> false
12 -> true
15 -> true
21 -> true
40 -> true
42 -> true
This is code-golf, so the shortest answer in bytes wins and the standard loopholes apply!
###Description
Chicken McNugget numbers are numbers that can be expressed as a sum of 6, 9 or 20 - the initial sizes of the famous Chicken McNuggets boxes sold by McDonald's. In that sum, a number may occur more than once, so 6 + 6 = 12 is such a number too, and the number must "contain" at least one of the mentioned sizes. The first Chicken McNugget numbers are:
6
9
6 +たす 6 =わ 12
6 +たす 9 =わ 15
9 +たす 9 =わ 6 +たす 6 +たす 6 =わ 18
20
6 +たす 6 +たす 9 =わ 21
...
###Challenge Your task is to write a program or function, that, given a positive integer, determines whether this number can be expressed in the described way, therefore is such a Chicken McNugget number. It should then output a truthy or falsy value based on its decision. ###Test cases
6 -> true
7 -> false
12 -> true
15 -> true
21 -> true
40 -> true
42 -> true
This is code-golf, so the shortest answer in bytes wins and the standard loopholes apply!