Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-141-investigating-progressive-numbers-n-which-are-also-square.md

1.1 KiB
Raw Permalink Blame History

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f3f91000cf542c50ff0b 问题 141累进平方数 n 5 301770 problem-141-investigating-progressive-numbers-n-which-are-also-square

--description--

一个正整数 n 除以 d 后得到商 q 和余数 $r$。 同时 $d$qr 是一个等比数列中三个连续的正整数项,但顺序不要求一致。

例如58 除以 6 后得到商 9 和余数 4。 可以发现4、6、9 构成一个等比数列的连续三项(公比为 $\frac{3}{2}$)。

我们称这样的数字 n 为累进数。

一些累进数,如 9 和 10404 = ${102}^2$,同时也是完全平方数。 所有小于十万的累进平方数之和为 124657。

请求出所有小于一万亿(${10}^{12}$)累进平方数之和。

--hints--

progressivePerfectSquares() 应该返回 878454337159

assert.strictEqual(progressivePerfectSquares(), 878454337159);

--seed--

--seed-contents--

function progressivePerfectSquares() {

  return true;
}

progressivePerfectSquares();

--solutions--

// solution required