Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
##Seriously, 12 bytes
,R;Rεj≈@εj≈+
Try it online!
Explanation:
,R;Rεj≈@εj≈+ ,R; push two copies of range(1, input()+1) R reverse one copy εj≈@εj≈ concatenate both and cast both to ints + add
##Seriously, 1912 bytes
,R;R`$`MΣ@`$`MΣ≈@≈+R;Rεj≈@εj≈+
Try it online!Try it online!
Explanation will come after more golfing:
##Seriously, 19 bytes
,R;R`$`MΣ@`$`MΣ≈@≈+
Explanation will come after more golfing