cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A266405 Start with a(1) = 1, then always choose for a(n) the least unused number such that A002487(a(n)*a(n-1)) = A002487(a(n)) * A002487(a(n-1)), where A002487 is Stern-Brocot sequence.

This page as a plain text file.
%I A266405 #16 Jun 10 2021 22:32:27
%S A266405 1,2,3,4,5,7,8,6,9,10,14,16,11,17,13,12,18,15,26,24,23,19,32,20,28,34,
%T A266405 22,27,33,29,31,25,45,49,36,30,52,48,35,64,21,69,42,128,37,256,38,46,
%U A266405 66,54,41,83,82,108,44,39,88,68,56,40,55,65,47,130,59,96,51,192,70,72,60,104,71,80,57,63,61,126,98,90,50,62,58,124,100,121,127
%N A266405 Start with a(1) = 1, then always choose for a(n) the least unused number such that A002487(a(n)*a(n-1)) = A002487(a(n)) * A002487(a(n-1)), where A002487 is Stern-Brocot sequence.
%C A266405 This is a permutation of natural numbers for the same reason that A266195 and A266351 are. If nothing else works for the value of next a(n), then at least the next unused power of 2 will save the sequence from dying, and will also immediately pick up as its succeeding pair the least term not used so far. This follows because A002487(2^m) = 1 and A002487(2^m * n) = A002487(n) for all n and m.
%C A266405 Still, it would be nice to know when 149 will appear in the sequence.
%H A266405 Antti Karttunen, <a href="/A266405/b266405.txt">Table of n, a(n) for n = 1..2016</a>
%H A266405 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%o A266405 (Scheme, with defineperm1-macro from Antti Karttunen's IntSeq-library)
%o A266405 (defineperm1 (A266405 n) (cond ((= 1 n) n) (else (let ((prev (A266405 (- n 1)))) (let loop ((k 1)) (cond ((and (not-lte? (A266406 k) (- n 1)) (= (A002487 (* k prev)) (* (A002487 k) (A002487 prev)))) k) (else (loop (+ 1 k)))))))))
%o A266405 (define (A266406 n) (A266405 (- n))) ;; This returns inverse values of A266405 from its hidden cache that defineperm1-macro has prepared. #f is returned for those n that have not yet been encountered.
%o A266405 ;; We consider a > b (i.e. not less than b) also in case a is #f.
%o A266405 ;; (Because of the stateful caching system used by defineperm1-macro):
%o A266405 (define (not-lte? a b) (cond ((not (number? a)) #t) (else (> a b))))
%Y A266405 Inverse: A266406.
%Y A266405 Cf. A002487.
%Y A266405 Cf. A266195, A266351, A265405 (for sequences with similar definitions).
%K A266405 nonn
%O A266405 1,2
%A A266405 _Antti Karttunen_, Dec 29 2015