A381457 Integers encoding the recursive structure of a bitonic sorter network of n elements in their binary expansion.
0, 2, 5, 2762, 22325, 175338, 1405781, 187796017958058, 12026023042822997, 768764969792360106, 49208135664973067605, 3148398007269257431722, 201504853864147844281685, 12895366188400224861219498, 825310989999256684769531221
Offset: 1
Examples
n | k | i | Comparator network (1 = \ and 0 = /). | a(n) ---+----+---------------------+---------------------------------------+---------------- 2 | 2 | 10 | \/ | 2 ---+----+---------------------+---------------------------------------+---------------- 4 | 2 | 1010 | \/ \/ | 2762 | 4 | 1100 | \ / | | 4 | 1010 | \/ \/ | ---+----+---------------------+---------------------------------------+---------------- 8 | 2 | 1010 1010 | \/ \/ \/ \/ | 187796017958058 | 4 | 1100 1100 | \ / \ / | | 4 | 1010 1010 | \/ \/ \/ \/ | | 8 | 1111 0000 | \ / | | 8 | 1100 1100 | \ / \ / | | 8 | 1010 1010 | \/ \/ \/ \/ For n = 5 the network is similar to the network for n = 4 plus a column of ones, which is also a network contained in the network for n = 8. 5 | 2 | 1010 1 | \/ \/ \ | 22325 | 4 | 1100 1 | \ / \ | | 4 | 1010 1 | \/ \/ \ |
Links
- K. E. Batcher, Sorting networks and their applications, AFIPS '68 (Spring): Proceedings of the April 30--May 2, 1968, Spring Joint Computer Conference, Pages 307 - 314.
- Wikipedia, Bitonic sorter
Programs
-
Python
def a(n): e, k = 0, 2 while k <= n: j = k >> 1 while j > 0: for i in range(n): e = (e << 1) | ((i & j) == 0) j >>= 1 k <<= 1 return e print([a(n) for n in range(1,16)])
Comments