login
a(n) is the Manhattan distance between n and n^2 in a square spiral of positive integers with 1 at the center.
4

%I #13 Aug 17 2018 11:01:55

%S 0,2,2,2,6,4,6,8,6,12,8,12,12,12,16,12,20,14,20,18,20,22,20,26,20,30,

%T 22,30,26,30,30,30,34,30,38,30,42,32,42,36,42,40,42,44,42,48,42,52,42,

%U 56,44,56,48,56,52,56,56,56,60,56,64,56,68,56,72,58,72,62,72,66

%N a(n) is the Manhattan distance between n and n^2 in a square spiral of positive integers with 1 at the center.

%C Spiral begins:

%C .

%C 49 26--27--28--29--30--31

%C | | |

%C 48 25 10--11--12--13 32

%C | | | | |

%C 47 24 9 2---3 14 33

%C | | | | | | |

%C 46 23 8 1 4 15 34

%C | | | | | |

%C 45 22 7---6---5 16 35

%C | | | |

%C 44 21--20--19--18--17 36

%C | |

%C 43--42--41--40--39--38--37

%C .

%C Numbers n such that a(n)=n: 2, 8, 12, 22, 30, 44, 56, 74, 90, 112, 132, 158, 182, 212, 240, 274, 306, 344, 380, 422, ... That is, 2 * A084263.

%Y Cf. A000290, A084263, A214526, A232113, A232115.

%K nonn

%O 1,2

%A _Alex Ratushnyak_, Nov 19 2013