OFFSET
1,2
COMMENTS
It is conjectured that this sequence is not only injective, but also surjective on N, i.e., that it is a true permutation of natural numbers.
See also comments in related A266121.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..12000
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=4, we start testing from the least so far unused number, which is 4, by multiplying it by a(3)*a(2) = 6. Because 6*4 = 24, which has two adjacent 1's in its binary representation "11000", 6 is disqualified. Next we try 5, and 6*5 = "11110", and 5 is also disqualified. Next we try 6, and 6*6 = "100100", with no adjacent 1's, and we have found the least unused number satisfying the required condition, thus we set a(4) = 6.
PROG
(Scheme, with defineperm1-macro from Antti Karttunen's IntSeq-library)
(defineperm1 (A266191 n) (cond ((<= n 3) n) (else (let ((prev1 (A266191 (- n 1))) (prev2 (A266191 (- n 2)))) (let loop ((k 1)) (cond ((and (not-lte? (A266192 k) (- n 1)) (isA003714? (* k prev1 prev2))) k) (else (loop (+ 1 k)))))))))
(define (isA003714? n) (= (* 3 n) (A003987bi n (* 2 n)))) ;; Where A003987bi implements bitwise-XOR (see A003987).
;; 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: A266192 (also the right inverse if this sequence is a permutation of natural numbers).
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Dec 23 2015
STATUS
approved