login
A045901
Group the natural numbers into blocks: B_1 = 1, B_2 = 2,3,4, B_3 = 5,6,7,8,9, ..., each block ending in a square. Permute each block B_k by beginning with the central term, followed by the transposed symmetric pairs from B_k.
0
1, 3, 4, 2, 7, 8, 6, 9, 5, 13, 14, 12, 15, 11, 16, 10, 21, 22, 20, 23, 19, 24, 18, 25, 17, 31, 32, 30, 33, 29, 34, 28, 35, 27, 36, 26, 43, 44, 42, 45, 41, 46, 40, 47, 39, 48, 38, 49, 37, 57, 58, 56, 59, 55, 60, 54, 61, 53, 62, 52, 63, 51, 64, 50, 73, 74, 72, 75, 71, 76, 70, 77
OFFSET
1,2
COMMENTS
A permutation of the natural numbers.
LINKS
FORMULA
The k-th term of the n-th block is T(n, k) = n^2-n+1+(-1)^k*floor(k/2), k=1..2*n-1. - Vladeta Jovovic, Jan 16 2004
EXAMPLE
B_4 = 10,11,12,13,14,15,16 becomes 13, 14,12, 15,11, 16,10.
1; 3,4,2; 7,8,6,9,5; 13,14,12,15,11,16,10; ...
MATHEMATICA
pb[c_]:=Module[{len=(Length[c]-1)/2}, Flatten[Join[{c[[len+1]]}, Thread[ {Take[c, -len], Reverse[Take[c, len]]}]]]] ; Flatten[pb/@ Table[Range[ (n-1)^2+1, n^2], {n, 10}]] (* Harvey P. Dale, Jun 18 2015 *)
CROSSREFS
Sequence in context: A255768 A216221 A296431 * A098003 A026245 A266693
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jan 16 2004
EXTENSIONS
More terms from Vladeta Jovovic, Jan 16 2004
STATUS
approved