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.

A138612 Permutation of natural numbers generated with the sieve algorithm described in the comment lines.

This page as a plain text file.
%I A138612 #9 Mar 10 2015 02:05:04
%S A138612 1,2,4,3,7,12,5,11,19,28,6,15,26,39,53,8,20,35,52,71,91,9,23,42,64,88,
%T A138612 114,141,10,27,49,76,106,138,172,207,13,33,60,93,129,168,210,253,297,
%U A138612 14,37,68,105,148,194,243,294,347,401,16,43,79,122,171,225,282,342
%N A138612 Permutation of natural numbers generated with the sieve algorithm described in the comment lines.
%C A138612 Sieve proceeds as:
%C A138612 1) take the 1st element from natural numbers (A000027): 1; remaining set is 2,3,4,5,6,7,8,9,10,...; S1={1}
%C A138612 2) take the 1st element from the remaining set: 2; remaining set is 3,4,5,6,7,8,9,10,...; take the 2nd element from the remaining set: 4; remaining set is 3,5,6,7,8,9,10,...; S2={2,4}
%C A138612 3) take the 1st element from the remaining set: 3; remaining set is 5,6,7,8,9,10,...; take the 3rd element from the remaining set: 7; remaining set is 5,6,8,9,10,11,12,...; take the 7th element from the remaining set: 12; remaining set is 5,6,8,9,10,11,13,14,15,16,17,18,19,20,..; S3={3,7,12}
%C A138612 4) take the 1st element from the remaining set: 5; remaining set is 6,8,9,10,11,13,14,15,16,17,18,19,20,..; take the 5th element from the remaining set: 11; remaining set is 6,8,9,10,13,14,15,16,17,18,19,20,..; take the 11th element from the remaining set: 19; remaining set is 6,8,9,10,13,14,15,16,17,18,20,..; take the 19th element from the remaining set: 28; remaining set is 6,8,9,10,13,14,15,16,17,18,20,21,22,23,24,25,26,27,29,30,31,...;
%C A138612 thus S4={5,11,19,28}.
%C A138612 The sequence is concatenation of such subsequences S1,S2,S3,S4,S5,...,Sn, ..., where each subsequence consists of n nondecreasing terms. Alternatively, these can be viewed as rows of a triangular table.
%H A138612 A. Karttunen, <a href="/A138612/b138612.txt">Table of n, a(n) for n = 1..5050</a>
%H A138612 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%o A138612 (MIT Scheme:)
%o A138612 (define (A138612 n) (if (< n 3) n (let loop ((k (if (zero? (A002262 (-1+ n))) 1 (A138612 (-1+ n)))) (i 1)) (cond ((not-lte? (A166017 i) (-1+ n)) (if (= 1 k) i (loop (-1+ k) (1+ i)))) (else (loop k (1+ i)))))))
%o A138612 (define (not-lte? a b) (cond ((not (number? a)) #t) (else (> a b))))
%Y A138612 Inverse: A166017. Left edge A166018, Right edge: A166019, Row sums: A166020. Cf. A138606-A138609.
%K A138612 nonn,tabl
%O A138612 1,2
%A A138612 _Ctibor O. Zizka_, May 14 2008
%E A138612 Edited, extended, keyword tabl and Scheme-code added by _Antti Karttunen_, Oct 05 2009