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 Answer

edited body
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Jelly, 11 bytes

ṗ3’æ."©μÞ‘ċ

Try it online!

How it works

ṗ3’æ."©μÞ‘ċ Main link. Argument: n
ṗ3 Cartesian power; yield all 3-tuples over [1, ..., n].
 ’ Decrement all coordinates.
 "©μÞ‘ Yield [3[6, 69, 20].
 æ. Take the dot product of each 3-tuple and [3[6, 69, 20].
 ċ Count the occurrences of n (Positive for Chicken McNuggets numbers).

Jelly, 11 bytes

ṗ3’æ."©μÞ‘ċ

Try it online!

How it works

ṗ3’æ."©μÞ‘ċ Main link. Argument: n
ṗ3 Cartesian power; yield all 3-tuples over [1, ..., n].
 ’ Decrement all coordinates.
 "©μÞ‘ Yield [3, 6, 20].
 æ. Take the dot product of each 3-tuple and [3, 6, 20].
 ċ Count the occurrences of n (Positive for Chicken McNuggets numbers).

Jelly, 11 bytes

ṗ3’æ."©μÞ‘ċ

Try it online!

How it works

ṗ3’æ."©μÞ‘ċ Main link. Argument: n
ṗ3 Cartesian power; yield all 3-tuples over [1, ..., n].
 ’ Decrement all coordinates.
 "©μÞ‘ Yield [6, 9, 20].
 æ. Take the dot product of each 3-tuple and [6, 9, 20].
 ċ Count the occurrences of n (Positive for Chicken McNuggets numbers).
added 379 characters in body
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Jelly, 11 bytes

ṗ3’æ."©μÞ‘ċ

Try it online! Try it online!

How it works

ṗ3’æ."©μÞ‘ċ Main link. Argument: n
ṗ3 Cartesian power; yield all 3-tuples over [1, ..., n].
 ’ Decrement all coordinates.
 "©μÞ‘ Yield [3, 6, 20].
 æ. Take the dot product of each 3-tuple and [3, 6, 20].
 ċ Count the occurrences of n (Positive for Chicken McNuggets numbers).

Jelly, 11 bytes

ṗ3’æ."©μÞ‘ċ

Try it online!

Jelly, 11 bytes

ṗ3’æ."©μÞ‘ċ

Try it online!

How it works

ṗ3’æ."©μÞ‘ċ Main link. Argument: n
ṗ3 Cartesian power; yield all 3-tuples over [1, ..., n].
 ’ Decrement all coordinates.
 "©μÞ‘ Yield [3, 6, 20].
 æ. Take the dot product of each 3-tuple and [3, 6, 20].
 ċ Count the occurrences of n (Positive for Chicken McNuggets numbers).
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Jelly, 11 bytes

ṗ3’æ."©μÞ‘ċ

Try it online!

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