Hard to tell how fast that is, at least there is no looping:
A = [1,3;11,13;31,33;41,42;51,54;55,57;71,72];
%// prepare A
A = A.';
%// create index matrix
idx = bsxfun(@plus, A, [0; 1]);
%// special case: 54 and 55 are basically superfluous
%// need to be removed, but 71 and 72 shouldn't
A = A(:);
dA = diff(A); dA(1:2:end) = 0;
idx = idx(~( [0;dA] == 1 | [dA;0] == 1 ));
%// create mask
mask = zeros(max(A),1);
mask(idx(:)) = (-1).^(0:numel(idx)-1);
%// index vector
out = find(cumsum(mask))
out.' =
1 2 3 11 12 13 31 32 33 41 42 51 52 53 54 55 56 57 71 72