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.

A126917 a(1)=1. a(n) = the (largest proper divisor of n)th integer from among those positive integers not occurring earlier in the sequence.

This page as a plain text file.
%I A126917 #16 Oct 10 2019 13:38:22
%S A126917 1,2,3,5,4,8,6,11,10,14,7,17,9,20,18,23,12,26,13,29,25,32,15,35,24,38,
%T A126917 33,41,16,44,19,47,40,50,34,53,21,56,48,59,22,62,27,65,55,68,28,71,43,
%U A126917 74,63,77,30,80,54,83,70,86,31,89,36,92,78,95,64,98,37,101,85,104,39
%N A126917 a(1)=1. a(n) = the (largest proper divisor of n)th integer from among those positive integers not occurring earlier in the sequence.
%C A126917 Sequence is a permutation of the positive integers.
%H A126917 Antti Karttunen, <a href="/A126917/b126917.txt">Table of n, a(n) for n = 1..10000</a>
%H A126917 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e A126917 The largest proper divisor of 8 is 4. So a(8) is the 4th integer from among those not occurring among the first 7 integers of the sequence (a(8) is the 4th integer from among 7,9,10,11,13,14,..). So a(8) = 11.
%t A126917 f[l_List] := Block[{k = 0, c = Divisors[Length[l] + 1][[ -2]]},While[c > 0,k++;While[MemberQ[l, k], k++ ];c--;];Append[l, k]];Nest[f, {1}, 71] (* _Ray Chandler_, Jan 04 2007 *)
%o A126917 (Scheme, with defineperm1-macro from _Antti Karttunen_'s IntSeq-library)
%o A126917 (defineperm1 (A126917 n) (if (<= n 1) n (let loop ((i (A243069 (- n 1))) (the-n-th-one (- (A032742 n) 1))) (cond ((not-lte? (A126918 i) n) (if (zero? the-n-th-one) i (loop (+ i 1) (- the-n-th-one 1)))) (else (loop (+ i 1) the-n-th-one))))))
%o A126917 ;; We consider a > b (i.e. not less than b) also in case a is nil.
%o A126917 ;; (Because of the stateful caching system used by defineperm1-macro):
%o A126917 (define (not-lte? a b) (cond ((not (number? a)) #t) (else (> a b))))
%o A126917 ;; _Antti Karttunen_, Jun 20 2014
%Y A126917 Cf. A126918, A032742, A243069, A243488.
%K A126917 nonn
%O A126917 1,2
%A A126917 _Leroy Quet_, Dec 31 2006
%E A126917 Extended by _Ray Chandler_, Jan 04 2007