DOJ logoDOJ
Problems
Recently added problemsSaved problems
CategoriesDLCContestsGroupsTeamsBoard
Ranking
Solved Problem RankingStreak rankingDOJ Power ranking
Status
Call for TasksLoginRegister
DOJ logoDOJ

Community online judge with OI-style subtask scoring, Elo ratings, and Discord-backed certification.

Problems
ProblemsCategories
Community
ContestsRankingBoardNoticesHost an external contestGuide
Account
LoginRegisterJudge Status
Policy
Terms of ServiceDLC RulesPrivacyAPI documentationLanguage runtimesContest rank rewardsRating and performance
© 2026 DOJ
All rights reserved
Editorial

Permutation of the Year 2

Back to problem

Editorial

Print the following permutation.

1,2026,3,2024,5,2022,…,2025,21,2026,3,2024,5,2022,\ldots,2025,21,2026,3,2024,5,2022,…,2025,2

Equivalently, for every integer kkk (0≤k≤10120 \leq k \leq 10120≤k≤1012), print 2k+12k+12k+1 and then 2026−2k2026-2k2026−2k.

For every kkk, we have (2k+1)+(2026−2k)=2027(2k+1)+(2026-2k)=2027(2k+1)+(2026−2k)=2027. Also, for 0≤k<10120 \leq k < 1012, we have . Finally, .

The numbers 202720272027, 202920292029, and 333 are all prime, so every adjacent cyclic sum is prime. The odd numbers 1,3,…,20251,3,\ldots,20251,3,…,2025 and the even numbers 2026,2024,…,22026,2024,\ldots,2 are each used exactly once, so the printed sequence is a permutation of .

Solution written by GPT5.5

0≤
k<
1012
(2026−2k)+(2k+3)=2029(2026-2k)+(2k+3)=2029(2026−2k)+(2k+3)=2029
2+1=32+1=32+1=3
2026
,
2024
,
…
,
2
(1,2,⋯ ,2026)(1,2,\cdots,2026)(1,2,⋯,2026)