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

A173419 Length of shortest computation yielding n using addition, subtraction and multiplication (starting from 1).

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 3, 4, 4, 4, 5, 4, 4, 3, 4, 4, 5, 4, 5, 5, 5, 4, 4, 5, 4, 5, 5, 5, 5, 4, 5, 5, 5, 4, 5, 5, 5, 5, 6, 5, 6, 6, 5, 6, 6, 5, 5, 5, 6, 6, 6, 5, 6, 5, 6, 6, 6, 5, 6, 5, 5, 4, 5, 5, 6, 5, 6, 6, 6, 5, 6, 6, 5, 6, 6, 5, 5, 5, 4, 5, 5, 5, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5, 6, 6, 5, 5, 6, 6, 6, 6, 6, 6, 6, 5
Offset: 1

Views

Author

Charles R Greathouse IV, Feb 17 2010, Apr 22 2010

Keywords

Comments

Let x_0 = 1 and x_m = n, with each x_k = x_i + x_j, x_k = x_i * x_j, or x_k = x_i - x_j for some 0 <= i,j < k. a(n) is the least such m.
Shub & Smale ask if there is a c such that a(n!) <= (log n)^c for all n.
If for any sequence of nonzero integers (m_i) there is no constant c such that a(n! * m_n) <= (log n)^c, then "the Hilbert Nullstellensatz is intractable, and consequently the algebraic version of 'NP != P' is true" (Shub & Smale).
Conjecture: if n is prime then a(n) >= a(n-1). The conjecture is true for n < 1800. - Dmitry Kamenetsky, Dec 26 2019

Examples

			For n = 9, one sequence is (1, 1 + 1 = 2, 1 + 2 = 3, 3 * 3 = 9). Since no shorter sequence is possible, a(9) = 3.
For n = 96, one sequence is (1, 1 + 1 = 2, 2 + 2 = 4, 2 + 4 = 6, 4*4 = 16, 6*16 = 96); no shorter is possible so a(96) = 5.
		

References

  • R. K. Guy, Unsolved Problems Number Theory, Sect. F26.

Crossrefs

Records are essentially A141414.
Cf. A003313 (shortest chain using just addition), A005245 (number of 1s using just addition and multiplication), A217032(n):=A173419(n!).

Programs

  • Maple
    g:= f->seq(f union {t}, t={seq(seq({i+j, i-j, i*j}[], j=f), i=f)} minus f):
    F:= proc(n) F(n):= map(g, F(n-1)) end: F(0):= {{1}}:
    S:= proc(n) S(n):= map(x->x[], F(n)) end:
    a:= proc(n) local k; for k from 0 while not(n in S(k)) do od; k end:
    seq(a(n), n=1..110);  # Alois P. Heinz, Sep 24 2012

Formula

a(n) <= 2 log_2(n).
a(n) >= log_2(log_2(n)) + 1.
a(n) >= log_2(n)/log_2(log_2(n)) for almost all n, as proved by Moreira (improving DeMelo & Svaiter).
a(n) <= A005245(n) <= A003313(n) <= A014701(n) <= 2*A000523(n). - Charles R Greathouse IV, Feb 07 2022

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

A217032 Minimum number of steps to reach n! starting from 1 and using the operations of multiplication, addition, or subtraction.

Original entry on oeis.org

0, 1, 3, 4, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 12, 13, 13
Offset: 1

Views

Author

Stan Wagon, Sep 24 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. This sequence lists the smallest number of steps needed to reach n!. A 10-step solution for 12 is {1, 2, 4, 6, 24, 30, 720, 900, 924, 518400, 12!}, found by Stan Wagon; John Guilford found all such, and proved that 10 is minimal for 12! - edited by Stan Wagon, Nov 07 2012
This sequence describes the difficulty of computing the factorial in Valiant's model. If it is of polynomial growth -- that is, there exists some c such that a(n) < (log n)^c for all n -- then the factorial is said to be easy to compute, and consequently "the Hilbert Nullstellensatz is intractable, and consequently the algebraic version of 'NP != P' is true" (Shub & Smale). - Charles R Greathouse IV, Sep 24 2012
During Al Zimmermann's contest (see link), Ed Mertensotto generated all sequences of 12 steps and found no better solutions. Hence a(13)-a(17) are optimal. Solutions of 13 steps were found for a(18) and a(19) during the contest. Hence, they are optimal too. - Dmitry Kamenetsky, Apr 22 2013

Examples

			The entry for 9! is 8 because of the straight-line program {1, 2, 3, 9, 8, 72, 70, 7!, 9!}; subtraction is essential to getting 9! in 8 steps. The entry for 10! is 9 because of the straight-line program {1, 2, 3, 5, 7, 12, 144, 6!, 7!, 10!}, which does not use subtraction.
		

Crossrefs

Formula

a(n) = A173419(n!) >= A217031(n). - Charles R Greathouse IV, Sep 24 2012

Extensions

a(12) from Charles R Greathouse IV, Oct 04 2012
a(13)-a(19) from Ed Mertensotto, Mar 20 2013

A214872 The number of subsets of positive integers of cardinality n, produced as the steps in a computation starting with 1 and using the operations of multiplication, addition, or subtraction.

Original entry on oeis.org

1, 2, 8, 59, 663, 10609, 225219, 6057298, 199290037, 7805646133, 356263294786, 18626811747385
Offset: 1

Views

Author

Gil Dogon, May 03 2013

Keywords

Comments

A straight-line program (SLP) is a sequence that starts at 1 and has each entry obtained from two preceding entries by addition, multiplication, or subtraction. The length of the SLP is defined as that of the sequence without the first 1. An SLP is said to be positive if all numbers in the sequence are positive, and reduced if there is no repetition in the sequence. Two SLPs are considered equivalent if their sequence consists of the same numbers (only difference is sequence order). This OEIS sequence gives the number of reduced positive SLPs with n steps.
For most purposes only positive SLPs can be considered, as for every general SLP sequence, applying absolute value to all the steps will produce a positive SLP.
This OEIS sequence can also be thought of as defining the size of the search space that needs to be traversed when trying to compute other SLP related OEIS sequences as given in the cross references below.

Examples

			a(1) = 1 and the SLP is (1,2).
a(2) = 2 and the positive SLPs are (1,2,3) (1,2,4).
a(3) = 8 and the positive SLPs are (1,2,3,4) (1,2,3,5) (1,2,3,6) (1,2,3,9) (1,2,4,5) (1,2,4,6) (1,2,4,8) (1,2,4,16).
Notice that also (1,2,4,3) is a legal positive reduced length 3 SLP sequence but it is equivalent to (1,2,3,4) hence is not enumerated.
		

Crossrefs

Formula

a(n) >= a(n-1) * 2 * (n-1) and a(2)=2 Hence a(n) >= 2^(n-1)*(n-1)! .
The recurrence above is true since if the maximum of an SLP sequence of length n-1 is added to all elements except itself, and multiplied with all elements except the first 1 (including itself), then 2n-2 different extensions of the original SLP sequence are produced, resulting in 2n-2 reduced SLP's of length n.

A229662 The number of subsets of integers of cardinality n, produced as the steps in a computation starting with 1 and using the operations of multiplication, addition, or subtraction.

Original entry on oeis.org

2, 5, 20, 149, 1852, 34354, 873386, 28671789, 1166062774, 56973937168, 3266313635225, 215667757729237
Offset: 1

Views

Author

Gil Dogon, Sep 27 2013

Keywords

Comments

A straight-line program (SLP) is a sequence that starts at 1 and has each entry obtained from two preceding entries by addition, multiplication, or subtraction. The length of the SLP is defined as that of the sequence without the first 1. An SLP is said to be reduced if there is no repetition in the sequence. Two SLPs are considered equivalent if their sequence defines the same set of integers. This OEIS sequence gives the number of reduced SLPs with n steps.

Examples

			a(1) = 2 and the SLPs are (1,2) (1,0)
a(2) = 5 and the SLPs are (1,2,3) (1,2,4) (1,2,-1) (1,0,-1) (1,0,2)
		

Crossrefs

Formula

a(n) >= a(n-1) * 2 * (n-1) and a(2)=5 Hence a(n) >= 5*2^(n-2)*(n-1)! .

A229686 The negative number of minimum absolute value not obtainable from 1 in n steps using addition, multiplication, and subtraction.

Original entry on oeis.org

-1, -2, -4, -9, -29, -85, -311, -1549, -9851, -74587, -956633
Offset: 0

Views

Author

Gil Dogon, Sep 27 2013

Keywords

Comments

This is similar to A141414 but applied to negative numbers. It is the greatest negative number that requires an n step SLP (Stright Line Program) to compute it.

Examples

			For n=1 the value is -1 since -1 requires 2 steps SLP: 1,2,-1.
For n=2 the value is -2 since -2 requires 3 steps SLP: 1,2,3,-2.
For n=3 the value is -4 since -3 also requires only 3 steps but -4 requires 4: 1,2,4,5,-4.
		

Crossrefs

Showing 1-6 of 6 results.