OFFSET
1,2
COMMENTS
Equally: always choose for a(n) the least unused number such that a(n)*a(n-1) = A057889(A057889(a(n)) * A057889(a(n-1))).
Note that the adjacent terms of permutation A266195 satisfy the same condition, except that permutation is not the lexicographically earliest sequence of this kind (because it has a more restrictive condition). See A266194.
This is a bijection for the same reason that A266195 is. Any high enough 2^k will always save the permutation of being stuck, and will also immediately pick up as its succeeding pair the least term unused so far.
LINKS
PROG
(Scheme, with defineperm1-macro from Antti Karttunen's IntSeq-library)
(defineperm1 (A266351 n) (cond ((= 1 n) n) (else (let ((prev (A266351 (- n 1)))) (let loop ((k 1)) (cond ((and (not-lte? (A266352 k) (- n 1)) (= (A057889 (* k prev)) (* (A057889 k) (A057889 prev)))) k) (else (loop (+ 1 k)))))))))
;; We consider a > b (i.e. not less than b) also in case a is #f.
;; (Because of the stateful caching system used by defineperm1-macro):
(define (not-lte? a b) (cond ((not (number? a)) #t) (else (> a b))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Dec 28 2015
STATUS
approved