Back to listPython
Lantern Steps Sum
Lv.266@DevType ⌨️0 playsApr 27, 2026
A lantern path has steps 1..n. Add odd steps normally, but even steps as squares. Print the glowing total for n=7.
preview.python
1n=72s=03for i in range(1,n+1):4 if i%2==0:s+=i*i5 else:s+=i6print(s)Custom problems are not included in rankings