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-10 of 10 results.

A131396 Positions of n-th positive integer in A131394, minus 1.

Original entry on oeis.org

1, 2, 4, 5, 8, 10, 11, 13, 16, 17, 19, 21, 24, 25, 27, 30, 31, 34, 35, 37, 39, 41, 43, 46, 48, 49, 51, 53, 56, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 78, 80, 82, 84, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 108, 111, 112, 114, 117, 119, 121, 123, 125, 127, 129
Offset: 1

Views

Author

Clark Kimberling, Jul 06 2007, Jul 21 2007

Keywords

Comments

If A131394 is a permutation of the integers, as conjectured, then A131396 is the complement of A131397.

Examples

			The 5th positive integer to occur in A131393 is 6, which occurs at position 9, so that a(5) = 9 - 1 = 8.
		

Formula

a(n) = position of n-th positive integers in A131393, minus 1.

A131397 Positions of negative integers in A131394, minus 1.

Original entry on oeis.org

3, 6, 7, 9, 12, 14, 15, 18, 20, 22, 23, 26, 28, 29, 32, 33, 36, 38, 40, 42, 44, 45, 47, 50, 52, 54, 55, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 79, 81, 83, 85, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 109, 110, 113, 115, 116, 118, 120, 122, 124, 126, 128, 130, 132
Offset: 1

Views

Author

Clark Kimberling, Jul 06 2007

Keywords

Comments

If A131394 is a permutation of the integers, as conjectured, then A131397 is the complement of A131396.

Examples

			The 5th negative integer to occur in A131394 is -5, which occurs at position 13, so that a(5) = 13 - 1 = 12.
		

Crossrefs

Formula

a(n) = position of n-th negative integer in A131394, minus 1.

A131389 Sequence (d(n)) generated by Rule 1 (see Comments) with a(1) = 1 and d(1) = 0.

Original entry on oeis.org

0, 1, 2, -1, 3, 4, -2, -3, 6, -4, 5, 7, -5, 8, -6, -7, 9, 10, -8, 11, -10, 12, -9, -11, 13, 14, -13, -12, 15, 16, -14, -15, 17, 18, -16, 19, -17, 20, -19, 21, -18, 22, -20, -21, 24, -22, 23, 25, -23, 26, -25, 27, -24, 28, -26, -27, 30, 29, -31, 32, -28, 31, -29, 33, -30, 34, -32, -33, 35, 36, -34
Offset: 1

Views

Author

Clark Kimberling, Jul 05 2007

Keywords

Comments

Rule 1 is given at A131388. Conjecture: Every integer occurs exactly once in A131389.

Examples

			See A131388.
		

Crossrefs

Programs

Formula

This is the sequence d( ) in the formula for A131388.

Extensions

Definition clarified by Clark Kimberling, May 12 2015

A131388 Sequence (a(n)) generated by Rule 1 (in Comments) with a(1) = 1 and d(1) = 0.

Original entry on oeis.org

1, 2, 4, 3, 6, 10, 8, 5, 11, 7, 12, 19, 14, 22, 16, 9, 18, 28, 20, 31, 21, 33, 24, 13, 26, 40, 27, 15, 30, 46, 32, 17, 34, 52, 36, 55, 38, 58, 39, 60, 42, 64, 44, 23, 47, 25, 48, 73, 50, 76, 51, 78, 54, 82, 56, 29, 59, 88, 57, 89, 61, 92, 63, 96, 66, 100, 68, 35, 70, 106, 72, 37
Offset: 1

Views

Author

Clark Kimberling, Jul 05 2007

Keywords

Comments

Rule 1 follows. For k >= 1, let A(k) = {a(1), …, a(k)} and D(k) = {d(1), …, d(k)}. Begin with k = 1 and nonnegative integers a(1) and d(1).
Step 1: If there is an integer h such that 1 - a(k) < h < 0 and h is not in D(k) and a(k) + h is not in A(k), let d(k+1) be the greatest such h, let a(k+1) = a(k) + h, replace k by k + 1, and repeat Step 1; otherwise do Step 2.
Step 2: Let h be the least positive integer not in D(k) such that a(k) + h is not in A(k). Let a(k+1) = a(k) + h and d(k+1) = h. Replace k by k+1 and do Step 1.
Conjecture: if a(1) is an nonnegative integer and d(1) is an integer, then (a(n)) is a permutation of the nonnegative integers (if a(1) = 0) or a permutation of the positive integers (if a(1) > 0). Moreover, (d(n)) is a permutation of the integers if d(1) = 0, or of the nonzero integers if d(1) > 0.
See A257705 for a guide to related sequences.

Examples

			a(2)=1+1, a(3)=a(2)+2, a(4)=a(3)+(-1), a(5)=a(4)+3, a(6)=a(5)+4.
		

Crossrefs

Programs

  • Mathematica
    (*Program 1 *)
    {a, f} = {{1}, {0}}; Do[tmp = {#, # - Last[a]} &[Max[Complement[#, Intersection[a, #]] &[Last[a] + Complement[#, Intersection[f, #]] &[Range[2 - Last[a], -1]]]]];
    If[! IntegerQ[tmp[[1]]], tmp = {Last[a] + #, #} &[NestWhile[# + 1 &, 1, ! (! MemberQ[f,#] && ! MemberQ[a, Last[a] + #]) &]]];
    AppendTo[a, tmp[[1]]]; AppendTo[f, tmp[[2]]], {400}];
    {a, f} (*{A131388, A131389}; Peter J. C. Moses, May 10 2015*)
    (*Program 2 *)
    a[1] = 1; d[1] = 0; k = 1; z = 10000; zz = 120;
    A[k_] := Table[a[i], {i, 1, k}]; diff[k_] := Table[d[i], {i, 1, k}];
    c[k_] := Complement[Range[-z, z], diff[k]];
    T[k_] := -a[k] + Complement[Range[z], A[k]];
    s[k_] := Intersection[Range[-a[k], -1], c[k], T[k]];
    Table[If[Length[s[k]] == 0, {h = Min[Intersection[c[k], T[k]]], a[k + 1] = a[k] + h, d[k + 1] = h, k = k + 1}, {h = Max[s[k]], a[k + 1] = a[k] + h, d[k + 1] = h, k = k + 1}], {i, 1, zz}];
    u = Table[a[k], {k, 1, zz}] (* A131388 *)
    Table[d[k], {k, 1, zz}]     (* A131389 *)

Formula

a(k+1) - a(k) = d(k+1) for k >= 1.

Extensions

Revised by Clark Kimberling, May 12 2015

A131393 Conjectured permutation of the positive integers using Rule 2 with a(1)=1.

Original entry on oeis.org

1, 2, 4, 3, 6, 10, 8, 5, 11, 7, 12, 19, 14, 22, 16, 9, 18, 28, 20, 31, 21, 33, 24, 13, 26, 40, 27, 42, 30, 15, 32, 48, 34, 17, 35, 54, 38, 58, 39, 60, 37, 59, 41, 64, 44, 23, 47, 25, 50, 76, 52, 79, 53, 81, 56, 29, 61, 90, 62, 92, 63, 94, 57, 91, 55, 88, 49, 84, 51, 87, 46, 83
Offset: 1

Views

Author

Clark Kimberling, Jul 05 2007

Keywords

Comments

Conjecture 1: a( ) is a permutation of the positive integers. Conjecture 2: d( ) is a permutation of the integers. The sequence using Rule 1 ("negative before positive") is A131388.
This sequence was generated using "Rule 2" in a computer program which been lost. The wording of "Rule 2" in the Formula section, although flawed, is retained in case someone can rediscover "Rule 2" and contribute a corrected version. - Clark Kimberling, May 18 2015

Examples

			a(2)=1+1, a(3)=a(2)+2, a(4)=a(3)+(-1), a(5)=a(4)+3, a(6)=a(5)+4.
The first term that differs from A131388 is a(28)=42.
		

Crossrefs

Formula

The following version of "Rule 2" is defective; see Comments. - Clark Kimberling, May 18 2015
Rule 2 ("positive before negative"): define sequences d( ) and a( ) as follows: d(1)=0, a(1)=1 and for n>=2, d(n) is the least positive integer d such that a(n-1)+d is not among a(1), a(2),...,a(n-1), or, if no such d exists, then d(n) is the greatest negative integer d such that a(n-1)+d is not among a(1), a(2),...,a(n-1). Then a(n)=a(n-1)+d.

A131391 Positions of positive integers in A131389, minus 1.

Original entry on oeis.org

1, 2, 4, 5, 8, 10, 11, 13, 16, 17, 19, 21, 24, 25, 28, 29, 32, 33, 35, 37, 39, 41, 44, 46, 47, 49, 51, 53, 56, 57, 59, 61, 63, 65, 68, 69, 72, 73, 75, 77, 79, 81, 83, 85, 88, 90, 92, 94, 95, 97, 99, 101, 103, 105, 108, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129
Offset: 1

Views

Author

Clark Kimberling, Jul 06 2007

Keywords

Comments

If A131389 is a permutation of the integers, as conjectured, then A131391 is the complement of A131392.

Examples

			The 5th positive integer to occur in A131391 is 6, which occurs in position 9, so that a(5) = 9 - 1 = 8.
		

Crossrefs

Formula

a(n) = -1 + position of the n-th positive integer in the sequence A131389=(0,1,2,-1,3,4,-2,-3,6,-4,5,...)

A131392 Positions of negative integers in A131389, minus 1.

Original entry on oeis.org

3, 6, 7, 9, 12, 14, 15, 18, 20, 22, 23, 26, 27, 30, 31, 34, 36, 38, 40, 42, 43, 45, 48, 50, 52, 54, 55, 58, 60, 62, 64, 66, 67, 70, 71, 74, 76, 78, 80, 82, 84, 86, 87, 89, 91, 93, 96, 98, 100, 102, 104, 106, 107, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 131, 132
Offset: 1

Views

Author

Clark Kimberling, Jul 06 2007

Keywords

Comments

If A131389 is a permutation of the integers, as conjectured, then A131392 is the complement of A131391.

Examples

			The 5th negative integer to occur in A131391 is -5, which occurs in position 13, so that a(5)=13-1=12.
		

Crossrefs

Formula

a(n) = -1 + position of the n-th negative integer in the sequence A131389=(0,1,2,-1,3,4,-2,-3,6,-4,5,...)

A131390 Conjectured permutation of the positive integers; inverse of conjectured permutation A131388.

Original entry on oeis.org

1, 2, 4, 3, 8, 5, 10, 7, 16, 6, 9, 11, 24, 13, 28, 15, 32, 17, 12, 19, 21, 14, 44, 23, 46, 25, 27, 18, 56, 29, 20, 31, 22, 33, 68, 35, 72, 37, 39, 26, 90, 41, 88, 43, 92, 30, 45, 47, 94, 49, 51, 34, 108, 53, 36, 55, 59, 38, 57, 40, 61, 63, 42, 81, 65, 83, 67, 79, 69, 77, 71, 48
Offset: 1

Views

Author

Clark Kimberling, Jul 05 2007

Keywords

Crossrefs

Formula

Inverse of A131388.

A131395 Conjectured permutation of the positive integers; inverse of conjectured permutation A131393.

Original entry on oeis.org

1, 2, 4, 3, 8, 5, 10, 7, 16, 6, 9, 11, 24, 13, 30, 15, 34, 17, 12, 19, 21, 14, 46, 23, 48, 25, 27, 18, 56, 29, 20, 31, 22, 33, 35, 77, 41, 37, 39, 26, 43, 28, 75, 45, 73, 71, 47, 32, 67, 49, 69, 51, 53, 36, 65, 55, 63, 38, 42, 40, 57, 59, 61, 44, 99, 97, 87, 93, 78, 91, 50, 89
Offset: 1

Views

Author

Clark Kimberling, Jul 05 2007

Keywords

Crossrefs

Formula

Inverse of A131393.

A257985 Sequence (a(n)) generated by Rule 3 (in Comments) with a(1) = 2 and d(1) = 0.

Original entry on oeis.org

2, 3, 5, 4, 7, 13, 6, 11, 8, 15, 9, 17, 12, 10, 19, 37, 14, 27, 16, 31, 18, 35, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 32, 28, 55, 26, 51, 42, 30, 59, 29, 57, 33, 65, 34, 67, 40, 44, 36, 71, 38, 75, 50, 99, 46, 91, 48, 95, 53, 105, 54, 107, 52, 103
Offset: 1

Views

Author

Clark Kimberling, Jun 02 2015

Keywords

Comments

Rule 3 follows. For k >= 1, let A(k) = {a(1), …, a(k)} and D(k) = {d(1), …, d(k)}. Begin with k = 1 and nonnegative integers a(1) and d(1).
Step 1: If there is an integer h such that 1 - a(k) < h < 0 and h is not in D(k) and a(k) + h is not in A(k), let d(k+1) be the least such h, let a(k+1) = a(k) + h, replace k by k + 1, and repeat Step 1; otherwise do Step 2.
Step 2: Let h be the least positive integer not in D(k) such that a(k) - h is not in A(k). Let a(k+1) = a(k) + h and d(k+1) = h. Replace k by k+1 and do Step 1.
See A257905 for a guide to related sequences and conjectures.

Examples

			a(1) = 2, d(1) = 0;
a(2) = 3, d(2) = 1;
a(3) = 5, d(3) = 2;
a(4) = 4, d(4) = -1.
		

Crossrefs

Programs

  • Mathematica
    {a, f} = {{2}, {0}}; Do[tmp = {#, # - Last[a]} &[Min[Complement[#, Intersection[a, #]]&[Last[a] + Complement[#, Intersection[f, #]] &[Range[2 - Last[a], -1]]]]];
    If[! IntegerQ[tmp[[1]]], tmp = {Last[a] + #, #} &[NestWhile[# + 1 &, 1, ! (! MemberQ[f, #] && ! MemberQ[a, Last[a] - #]) &]]]; AppendTo[a, tmp[[1]]]; AppendTo[f, tmp[[2]]], {120}]; {a, f} (* Peter J. C. Moses, May 14 2015 *)

Formula

a(n) = A131393(n) + 1 for n >= 1. Also, a(n) - a(n-1) = A131394(n) for n >= 2.
Showing 1-10 of 10 results.