2022-01-20 19:30:18 +00:00
|
|
|
---
|
|
|
|
id: 5900f5111000cf542c510023
|
2022-01-22 15:08:20 +00:00
|
|
|
title: '問題 420: 2x2 の正整数行列'
|
2022-01-20 19:30:18 +00:00
|
|
|
challengeType: 5
|
|
|
|
forumTopicId: 302090
|
|
|
|
dashedName: problem-420-2x2-positive-integer-matrix
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
正整数行列とは、要素がすべて正の整数である行列です。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
一部の正整数行列中は、正整数行列の 2 乗として 2 通りに表すことができます。 次に例を示します。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
2022-04-02 08:46:30 +00:00
|
|
|
$$\begin{pmatrix} 40 & 12 \\\\
|
|
|
|
48 & 40 \end{pmatrix}=
|
2022-01-20 19:30:18 +00:00
|
|
|
{\begin{pmatrix}
|
2022-04-02 08:46:30 +00:00
|
|
|
2 & 3 \\\\
|
|
|
|
12 & 2 \end{pmatrix}}^2 =
|
2022-01-20 19:30:18 +00:00
|
|
|
{\begin{pmatrix}
|
2022-04-02 08:46:30 +00:00
|
|
|
6 & 1 \\\\
|
|
|
|
4 & 6 \end{pmatrix}}^2$$
|
2022-01-20 19:30:18 +00:00
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
対角和が N 未満であり、かつ、正整数行列の 2 乗として 2 通りに表せる 2x2 の正整数行列の個数を $F(N)$ とします。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
$F(50) = 7$, $F(1000) = 1019$ であることを確認できます。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
$F({10}^7)$ を求めなさい。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
`positiveIntegerMatrix()` は `145159332` を返す必要があります。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
assert.strictEqual(positiveIntegerMatrix(), 145159332);
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
|
|
|
function positiveIntegerMatrix() {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
positiveIntegerMatrix();
|
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|