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.

User: Derek M. Jones

Derek M. Jones's wiki page.

Derek M. Jones has authored 5 sequences.

A181960 Number of distinct nonnegative integers that can be generated by an expression containing n binary operators (any of add, subtract, multiply and divide) whose operands are any integer between 1 and 9; parenthesis allowed.

Original entry on oeis.org

9, 40, 156, 740, 3668, 16948, 77861, 379084, 1889419
Offset: 0

Author

Derek M. Jones, Apr 03 2012

Keywords

Examples

			a(1)=40, the distinct values are:  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 20 21 24 25 27 28 30 32 35 36 40 42 45 48 49 54 56 63 64 72 81
		

Crossrefs

A181959 Number of distinct integers that can be generated by an expression containing n binary operators (any of add, subtract, multiply and divide) whose operands are any integer between 1 and 9; parenthesis allowed.

Original entry on oeis.org

9, 48, 236, 1274, 6489, 30229, 142320, 711955, 3601566
Offset: 0

Author

Derek M. Jones, Apr 03 2012

Keywords

Examples

			a(1)=48, the distinct values are -8 -7 -6 -5 -4 -3 -2 -1  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 20 21 24 25 27 28 30 32 35 36 40 42 45 48 49 54 56 63 64 72 81
		

Crossrefs

A181958 Number of distinct values that can be generated by an expression containing n binary operators (any of add, subtract, multiply and divide) whose operands are any integer between 1 and 9; parenthesis allowed.

Original entry on oeis.org

9, 93, 931, 11644, 126436, 1443224
Offset: 0

Author

Derek M. Jones, Apr 03 2012

Keywords

Examples

			a(1) = 93 and the distinct values are -8, -7, -6, -5, -4, -3, -2, -1, 1/9, 1/8, 1/7, 1/6, 1/5, 2/9, 1/4, 2/7, 1/3, 3/8, 2/5, 3/7, 4/9, 1/2, 5/9, 4/7, 3/5, 5/8, 2/3, 5/7, 3/4, 7/9, 4/5, 5/6, 6/7, 7/8, 8/9, 1, 9/8, 8/7, 7/6, 6/5, 5/4, 9/7, 4/3, 7/5, 3/2, 8/5, 5/3, 7/4, 9/5, 2, 9/4, 7/3, 5/2, 8/3, 3, 7/2, 4, 9/2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 24, 25, 27, 28, 30, 32, 35, 36, 40, 42, 45, 48, 49, 54, 56, 63, 64, 72, 81
		

Crossrefs

A181957 Smallest positive integer which cannot be calculated by an expression containing n binary operators (either add or multiply) whose operands are integers between 1 and 9; parenthesis allowed.

Original entry on oeis.org

10, 19, 92, 239, 829, 2831, 10061, 38231, 189311, 621791, 2853533, 11423579
Offset: 0

Author

Derek M. Jones, Apr 03 2012

Keywords

Examples

			a(4) = 239 because at least 4 operators are needed to calculate this value, e.g., (5*5+9)*7+1.
		

Crossrefs

Cf. A005520 (operand literal is always 1).

Programs

  • PARI
    first(n)=my(op=[(x, y)->x+y, (x, y)->x*y], v=vector(n+1), t); v[1]=[1..9]; for(k=2, #v, my(u=[]); for(i=1, (k+1)\2, my(a=v[i], b=v[k-i]); t=Set(concat(apply(f->setbinop(f, a, b), op))); u=concat(u, t)); v[k]=setminus(Set(u), [0])); t=10; for(i=1, #v, while(setsearch(v[i], t), t++); v[i]=t); v;
    print(first(7)) \\ Michael S. Branicky, Oct 19 2021 after Charles R Greathouse IV in A181898
    
  • Python
    def aupton(nn):
        alst = [10]
        R = {0: set(range(1, 10))}   # R[n] is set reachable using n ops
        for n in range(1, nn):
            R[n] = set()
            for i in range((n+1)//2):
                for a in R[i]:
                    for b in R[n-1-i]:
                        R[n].update([a+b, a*b])
            k = 10
            while k in R[n]: k += 1  # n.b. R[n-1] <= R[n] due to * by 1
            alst.append(k)
        return alst
    print(aupton(9)) # Michael S. Branicky, Oct 19 2021

Extensions

a(5)-a(7) corrected by and a(8)-a(11) from Michael S. Branicky, Oct 19 2021

A181898 Smallest positive integer which cannot be calculated by an expression containing n binary operators (any of add, subtract, multiply and divide) whose operands are any integer between 1 and 9; parentheses allowed.

Original entry on oeis.org

10, 19, 92, 417, 851, 4237, 14771, 73237, 298609
Offset: 0

Author

Derek M. Jones, Apr 03 2012

Keywords

Examples

			a(2)=92 because at least 3 operators are required, e.g., (2*7 + 9)*4.
		

Crossrefs

Cf. A181957, A181958, A181959, A181960, A005520, A048183 (see text of comment).

Programs

  • PARI
    first(n)=my(op=[(x,y)->x+y, (x,y)->x-y, (x,y)->y-x, (x,y)->x*y, (x,y)->x/y, (x,y)->y/x], v=vector(n+1), t); v[1]=[1..9]; for(k=2,#v, my(u=[]); for(i=1,(k+1)\2, my(a=v[i],b=v[k-i]); t=Set(concat(apply(f->setbinop(f,a,b), op))); u=concat(u,t)); v[k]=setminus(Set(u), [0])); t=10; for(i=1,#v, while(setsearch(v[i],t), t++); v[i]=t); v \\ Charles R Greathouse IV, Jan 09 2017
  • R
    See Jones link.