aoc-2023/day_21/solve.md

89 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2024-12-09 22:41:02 +09:00
$26501365 = 65 + 202300 \cdot 131$
```
full fill
even 7769
odd 7780
0,0 start cycle 131 - 65
even 1025
odd 1052
cycle 131 + 65
even 6817
odd 6874
130,0 start cycle 131 - 65
even 1030
odd 1059
cycle 131 + 65
even 6818
odd 6871
0,130 start cycle 131 - 65
even 1017
odd 1041
cycle 131 + 65
even 6805
odd 6853
130,130 start cycle 131 - 65
even 1018
odd 1038
cycle 131 + 65
even 6810
odd 6860
65,0 start cycle 131
even 5965
odd 5866
0,65 start cycle 131
even 5947
odd 5853
130, 65 start cycle 131
even 5951
odd 5859
65,130 start cycle 131
even 5933
odd 5846
```
202300 + 1 + 202300
neq: 202300
eq: 202300
202300-1 + 1 + 202300-1
neq: 202300 - 0 + 1
eq: 202300 - 2 + 0
202300-2 + 1 + 202300-2
neq: 202300 - 2 + 0
eq: 202300 - 2 + 1
202300-3 + 1 + 202300-3
neq: 202300 - 2 + 1
eq: 202300 - 4 + 0
...
202300-n + 1 + 202300-n
neq: 202300-(n - 2(n % 2)) + (n % 2)
eq: 202300
sum:
$$
\text{half sum of neq} = \frac{(202300/2-1)202300/2}{2} \cdot 2 + 202300 + 202300/2
$$
$$
\text{half sum of eq} = \frac{(202300/2-1)2023000/2}{2} \cdot 2 + 202300/2
$$
0, 0, 1 \
1, 1*2 + 2, 1 \
2, 1\*2 + 2, 1 + 3\*2 + 2 \
3, 1\*2 + 2 + 5\*2 + 2 , 1 + 3 \* 2 + 2 \
4, 1\*2 + 2 + 5\*2 + 2 , 1 + 3 \* 2 + 2 + 7 \* 2 + 2\
5,
n