A368643 Manhattan distance from the origin of triangular number point T(n) = n*(n+1)/2 in a square spiral with point 0 at the origin.
0, 1, 1, 2, 2, 3, 3, 4, 6, 3, 7, 6, 6, 9, 5, 10, 8, 9, 11, 8, 14, 9, 13, 12, 12, 17, 9, 18, 14, 15, 19, 12, 22, 15, 19, 20, 16, 25, 15, 24, 20, 21, 27, 16, 30, 21, 25, 28, 20, 35, 21, 30, 28, 25, 35, 20, 36, 27, 31, 36, 24, 43, 27, 36, 36, 29, 45, 26, 42, 35, 35, 44, 28, 49, 33, 42, 44, 33, 55, 32, 48, 43, 39, 54, 30
Offset: 0
Examples
Showing the Manhattan distance for a(4), that is, from the origin to the fourth triangular number T(4) = 10, as being 2: +----15-----+-----+-----+ + | | | | | | + +-----3-----+ + 28 | | | | | | | | | | + + 0-----1 10 + | | ^---a(4)=2--^ | | | | | + 6-----+-----+-----+ + | | | | +----21-----+-----+-----+-----+
Formula
a(n) = A214526(n*(n+1)/2 + 1).