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 13 results. Next

A258069 Nonnegative integers that can be computed using exactly eight 8's and the four basic arithmetic operations {+, -, *, /}.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92
Offset: 1

Views

Author

Alois P. Heinz, May 18 2015

Keywords

Comments

The smallest non-computable number here is 91. The largest computable number here is 8^8 = 16777216.

Crossrefs

Programs

  • Maple
    f:= proc(n) f(n):= `if`(n=1, {8}, {seq(seq(seq([x+y, x-y, x*y,
          `if`(y=0, [][], x/y)][], y=f(n-j)), x=f(j)), j=1..n-1)})
        end:
    sort([select(z->z>=0 and is(z, integer), f(8))[]])[];
  • PARI
    A258069(n=8, S=Vec([[n]], n))={for(n=2, n, S[n]=Set(concat(vector(n\2, k, Set(concat([Set(concat([[T+U, T-U, U-T, if(U, T/U), if(T, U/T), T*U] | T <- S[n-k]])) | U <- S[k]])))))); select(t->t>=0 && type(t)=="t_INT", S[n])} \\ A258069() yields this sequence, use optional arg to compute variants. - M. F. Hasler, Nov 24 2018

A258070 Nonnegative integers that can be computed using exactly nine 9's and the four basic arithmetic operations {+, -, *, /}.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67
Offset: 1

Views

Author

Alois P. Heinz, May 18 2015

Keywords

Comments

The smallest non-computable number here is 195. The largest computable number here is 9^9 = 387420489.

Crossrefs

Programs

  • Maple
    f:= proc(n) f(n):= `if`(n=1, {9}, {seq(seq(seq([x+y, x-y, x*y,
          `if`(y=0, [][], x/y)][], y=f(n-j)), x=f(j)), j=1..n-1)})
        end:
    sort([select(z->z>=0 and is(z, integer), f(9))[]])[];
  • PARI
    A258070(n=9, S=Vec([[n]], n))={for(n=2, n, S[n]=Set(concat(vector(n\2, k, Set(concat([Set(concat([[T+U, T-U, U-T, if(U, T/U), if(T, U/T), T*U] | T <- S[n-k]])) | U <- S[k]])))))); select(t->t>=0 && type(t)=="t_INT", S[n])} \\ Requires at least 30 MB stack. (Use allocatemem()). A258070() yields this sequence, use optional arg to compute variants. - M. F. Hasler, Nov 26 2018

A171827 Nonnegative integers that can be made by using exactly four fours (4 4's) and the four basic operators {+, -, *, /}.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 20, 24, 28, 32, 36, 48, 60, 64, 68, 80, 128, 256
Offset: 1

Views

Author

Sergio Pimentel, Dec 19 2009

Keywords

Comments

Every integer can be made if other operators are allowed (e.g., 14 = 4!/4 + 4 + 4). The sequence is finite: a(26) = 4*4*4*4=256 is the last term.

Examples

			Example: a(11) = 12 since 12 = (4 - 4/4) * 4.
		

Crossrefs

Programs

  • PARI
    A171827(n=4, S=Vec([[n]], n))={for(n=2, n, S[n]=Set(concat(vector(n\2, k, concat([concat([[T+U, T-U, U-T, if(U, T/U), if(T, U/T), T*U] | T <- S[n-k]]) | U <- S[k]]))))); [t|t <- S[n], t>=0 && type(t)=="t_INT"]} \\ A171827() yields this sequence, use optional arg to compute variants. - M. F. Hasler, Nov 24 2018

A171828 Nonnegative integers that can be made by using five fives (5 5's) and the four basic operators {+, -, *, /}.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 19, 20, 21, 23, 24, 25, 26, 27, 29, 30, 31, 35, 40, 45, 49, 50, 51, 55, 60, 70, 75, 80, 95, 100, 105, 115, 120, 124, 125, 126, 130, 135, 145, 150, 155, 175, 200, 225, 245, 250, 255, 275, 300, 375, 500, 600, 620, 630, 650, 750, 1250, 3125
Offset: 1

Views

Author

Sergio Pimentel, Dec 19 2009

Keywords

Comments

Every integer can be made if other operators are allowed (i.e., 13 = (5!+5+5)/(5+5)). The sequence is finite: a(68) = 5*5*5*5*5 = 3125 is the last term.

Examples

			Example: a(14) = 14 = (5+5+5)-(5/5).
		

Crossrefs

Programs

  • PARI
    A171828(n=5, S=Vec([[n]], n))={for(n=2, n, S[n]=Set(concat(vector(n\2, k, concat([concat([[T+U, T-U, U-T, if(U, T/U), if(T, U/T), T*U] | T <- S[n-k]]) | U <- S[k]]))))); select(t->t>=0 && type(t)=="t_INT", S[n])} \\ A171828() yields this sequence, use optional arg to compute variants. - M. F. Hasler, Nov 24 2018

A171829 Nonnegative integers that can be made by using six sixes (6 6's) and the four basic operators {+, -, *, /}.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 48, 49, 54, 60, 65, 66, 67, 69, 70, 71, 72, 73, 74, 75, 77, 78, 79, 84, 90, 96, 102, 107
Offset: 1

Views

Author

Sergio Pimentel, Dec 19 2009

Keywords

Comments

More integers can be made if other operators are allowed (i.e., 22 = 6!/(6*6)+(6+6)/6). The sequence is finite: a(198) = 6*6*6*6*6*6 = 46656 is the last term.
See A258068 ff. for the integers that can be generated with the four basic operators and 7 7's, 8 8's, 9 9's, etc...

Examples

			49 is in the sequence: 49 = (6 + 6/6) * (6 + 6/6).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) f(n):= `if`(n=1, {6}, {seq(seq(seq([x+y, x-y, x*y,
          `if`(y=0, [][], x/y)][], y=f(n-j)), x=f(j)), j=1..n-1)})
        end:
    sort([select(z->z>=0 and is(z, integer), f(6))[]])[];
    #  Alois P. Heinz, Aug 04 2013
  • Mathematica
    f[1] = {6}; f[n_] := f[n] = Union @ Flatten @ Table[Table[Table[{x+y, x-y, x*y, If[y == 0, Null, x/y]}, {y, f[n-j]}], {x, f[j]}], {j, 1, n-1}];
    Sort[Select[f[6], # >= 0 && IntegerQ[#]&]] (* Jean-François Alcover, Jun 01 2018, after Alois P. Heinz *)
  • PARI
    A171829(n=6, S=Vec([[n]],n))={for(n=2, n, S[n]=Set(concat(vector(n\2, k, concat([concat([[T+U, T-U, U-T, if(U, T/U), if(T, U/T), T*U] | T <- S[k]]) | U <- S[n-k]]))))); select(t-> t>=0 && denominator(t)==1,S[n])} \\ A171829() yields this sequence. Optional args allow to compute variants. - M. F. Hasler, Nov 24 2018

Extensions

Corrected and edited by Alois P. Heinz, Aug 03 2013

A258068 Nonnegative integers that can be computed using exactly seven 7's and the four basic arithmetic operations {+, -, *, /}.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 69, 70, 71
Offset: 1

Views

Author

Alois P. Heinz, May 18 2015

Keywords

Comments

The smallest non-computable number here is 38. The largest computable number here is 7^7 = 823543.

Crossrefs

Programs

  • Maple
    f:= proc(n) f(n):= `if`(n=1, {7}, {seq(seq(seq([x+y, x-y, x*y,
          `if`(y=0, [][], x/y)][], y=f(n-j)), x=f(j)), j=1..n-1)})
        end:
    sort([select(z->z>=0 and is(z, integer), f(7))[]])[];
  • PARI
    A258068(n=7, S=Vec([[n]], n))={for(n=2, n, S[n]=Set(concat(vector(n\2, k, Set(concat([Set(concat([[T+U, T-U, U-T, if(U, T/U), if(T, U/T), T*U] | T <- S[n-k]])) | U <- S[k]])))))); select(t->t>=0 && type(t)=="t_INT", S[n])} \\ A258068() yields this sequence, use optional arg to compute variants. - M. F. Hasler, Nov 24 2018

A171826 Nonnegative integers that can be made using exactly three threes (3 3's) and the four basic operators {+, -, *, /}.

Original entry on oeis.org

0, 2, 3, 4, 6, 9, 12, 18, 27
Offset: 1

Views

Author

Sergio Pimentel, Dec 19 2009

Keywords

Comments

More integers can be made using 3 3's if more operators are allowed (i.e., 1 = 3^(3-3) or 5 = 3! - 3/3). Note that 1 = 3/3 but the sequence requires to use exactly three threes and it's not possible to "get rid" of the third three.

Examples

			a(1) = 0 = (3-3)*3, a(2) = 2 = 3 - 3/3, a(3) = 3 = 3*3/3,
a(4) = 4 = 3 + 3/3, a(5) = 6 = 3*3 - 3, a(6) = 9 = 3 + 3 + 3,
a(7) = 12 = 3*3 + 3, a(8) = 18 = (3+3)*3, a(9) = 27 = 3*3*3.
		

Crossrefs

Cf. A171827, A171828, A171829, A258068, A258069, A258070, A258071 (analog for four 4's, ..., ten 10's).

Programs

  • PARI
    vecextract([0..27],134484573) \\ Better programs to compute this are available in the related sequences, but they are much longer than this sequence itself. - M. F. Hasler, Nov 24 2018

A182002 Smallest positive integer that cannot be computed using exactly n n's, the four basic arithmetic operations (+, -, *, /), and the parentheses.

Original entry on oeis.org

2, 2, 1, 10, 13, 22, 38, 91, 195, 443, 634, 1121, 3448, 6793, 17692
Offset: 1

Views

Author

Ali Dasdan, Apr 05 2012

Keywords

Examples

			a(2) = 2 because two 2's can produce 0 = 2-2, 1 = 2/2, 4 = 2+2 = 2*2, so the smallest positive integer that cannot be computed is 2.
a(3) = 1 because no expression with three 3's gives 1.
		

Crossrefs

Programs

  • Maple
    f:= proc(n,b) option remember;
          `if`(n=1, {b}, {seq(seq(seq([k+m, k-m, k*m,
          `if`(m=0, NULL, k/m)][], m=f(n-i, b)), k=f(i, b)), i=1..n-1)})
        end:
    a:= proc(n) local i, l;
          l:= sort([infinity, select(x-> is(x, integer) and x>0, f(n, n))[]]);
          for i do if l[i]<>i then return i fi od
        end:
    seq(a(n), n=1..8); # Alois P. Heinz, Apr 13 2012
  • Python
    from fractions import Fraction
    from functools import lru_cache
    def a(n):
        @lru_cache()
        def f(m):
            if m == 1: return {Fraction(n, 1)}
            out = set()
            for j in range(1, m//2+1):
                for x in f(j):
                    for y in f(m-j):
                        out.update([x + y, x - y, y - x, x * y])
                        if y: out.add(Fraction(x, y))
                        if x: out.add(Fraction(y, x))
            return out
        k, s = 1, f(n)
        while k in s: k += 1
        return k
    print([a(n) for n in range(1, 10)]) # Michael S. Branicky, Jul 29 2022

Extensions

a(11)-a(12) from Alois P. Heinz, Apr 22 2012
a(13)-a(14) from Michael S. Branicky, Jul 29 2022
a(15) from Michael S. Branicky, Jul 27 2023

A258097 Number of nonnegative integers that can be computed using exactly n n's and the four basic arithmetic operations {+, -, *, /}.

Original entry on oeis.org

1, 3, 9, 26, 68, 198, 536, 1660, 4769, 15945, 46240, 165732, 488268, 1848866, 5852344
Offset: 1

Views

Author

Alois P. Heinz, May 19 2015

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local f; f:=
           proc(m) option remember; `if`(m=1, {n}, {
             seq(seq(seq([x+y, x-y, x*y, `if`(y=0, [][], x/y)
             ][], y=f(m-j)), x=f(j)), j=1..m-1)})
           end; forget(f);
           nops([select(z->z>=0 and is(z, integer), f(n))[]])
        end:
    seq(a(n), n=1..9);
  • Mathematica
    a[n_] := a[n] = Module[{f}, f[m_] := f[m] = If[m == 1, {n},
         Union@ Flatten@ Table[Table[Table[{x + y, x - y, x*y,
         If[y == 0, Nothing, x/y]}, {y, f[m-j]}], {x, f[j]}], {j, m-1}]];
       Length[Select[f[n], # >= 0 && IntegerQ[#]&]]];
    Table[a[n], {n, 1, 9}] (* Jean-François Alcover, Aug 29 2021, after Alois P. Heinz *)
  • Python
    from fractions import Fraction
    from functools import lru_cache
    def a(n):
        @lru_cache()
        def f(m):
            if m == 1: return {Fraction(n, 1)}
            out = set()
            for j in range(1, m):
                for x in f(j):
                    for y in f(m-j):
                        out.update([x + y, x - y, x * y])
                        if y: out.add(Fraction(x, y))
            return list(out)
        return sum(num >= 0 and num.denominator == 1 for num in f(n))
    print([a(n) for n in range(1, 10)]) # Michael S. Branicky, Aug 29 2021 after Alois P. Heinz

Extensions

a(13)-a(14) from Giovanni Resta, May 20 2015
a(15) from Michael S. Branicky, Aug 29 2021

A373301 Sum of successive nonnegative integers in a row of length p(n) where p counts integer partitions.

Original entry on oeis.org

0, 3, 12, 40, 98, 253, 540, 1199, 2415, 4893, 9268, 17864, 32421, 59265, 104632, 184338, 315414, 540155, 901845, 1504173, 2461932, 4013511, 6443170, 10314675, 16281749, 25608450, 39838855, 61716941, 94682665, 144726102
Offset: 1

Views

Author

Olivier Gérard, May 31 2024

Keywords

Comments

The length of each row is given by A000041.
As many sequences start like the nonnegative integers, their row sums when disposed in this shape start with the same values.
Here is a sample list by A-number order of the sequences which are sufficiently close to A001477 to have the same row sums for at least 8 terms: A089867, A089868, A089869, A089870, A118760, A123719, A130696, A136602, A254109, A258069, A258070, A258071, A266279, A272813, A273885, A273886, A273887, A273888.

Examples

			Illustration of the first few terms
.
0   | 0
3   | 1,  2
12  | 3,  4,  5
40  | 6,  7,  8,  9,  10
98  | 11, 12, 13, 14, 15, 16, 17
253 | 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
540 | 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43
.
		

Crossrefs

Cf. A373300, original version, with positive integers A000027.
Cf. A001477, the nonnegative integers.
Cf. A027480, the sequence of row sums for a regular triangle.

Programs

  • Mathematica
    Module[{s = -1},
     Table[s +=
       PartitionsP[
        n - 1]; (s + PartitionsP[n]) (s + PartitionsP[n] - 1)/2 -
       s (s - 1)/2, {n, 1, 30}]]
Showing 1-10 of 13 results. Next