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.

Showing 1-2 of 2 results.

A091023 a(1)=1; for n >= 2, set a(n)=m, where n is the smallest unassigned index with exactly m-1 unassigned indices still remaining between m and m-1.

Original entry on oeis.org

1, 2, 13, 3, 6, 26, 4, 11, 205, 9, 5, 24, 7, 51, 22, 102, 20, 49, 18, 8, 410, 10, 16, 12, 47, 14, 100, 45, 203, 43, 98, 41, 3277, 39, 96, 37, 201, 35, 94, 15, 33, 17, 408, 19, 31, 21, 92, 23, 29, 25, 199, 27, 90, 819, 88, 197, 86, 406, 84, 195, 82, 1638, 80, 193, 78, 404
Offset: 1

Views

Author

John W. Layman, Feb 23 2004

Keywords

Comments

Suggested by Leroy Quet in SeqFan memo 3602 on Feb 16 2004, where he gave the terms with values 1-16, with a(6) the first unassigned term.
Considering the number of unassigned indices to the left of the current position gives an equivalent sequence, A091068, which is easier to analyze. - N. J. A. Sloane, Feb 23 2004

Examples

			After 1 has been assigned to a(1), the first unassigned term that is one term away from 1 is a(2), so a(2)=2;
the first unassigned term that is two terms away from 2 is a(4), so a(4)=3;
the first unassigned term that is 3 terms away from 3 is a(7), so a(7)=4;
the first unassigned term that is 4 terms away from 4 is a(11), so a(11)=5;
at this point we have 1,2,*,3,*,*,4,*,*,*,5,..., where * indicates a term to which a value has not yet been assigned.
The next value to assign is 6 which must be assigned to the first term of the sequence that is 5 terms away from a(11)=5; since a(5) has not yet been assigned a value and since at this point 5 terms with unassigned values lie between a(5) and a(11), we must assign 6 to a(5), i.e., a(5)=6.
		

Crossrefs

Cf. A091052, A091053 (records), A091263 (inverse).

Programs

  • Maple
    nmax := 20000 : a := [seq(0,i=1..nmax)] : a := subsop(1=1,a) : a := subsop(2=2,a) : prevn := 2 : n := 3: while true do us := n ; atst := prevn-1 ; tstdown := false ; while us > 0 and atst>0 do if op(atst,a) =0 then us := us-1 ; if us = 1 then tstdown := true ; a := subsop(atst=n,a) ; prevn := atst ; break ; fi ; fi ; atst := atst -1 ; od ; if tstdown = false then us := n ; atst := prevn+1 ; while us > 0 do if op(atst,a) =0 then us := us-1 ; if us = 1 then a := subsop(atst=n,a) ; prevn := atst ; break ; fi ; fi ; atst := atst +1 ; od ; fi ; for i from 1 to 150 do printf("%d, ",op(i,a)) ; od ; print() ; n := n+1 ; od : # R. J. Mathar, Apr 28 2007

Extensions

More terms from R. J. Mathar, Apr 28 2007

A091263 Inverse permutation to A091023.

Original entry on oeis.org

1, 2, 4, 7, 11, 5, 13, 20, 10, 22, 8, 24, 3, 26, 40, 23, 42, 19, 44, 17, 46, 15, 48, 12, 50, 6, 52, 79, 49, 81, 45, 83, 41, 85, 38, 87, 36, 89, 34, 91, 32, 93, 30, 95, 28, 97, 25, 99, 18, 101, 14, 103, 155, 100, 157, 96, 159, 92, 161, 88, 163, 84, 165, 80, 167, 77, 169, 75
Offset: 1

Views

Author

N. J. A. Sloane, following a suggestion of Leroy Quet, Feb 23 2004

Keywords

Comments

Let S_n be the set of all positive integers except a(1), a(2), ..., a(n-1) and a(n). Let k_n be the number of members of S_n that are less than a(n). (k_n = A091068(n+1).) If k_n >= n, then a(n+1) is the (1+k_n-n)th member of S_n; if k_n < n then a(n+1) is the (k_n+n)th member of S_n. - David Wasserman, Feb 23 2006

Extensions

More terms from John W. Layman, Feb 25 2004
Showing 1-2 of 2 results.