OFFSET
1,1
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
MATHEMATICA
fibbinaryQ[n_] := BitAnd[n, 2 n]==0; a[1]=3; a[n_] := a[n] = For[k=1, True, k++, If[Mod[k, 4] != 1, If[fibbinaryQ[a[n-1] k], If[FreeQ[Array[a, n-1], k], Return[k]]]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Mar 02 2016 *)
PROG
(Scheme, with defineperm1-macro from Antti Karttunen's IntSeq-library)
(defineperm1 (A269363 n) (cond ((= 1 n) 3) (else (let ((prev (A269363 (- n 1)))) (let loop ((k 1)) (cond ((and (not-lte? (A269363inv_cache k) (- n 1)) (isa003714? (* k prev))) k) (else (loop (+ 1 k)))))))))
(define (A269363inv_cache n) (A269363 (- n)))
;; 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))))
(define (isA003714? n) (= (* 3 n) (A003987bi n (* 2 n)))) ;; Where A003987bi implements bitwise-XOR (see A003987).
CROSSREFS
KEYWORD
AUTHOR
Antti Karttunen, Feb 25 2016
STATUS
approved