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
Source Link

#Goal:

Goal:

Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.

#Example solutions (TI-Basic):

Example solutions (TI-Basic):

  • A+B+1

  • not(A+B)

#Invalid solutions:

Invalid solutions:

  • A+B-1 (for inputs 0,0, it returns -1, which is not natural)

  • "ABC" (ABC is not a number)

#Notes:

Notes:

  • The output must always be a sum of two natural numbers (which is actually just a natural number)

  • -1, undefined, infinity, NaN and Error messages are not natural numbers. For our purposes, 0 is natural (although not all mathematicians agree).

#Goal:

Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.

#Example solutions (TI-Basic):

  • A+B+1

  • not(A+B)

#Invalid solutions:

  • A+B-1 (for inputs 0,0, it returns -1, which is not natural)

  • "ABC" (ABC is not a number)

#Notes:

  • The output must always be a sum of two natural numbers (which is actually just a natural number)

  • -1, undefined, infinity, NaN and Error messages are not natural numbers. For our purposes, 0 is natural (although not all mathematicians agree).

Goal:

Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.

Example solutions (TI-Basic):

  • A+B+1

  • not(A+B)

Invalid solutions:

  • A+B-1 (for inputs 0,0, it returns -1, which is not natural)

  • "ABC" (ABC is not a number)

Notes:

  • The output must always be a sum of two natural numbers (which is actually just a natural number)

  • -1, undefined, infinity, NaN and Error messages are not natural numbers. For our purposes, 0 is natural (although not all mathematicians agree).

Notice removed Reward existing answer by Zach Gates
Bounty Ended with user63187's answer chosen by Zach Gates
Tweeted twitter.com/StackCodeGolf/status/837353220640997376
Notice added Reward existing answer by Zach Gates
Bounty Started worth 50 reputation by Zach Gates
added 60 characters in body
Source Link
Julian Lachniet
  • 3.8k
  • 3
  • 19
  • 33

#Goal:

Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.

#Example solutions (TI-Basic):

  • A+B+1

  • not(A+B)

#Invalid solutions:

  • A+B-1 (for inputs 0,0, it returns -1, which cannot be a sum ofis not natural numbers)

  • "ABC" (ABC is not a number)

#Notes:

  • The output must always be a sum of two natural numbers (which is actually just a natural number)

  • -1, undefined, infinity,NaN and Error messages are not natural numbers. For our purposes, 0 is natural (although not all mathematicians agree).

#Goal:

Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.

#Example solutions (TI-Basic):

  • A+B+1

  • not(A+B)

#Invalid solutions:

  • A+B-1 (for inputs 0,0, it returns -1, which cannot be a sum of natural numbers)

  • "ABC" (ABC is not a number)

#Notes:

  • The output must always be a sum of two natural numbers (which is actually just a natural number)

  • -1, undefined, infinity, and Error messages are not natural numbers.

#Goal:

Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.

#Example solutions (TI-Basic):

  • A+B+1

  • not(A+B)

#Invalid solutions:

  • A+B-1 (for inputs 0,0, it returns -1, which is not natural)

  • "ABC" (ABC is not a number)

#Notes:

  • The output must always be a sum of two natural numbers (which is actually just a natural number)

  • -1, undefined, infinity,NaN and Error messages are not natural numbers. For our purposes, 0 is natural (although not all mathematicians agree).

Negative numbers are denoted with '-', not '~'. Also clarified that "Examples" are example solutions, not sample data; edited tags
Source Link
DJMcMayhem
  • 60.1k
  • 18
  • 203
  • 352

#Goal:

Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.

#Examples#Example solutions (TI-Basic):

  • A+B+1

  • not(A+B)

#Non Examples#Invalid solutions:

  • A+B-1 (for inputs 0,0, it returns ~1-1, which cannot be a sum of natural numbers)

  • "ABC" (ABC is not a number)

#Notes:

  • The output must always be a sum of two natural numbers (which is actually just a natural number)

  • ~1-1, undefined, infinity, and Error messages are not natural numbers.

#Goal:

Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.

#Examples (TI-Basic):

  • A+B+1

  • not(A+B)

#Non Examples:

  • A+B-1 (for inputs 0,0, it returns ~1, which cannot be a sum of natural numbers)

  • "ABC" (ABC is not a number)

#Notes:

  • The output must always be a sum of two natural numbers (which is actually just a natural number)

  • ~1, undefined, infinity, and Error messages are not natural numbers.

#Goal:

Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.

#Example solutions (TI-Basic):

  • A+B+1

  • not(A+B)

#Invalid solutions:

  • A+B-1 (for inputs 0,0, it returns -1, which cannot be a sum of natural numbers)

  • "ABC" (ABC is not a number)

#Notes:

  • The output must always be a sum of two natural numbers (which is actually just a natural number)

  • -1, undefined, infinity, and Error messages are not natural numbers.

deleted 37 characters in body
Source Link
Julian Lachniet
  • 3.8k
  • 3
  • 19
  • 33
Loading
added 1 character in body
Source Link
Julian Lachniet
  • 3.8k
  • 3
  • 19
  • 33
Loading
Source Link
Julian Lachniet
  • 3.8k
  • 3
  • 19
  • 33
Loading

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