Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Comment
by
periram
· 3y ago · 0 comments
Also (n+1)^ = n^2 + 2n +1 i.e. you can have the previous square and just add 2n+1 to it to get the next square (which is 3 additions in total). square += i + i + 1 if square < n; break
Comments
No comments yet.
Better HN