This transform was described by Leroy Quet in a message to the seqfan mailing list. Let N denote the positive integers. For any permutation p: N -> N, let T(p): N -> N be given by T(p)(n) = # of elements in {m in N | m >= n and p(m) <= p(n)}. Observe that T is a bijection from the set of permutations N -> N onto the set of sequences N -> N that contain infinitely many 1s. Now suppose f: N -> N contains infinitely many 1s; then its Quet transform Q(f): N -> N is T^(-1)[(T(f))^(-1)], which also contains infinitely many 1s. Q is self-inverse; f and Q(f) correspond via T to a permutation and its inverse. Leroy Quet's example: let f be A002260: 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5... then T^(-1)(f) is A065562: 1, 2, 4, 3, 6, 8, 5, 9, 11, 13, 7, 12, 15, 17, 19... The inverse of this permutation is A065579: 1, 2, 4, 3, 7, 5, 11, 6, 8, 16, 9, 12, 10, 22, 13... so Q(f) is A101387: 1, 1, 2, 1, 3, 1, 5, 1, 1, 7, 1, 2, 1, 9, 1... \\ PARI code to compute the Quet transform. Put the first n terms of the sequence \\ into a vector v; then Q(v) returns the transformed sequence. The output is a \\ vector, containing as many terms as can be computed from the given data. TInverse(v) = local(l, w, used, start, x); l = length(v); w = vector(l); used = vector(l); start = 1; for (i = 1, l, while (start <= l && used[start], start++); x = start; for (j = 2, v[i], x++; while (x <= l && used[x], x++)); if (x > l, return (vector(i - 1, k, w[k])), w[i] = x; used[x] = 1)); w; PInverse(v) = local(l, w); l = length(v); w = vector(l); for (i = 1, l, if (v[i] <= l, w[v[i]] = i)); w; T(v) = local(l, w, c); l = length(v); w = vector(l); for (n = 1, l, if (v[n], c = 0; for (m = 1, n - 1, if (v[m] < v[n], c++)); w[n] = v[n] - c, return (vector(n - 1, i, w[i])))); w; Q(v) = T(PInverse(TInverse(v)));