OFFSET
1,2
COMMENTS
After a(1) = 1, always choose for a(n+1) the least unused k such that in factorial base representation (A007623), the product a(n)*a(n+1) will not show any of the nonzero digits present twice (or more times), regardless of the positions of the digits.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..14641
Eric Angelini, a(n)*a(n+1) shows at least twice the same digit, Posting on SeqFan-list Dec 21 2015. [Source of inspiration for this sequence.]
EXAMPLE
For n = 6, we start searching from the least not yet used number in range a(1) .. a(5) [which is 6, because all the previous terms are fixed] for the first number whose product with a(5) = 5 results a number in A265349.
Multiplying 5 (in factorial base "21") with 6 (in factorial base "100") results 30, which in factorial base is "1100", containing digit "1" twice, thus 6 is disqualified.
Similarly, products 5*7, 5*8 and 5*9 result 35 = "1121", 40 = "1220" and 45 = "1311", where in all cases one of the nonzero digits occur more than once, so 7, 8 and 9 are also all disqualified.
But 5*10 = 50, which has a factorial base representation ("2010") that matches the criterion, thus a(6) = 10.
PROG
(Scheme, with defineperm1-macro from Antti Karttunen's IntSeq-library)
;; Reference-implementation, quite sub-optimal:
(defineperm1 (A266117 n) (if (= 1 n) n (let ((prev (A266117 (- n 1)))) (let loop ((k 1)) (cond ((and (not-lte? (A266118 k) (- n 1)) (= (A264990 (* k prev)) 1)) 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
Left inverse: A266118 (also the right inverse if this sequence is a permutation of the positive integers).
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Dec 22 2015
STATUS
approved