Files
freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-217-balanced-numbers.english.md
Oliver Eyton-Williams f1c9b08cf3 fix(curriculum): add isHidden: false to challenges
This includes certificates (where it does nothing), but does not
include any translations.
2020-05-25 16:25:19 +05:30

1.1 KiB

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f4461000cf542c50ff58 5 false Problem 217: Balanced Numbers 301859

Description

A positive integer with k (decimal) digits is called balanced if its first ⌈k/2⌉ digits sum to the same value as its last ⌈k/2⌉ digits, where ⌈x⌉, pronounced ceiling of x, is the smallest integer ≥ x, thus ⌈π⌉ = 4 and ⌈5⌉ = 5. So, for example, all palindromes are balanced, as is 13722. Let T(n) be the sum of all balanced numbers less than 10n. Thus: T(1) = 45, T(2) = 540 and T(5) = 334795890. Find T(47) mod 315

Instructions

Tests

tests:
  - text: <code>euler217()</code> should return 6273134.
    testString: assert.strictEqual(euler217(), 6273134);

Challenge Seed

function euler217() {
  // Good luck!
  return true;
}

euler217();

Solution

// solution required