

A090925


Permutation of natural numbers arising from a spiral.


6



1, 4, 5, 6, 7, 8, 9, 2, 3, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 10, 11, 12, 13, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 26, 27, 28, 29, 30, 31, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

Write out the natural numbers in a square counterclockwise spiral:
17.16.15.14.13
18..5..4..3.12
19..6..1..2.11
20..7..8..9.10
21.22.23.24.25
Now read off the numbers in a counterclockwise spiral: 1 > 4 > 5 > 6 > 7 > 8 > 9 > 2 > 3 > 14 > etc.


LINKS

Eric M. Schmidt, Table of n, a(n) for n = 1..1000


PROG

(Sage)
def a(n) :
....x = (isqrt(n1)+1)//2
....return n + 2*x if n + 2*x <= (2*x+1)^2 else n  6*x
# Eric M. Schmidt, May 18 2016


CROSSREFS

Cf. A020703, A090861, A090915, A090928, A090929, A090930.
Sequence in context: A239440 A248355 A178053 * A143836 A168094 A089166
Adjacent sequences: A090922 A090923 A090924 * A090926 A090927 A090928


KEYWORD

easy,nonn


AUTHOR

Felix Tubiana (fat2(AT)columbia.edu), Feb 26 2004


EXTENSIONS

Offset corrected by Eric M. Schmidt, May 18 2016


STATUS

approved



