Skip to main content
edited title
Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92

Triple-balanced numbers!

Post Reopened by racer290, Mr. Xcoder, totallyhuman, Downgoat, musicman523
added 2 characters in body
Source Link
racer290
  • 1.1k
  • 7
  • 22

###Description We consider an integer with at least 3 digits triple-balanced if, when split ininto three parts, the digits in every part sum up to the same number. We split numbers as follows:

abcdefghi - Standard case: the number of digits is divisable through 3:
abc def ghi

abcdefgh - Number % 3 == 2: The outer groups are both assigned another digit
abc de fgh (the inner group will have one digit less than both outer groups)

abcdefghij - Number % 3 == 1: The inner group is assigned the extra digit
abc defg hij (the inner group will have one digit more than the outer groups)

###Challenge Your task is to write a program, that, given an integer with at least 3 digits, determines whether the given number is triple-balanced and outputs a truthy or falsy value based on it's result. ###Test cases

333 -> True
343 -> False
3123 -> True
34725 -> True
456456 -> False
123222321 -> True

This is , so standard loopholes apply and may the shortest answer in bytes win!

###Description We consider an integer with at least 3 digits triple-balanced if, when split in three parts, the digits in every part sum up to the same number. We split numbers as follows:

abcdefghi - Standard case: the number of digits is divisable through 3:
abc def ghi

abcdefgh - Number % 3 == 2: The outer groups are both assigned another digit
abc de fgh (the inner group will have one digit less than both outer groups)

abcdefghij - Number % 3 == 1: The inner group is assigned the extra digit
abc defg hij (the inner group will have one digit more than the outer groups)

###Challenge Your task is to write a program, that, given an integer with at least 3 digits, determines whether the given number is triple-balanced and outputs a truthy or falsy value based on it's result. ###Test cases

333 -> True
343 -> False
3123 -> True
34725 -> True
456456 -> False
123222321 -> True

This is , so standard loopholes apply and may the shortest answer in bytes win!

###Description We consider an integer with at least 3 digits triple-balanced if, when split into three parts, the digits in every part sum up to the same number. We split numbers as follows:

abcdefghi - Standard case: the number of digits is divisable through 3:
abc def ghi

abcdefgh - Number % 3 == 2: The outer groups are both assigned another digit
abc de fgh (the inner group will have one digit less than both outer groups)

abcdefghij - Number % 3 == 1: The inner group is assigned the extra digit
abc defg hij (the inner group will have one digit more than the outer groups)

###Challenge Your task is to write a program, that, given an integer with at least 3 digits, determines whether the given number is triple-balanced and outputs a truthy or falsy value based on it's result. ###Test cases

333 -> True
343 -> False
3123 -> True
34725 -> True
456456 -> False
123222321 -> True

This is , so standard loopholes apply and may the shortest answer in bytes win!

Edit test cases
Source Link
racer290
  • 1.1k
  • 7
  • 22

###Description We consider an integer with at least 3 digits triple-balanced if, when split in three parts, the digits in every part sum up to the same number. We split numbers as follows:

abcdefghi - Standard case: the number of digits is divisable through 3:
abc def ghi

abcdefgh - Number % 3 == 2: The outer groups are both assigned another digit
abc de fgh (the inner group will have one digit less than both outer groups)

abcdefghij - Number % 3 == 1: The inner group is assigned the extra digit
abc defg hij (the inner group will have one digit more than the outer groups)

###Challenge Your task is to write a program, that, given an integer with at least 3 digits, determines whether the given number is triple-balanced and outputs a truthy or falsy value based on it's result. ###Test cases

333 -> True
343 -> False
3123 -> True
45645634725 -> True
123456316284456456 -> False
123222321 -> True

This is , so standard loopholes apply and may the shortest answer in bytes win!

###Description We consider an integer with at least 3 digits triple-balanced if, when split in three parts, the digits in every part sum up to the same number. We split numbers as follows:

abcdefghi - Standard case: the number of digits is divisable through 3:
abc def ghi

abcdefgh - Number % 3 == 2: The outer groups are both assigned another digit
abc de fgh (the inner group will have one digit less than both outer groups)

abcdefghij - Number % 3 == 1: The inner group is assigned the extra digit
abc defg hij (the inner group will have one digit more than the outer groups)

###Challenge Your task is to write a program, that, given an integer with at least 3 digits, determines whether the given number is triple-balanced and outputs a truthy or falsy value based on it's result. ###Test cases

333 -> True
343 -> False
3123 -> True
456456 -> True
123456316284 -> True

This is , so standard loopholes apply and may the shortest answer in bytes win!

###Description We consider an integer with at least 3 digits triple-balanced if, when split in three parts, the digits in every part sum up to the same number. We split numbers as follows:

abcdefghi - Standard case: the number of digits is divisable through 3:
abc def ghi

abcdefgh - Number % 3 == 2: The outer groups are both assigned another digit
abc de fgh (the inner group will have one digit less than both outer groups)

abcdefghij - Number % 3 == 1: The inner group is assigned the extra digit
abc defg hij (the inner group will have one digit more than the outer groups)

###Challenge Your task is to write a program, that, given an integer with at least 3 digits, determines whether the given number is triple-balanced and outputs a truthy or falsy value based on it's result. ###Test cases

333 -> True
343 -> False
3123 -> True
34725 -> True
456456 -> False
123222321 -> True

This is , so standard loopholes apply and may the shortest answer in bytes win!

Post Closed as "Needs details or clarity" by Magic Octopus Urn, Stephen, Mr. Xcoder, totallyhuman, ZaMoC
Source Link
racer290
  • 1.1k
  • 7
  • 22
Loading