Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-427-n-sequences.chinese.md
Oliver Eyton-Williams 61460c8601 fix: insert blank line after ```
search and replace ```\n< with ```\n\n< to ensure there's an empty line
before closing tags
2020-08-16 04:45:20 +05:30

1.2 KiB
Raw Blame History

id, challengeType, title, videoUrl, localeTitle
id challengeType title videoUrl localeTitle
5900f5181000cf542c51002a 5 Problem 427: n-sequences 问题427n序列

Description

整数序列S = {si}如果具有n个元素则每个元素满足1≤si≤n则称为n序列。 因此总共有nn个不同的n序列。 例如序列S = {1、5、5、10、7、7、7、2、3、7}是10个序列。

对于任何序列S令LS为具有相同值的S的最长连续存在的长度。 例如对于上面给定的序列S由于三个连续的7LS= 3。

对于所有n序列S令fn= ∑ LS

例如f3= 45f7= 1403689和f11= 481496895121。

找出f7,500,000mod 1 000 009。

Instructions

Tests

tests:
  - text: <code>euler427()</code>应该返回97138867。
    testString: assert.strictEqual(euler427(), 97138867);

Challenge Seed

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

euler427();

Solution

// solution required

/section>