Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Question

Commonmark migration; Mathjax
Source Link

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 , 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 , 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 , so the shortest answer in bytes wins and the standard loopholes apply!

edited tags
Link
Tweeted twitter.com/StackCodeGolf/status/886816326391545856
Took 0 out of the domain
Source Link
racer290
  • 1.1k
  • 7
  • 23

###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 , 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 , 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 , so the shortest answer in bytes wins and the standard loopholes apply!

Loading
Add exclusion of 0
Source Link
racer290
  • 1.1k
  • 7
  • 23
Loading
Zero-integer stuff
Source Link
racer290
  • 1.1k
  • 7
  • 23
Loading
Source Link
racer290
  • 1.1k
  • 7
  • 23
Loading

AltStyle によって変換されたページ (->オリジナル) /