mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30

1.3 KiB
Raw Blame History

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f4761000cf542c50ff88 5 false Problem 265: Binary Circles 301914

Description

2N binary digits can be placed in a circle so that all the N-digit clockwise subsequences are distinct.

For N=3, two such circular arrangements are possible, ignoring rotations:

For the first arrangement, the 3-digit subsequences, in clockwise order, are: 000, 001, 010, 101, 011, 111, 110 and 100.

Each circular arrangement can be encoded as a number by concatenating the binary digits starting with the subsequence of all zeros as the most significant bits and proceeding clockwise. The two arrangements for N=3 are thus represented as 23 and 29: 000101112 = 23 000111012 = 29

Calling S(N) the sum of the unique numeric representations, we can see that S(3) = 23 + 29 = 52.

Find S(5).

Instructions

Tests

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

Challenge Seed

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

euler265();

Solution

// solution required