Balanced number - MATLAB Cody - MATLAB Central

Problem 74. Balanced number

Difficulty:Rate

Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to the second half.

Examples:

 Input  n = 13722 
 Output tf is true

because 1 + 3 = 2 + 2.

 Input  n = 23567414 
 Output tf = true

All palindrome numbers are balanced.

This is partly from Project Euler, Problem 217.

Solution Stats

53.29% Correct | 46.71% Incorrect
Last Solution submitted on May 13, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers3043

Suggested Problems

More from this Author96

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!