|
Search: id:A065186
|
|
|
| A065186 |
|
a(1) = 1, a(2) = 3, a(3) = 5, a(4) = 2, a(5) = 4, then a(n) = a(n-5)+5. |
|
+0 4
|
|
| 1, 3, 5, 2, 4, 6, 8, 10, 7, 9, 11, 13, 15, 12, 14, 16, 18, 20, 17, 19, 21, 23, 25, 22, 24, 26, 28, 30, 27, 29, 31, 33, 35, 32, 34, 36, 38, 40, 37, 39, 41, 43, 45, 42, 44, 46, 48, 50, 47, 49, 51, 53, 55, 52, 54, 56, 58, 60, 57, 59, 61, 63, 65, 62, 64, 66, 68, 70, 67, 69, 71, 73
(list; graph; listen)
|
|
|
OFFSET
|
1,2
|
|
|
COMMENT
|
"Greedy Dragons" permutation of the natural numbers, inverse of A065187.
This permutation is produced by a simple greedy algorithm: walk along each successive antidiagonal of an infinite array, and place a Shoogi dragon piece (i.e. the "promoted" rook, Ryuu, that moves like a chess rook, but can also move one square diagonally) in the first available position where it is not threatened by any dragon already placed.
I.e. this permutation satisfies the condition that p(i+1) <> p(i)+-1 for all i.
Alternatively, this is obtained directly if n-1 is converted to base 5, the least significant digit is doubled (modulo 5, i.e. 0->0, 1->2, 2->4, 3->1, 4->3) and one is added back to the resulting number.
a(1) = 1, a(n) = smallest number such that no two successive terms differ by 1. - Amarnath Murthy (amarnath_murthy(AT)yahoo.com), May 06 2003
|
|
LINKS
|
Index entries for sequences that are permutations of the natural numbers
|
|
FORMULA
|
a(n) = n + ((n-1) mod 5) - 5*(floor((n-1 mod 5)/3))
G.f.: x*(x^5+2*x^4-3*x^3+2*x^2+2*x+1)/((x-1)*(x^5-1))
|
|
MAPLE
|
[seq(GreedyDragonsDirect(j), j=1..125)]; GreedyDragonsDirect := n -> n + ((n-1) mod 5) - 5*(floor((n-1 mod 5)/3));
Or empirically, by using the algorithm given at A065188: GreedyDragons := upto_n -> PM2PL(GreedyNonThreateningPermutation(upto_n, 1, 1), upto_n);
|
|
CROSSREFS
|
"Greedy Queens" and "Quintal Queens" permutations: A065188, A065257.
Cf. A065186.
Adjacent sequences: A065183 A065184 A065185 this_sequence A065187 A065188 A065189
Sequence in context: A113475 A104807 A131793 this_sequence A081964 A082817 A084753
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
Antti Karttunen Oct 19 2001
|
|
|
Search completed in 0.002 seconds
|