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

A216999 Number of integers obtainable from 1 in n steps using addition, multiplication, and subtraction.

Original entry on oeis.org

1, 3, 6, 13, 38, 153, 867, 6930, 75986, 1109442, 20693262, 477815647
Offset: 0

Views

Author

Stan Wagon, Sep 22 2012

Keywords

Comments

A straight-line program is a sequence that starts at 1 and has each entry obtained from two preceding entries by addition, multiplication, or subtraction. S(n) is the set of integers obtainable at any point in a straight-line program using n steps. Thus S(0) = {1}, S(1) = {0,1,2}, S(2) = {-1,0,1,2,3,4}; the sequence here is the cardinality of S(n).

Crossrefs

Programs

  • Mathematica
    extend[p_] :=  Module[{q = Tuples[p, {2}], new},
      new = Flatten[Table[{Total[t], Subtract @@ t, Times @@ t}, {t, q}]];
      Union[ Sort /@  DeleteCases[ Table[If[! MemberQ[p, n], Append[p, n]], {n, new}], Null]]] ;
    P[0] = {{1}};
    P[n_] := P[n] = DeleteDuplicates[Flatten[extend /@ P[n - 1], 1]];
    S[n_] := DeleteDuplicates[Flatten[P[n]]];
    Length /@ S /@ Range[6]

Extensions

a(9)-a(11) (Michael Collier verified independently the 1109442, 20693262 values) by Gil Dogon, Sep 27 2013

A288760 Number of distinct nonnegative rational numbers that can be obtained in n steps by applying addition, subtraction, multiplication and division to any two potentially identical numbers from the complete set of numbers created in n-1 steps, starting with the set {1}.

Original entry on oeis.org

1, 3, 6, 24, 300, 37761, 451572162
Offset: 0

Views

Author

Hugo Pfoertner, Jun 15 2017

Keywords

Comments

The conjectured value of a(6)=451572162 needs independent verification.
For an explanation of the difference from a straight-line program (SLP) see comment in A288759. A288850 provides the corresponding cardinalities of the sets that can be obtained by an n-step SLP.

Examples

			The sets of numbers >=0 obtainable at the n-th step are:
S(0) = { 1 },
S(1) = { 0, 1, 2 },
S(2) = { 0, 1/2, 1, 2, 3, 4 },
S(3) = { 0, 1/8, 1/6, 1/4, 1/3, 1/2, 2/3, 3/4, 1, 4/3, 3/2, 2, 5/2, 3, 7/2, 4, 9/2, 5, 6, 7, 8, 9, 12, 16 }.
		

Crossrefs

Extensions

Wrong a(6) removed by Hugo Pfoertner, Jun 19 2017
a(6) from Markus Sigg, Jul 01 2017

A288849 Number of distinct rational numbers that can be obtained in n steps by a straight-line program (SLP) starting at 1 using addition, subtraction, multiplication and division.

Original entry on oeis.org

1, 3, 7, 21, 83, 484, 4084, 49479
Offset: 0

Views

Author

Hugo Pfoertner, Jun 18 2017

Keywords

Examples

			The sets of numbers obtainable at the n-th step are:
S(0) = { 1 },
S(1) = { 0, 1, 2 },
S(2) = { -1, 0, 1/2, 1, 2, 3, 4 },
S(3) = { -3, -2, -3/2, -1, -1/2, 0, 1/4, 1/3, 1/2, 2/3, 1, 3/2, 2, 5/2, 3, 4, 5, 6, 8, 9, 16 }.
		

Crossrefs

A216999 provides the corresponding results if division is not used.

Extensions

a(7) from Alois P. Heinz, Jun 18 2017
Showing 1-3 of 3 results.