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: Zach J. Shannon

Zach J. Shannon's wiki page.

Zach J. Shannon has authored 8 sequences.

A354049 The smallest number that includes all the digits of n but does not equal n.

Original entry on oeis.org

10, 10, 12, 13, 14, 15, 16, 17, 18, 19, 100, 101, 21, 31, 41, 51, 61, 71, 81, 91, 102, 12, 122, 32, 42, 52, 62, 72, 82, 92, 103, 13, 23, 133, 43, 53, 63, 73, 83, 93, 104, 14, 24, 34, 144, 54, 64, 74, 84, 94, 105, 15, 25, 35, 45, 155, 65, 75, 85, 95, 106, 16, 26, 36, 46, 56, 166, 76, 86, 96, 107
Offset: 0

Author

Keywords

Comments

The terms cannot start with a leading zero so any number including a zero must have at least one digit greater than zero as its first digit. See the examples below.

Examples

			a(9) = 19 as there is no smaller number that includes the digit 9 but does not equal 9.
a(10) = 100 as there is no smaller number that includes the digits 1 and 0 but does not equal 10. Note that '01' = 1 is not allowed.
a(20) = 102 as there is no smaller number that includes the digits 2 and 0 but does not equal 20. Note that '02' = 2 is not allowed.
a(22) = 122 as there is no smaller number that includes two 2 digits but does not equal 22.
a(200) = 1002 as there is no smaller number that includes two 0 digits and the digit 2 but does not equal 200.
		

Crossrefs

Programs

  • PARI
    vd(n) = my(d=if (n, digits(n), [0])); vector(10, k, #select(x->(x==k-1), d));
    isok(k, n, d) = if (k!=n, my(dd=vd(k)); for (i=1, #d, if (dd[i] < d[i], return(0))); return(1));
    a(n) = my(k=0, d=vd(n)); while(!isok(k, n, d), k++); k; \\ Michel Marcus, May 17 2022
    
  • Python
    def ok(k, n):
        if k == n: return False
        sk, sn = str(k), str(n)
        return all(sk.count(d) >= sn.count(d) for d in set(sn))
    def a(n):
        k = 0
        while not ok(k, n): k += 1
        return k
    print([a(n) for n in range(71)]) # Michael S. Branicky, May 23 2022

A351784 Number of cells containing one or more grains of sand after n grains of sand are added to one cell in an initially empty and infinite 3D cubic grid for the 3D sandpile model.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 6, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 24, 25, 25, 25, 25, 25, 24, 25, 25, 25, 25, 25, 24, 25, 25, 25, 25, 25, 24, 25, 25, 25, 25, 25, 24, 25, 25, 25, 25, 25, 24, 25, 25, 25, 25, 25, 24, 25, 25, 25, 25, 25, 24, 25, 25
Offset: 0

Author

Keywords

Comments

The 3D sandpile model follows the same rules as the 2D model except that cells topple and transfer one grain of sand to their six nearest neighbors when the cell contains 6 or more grains. Cells containing 0 to 5 grains are stable.

Crossrefs

Cf. A351783, A351379, A349990 (2D version), A307652, A259013, A180230.

A351783 Number of grains of sand required to be added to one cell at the origin in an initially empty and infinite 3D cubic grid for the 3D sandpile model such that the distance from the origin of the furthest nonempty cell along the axes is n.

Original entry on oeis.org

0, 6, 36, 162, 516, 1230, 2430, 3756, 5862, 9036, 12822, 16710, 22182, 28758, 36144, 45444, 54966, 66270, 78870, 93834, 109866, 127260, 146412, 169698, 192366, 218214, 244752, 273480, 307224, 341430, 380988, 420558, 463350, 510024, 558090, 611088, 664494, 723060, 784014, 844134, 921486
Offset: 0

Author

Keywords

Comments

The 3D sandpile model follows the same rules as the 2D model except that cells topple and transfer one grain of sand to their six nearest neighbors when the cell contains 6 or more grains. Cells containing 0 to 5 grains are stable.

Crossrefs

A351379 The number of grains of sand in the identity element for the 3D sandpile group on an n X n X n cubic grid.

Original entry on oeis.org

24, 54, 288, 480, 744, 1062, 1968, 2616, 3480, 4398, 6000, 7344, 9744, 11628, 14256, 16632, 20376, 23436, 27312, 30984, 37104, 41652, 47424, 52776, 60432, 66636, 75552, 82752, 93288, 101676, 112488, 121968, 135768, 146436, 163032, 175182, 191256, 204690, 221784, 236646, 257400, 273738, 296784
Offset: 2

Author

Keywords

Comments

The 3D sandpile model follows the same rules as the 2D model except that cells topple and transfer one grain of sand to their six nearest neighbors when the cell contains 6 or more grains. Cells containing 0 to 5 grains are stable.
See A307652 for details of the sandpile group identity.

Examples

			a(2) = 2 X 2 X 2 grid. Identity:
       Layer 1: | 3 3 |  Layer 2: | 3 3 |
                | 3 3 |           | 3 3 |  = 24 grains.
a(3) = 3 X 3 X 3 grid. Identity:
       Layer 1: | 3 2 3 |  Layer 2: | 2 1 2 |  Layer 3: | 3 2 3 |
                | 2 1 2 |           | 1 0 1 |           | 2 1 2 |
                | 3 2 3 |           | 2 1 2 |           | 3 2 3 |  = 54 grains.
		

Crossrefs

Cf. A307652 (square grid), A259013, A180230, A300006, A007341.

Formula

Identity element = ([10n] - ([10n])*)* , where [10n] is the all 10's grid of size n X n X n, and (x)* represents the topple stabilization of the grid x.
The sequence is approximately fitted by the cubic a(n) ~ 3.48*n^3, where 3.48 corresponds to the approximate grains-per-cube density of the identity element configurations.

A348090 Place the numbers 1 to n on a square grid and sum both numbers in all created orthogonally adjacent pairs; a(n) gives the maximum possible value of the sum of all pair sums.

Original entry on oeis.org

0, 3, 9, 20, 34, 53, 75, 101, 134, 168, 204, 247, 293, 344, 399, 456, 518, 585, 654, 725, 803, 886, 978, 1065, 1154, 1252, 1355, 1467, 1572, 1679, 1797, 1920, 2052, 2188, 2315, 2444, 2586, 2733, 2889, 3049, 3198, 3349, 3515, 3686, 3866, 4050, 4238, 4413, 4590, 4784, 4983, 5191, 5403, 5619
Offset: 1

Author

Keywords

Comments

On a square grid place the numbers 1 to n in any order or position. If any two numbers are orthogonally adjacent those two numbers are added, and the sum over all these pair sums is then found. The sequence gives the maximum possible value of this sum when placing numbers from 1 up to n.
Clearly, to maximize the sum all numbers should have one or more adjacent neighbors, and in general the larger numbers should be placed so that they appear in the most pairs so that their value contributes the most to the final sum. However, if two numbers have the same number of orthogonal neighbors then they can be switched since a number's contribution to the final sum is determined by the number of pairs it is in, not by the value of their pair neighbors.

Examples

			a(1) = 0 as the single number 1 has no neighbor to add to.
a(2) = 3 as the numbers 1 and 2 can be placed next to each other in one way, and the pair sum is 1+2 = 3.
a(3) = 9. The numbers 1,2,3 can be placed next to each other in six ways: 1-2-3, 1-3-2, 2-1-3, 2-3-1, 3-1-2, 3-2-1. The combinations with the largest pair sums are 1-3-2 and 2-3-1, the sum being (1+3)+(3+2) = 9. This is the largest sum as 3 is placed so that it is in two pairs and thus contributes twice to the sum.
a(4) = 20. The best way to arrange the numbers is in a 2 X 2 square. For example:
.
  1 2
  4 3
.
The sum is then (1+2)+(2+3)+(3+4)+(4+1) = 20. This is true for any permutation.
a(5) = 34. The best way to arrange the numbers is for 2,3,4,5 to be in a 2 X 2 square and for 1 to be placed next to 5. For example:
.
    2 3
  1 5 4
.
The sum is then (2+3)+(3+4)+(4+5)+(5+2)+(1+5) = 34.
a(6) = 53. The best way to arrange the numbers is in a 2 X 3 block where the 5 and 6 are in the middle of the long edge so that they both appear in three pairs. For example:
.
  2 6 4
  1 5 3
.
The sum is (2+6)+(6+4)+(1+5)+(5+3)+(2+1)+(6+5)+(4+3) = 53.
		

Crossrefs

Cf. A346069 (multiplication), A003056, A005408.

A343208 a(n) = Sum_{k=1..n} k*A001168(k)*binomial(n-1,k-1), where A001168(k) is the number of fixed polyominoes with k cells.

Original entry on oeis.org

1, 5, 27, 143, 744, 3832, 19636, 100348, 511969, 2608905, 13282011, 67567527, 343510966, 1745495390, 8865633276, 45013599940, 228478238613, 1159398424925, 5881978415019, 29835289653043, 151308803657699, 767245632538063, 3889991549017581, 19720295705928713, 99961847384995974
Offset: 1

Author

Keywords

Comments

This is the number of ways n blocks can be placed on a 2D grid such that, after the first block, each block touches at least one face of a previously placed block, and each block either touches the ground plane or is supported by a block below it. See the attached file for a derivation.
The number of ways n squares can be placed similarly on a 1D line is given by A001792.

Examples

			Considering the sequence as face-touching blocks:
a(1) = 1 as a single block can be placed in one way.
a(2) = 5 as, after the first block is placed, the second block can be placed so that it touches the ground plane and one of the four sides of the first block, or it can be placed directly on top of the first block, giving five total arrangements.
a(3) = 27 as the third block can be placed in one way directly on top of the tower of the two previous blocks, on the ground next to the tower of two blocks in four ways, next to one of the three faces of the second block on the ground plane or on top of the second block in 4*4 = 16 total ways, or on the ground plane touching one of the faces of the first block with the second block touching one of the other faces of the first block in 6 total ways. Summing the configurations gives 27 total ways the three blocks can be arranged.
		

Crossrefs

A335066 Decimal numbers such that when they are written in all bases from 2 to 10 those numbers all share a common digit (the digit 0 or 1).

Original entry on oeis.org

1, 81, 91, 109, 127, 360, 361, 417, 504, 540, 541, 631, 661, 720, 781, 841, 918, 981, 991, 1008, 1009, 1039, 1080, 1081, 1088, 1089, 1090, 1091, 1093, 1099, 1105, 1111, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1128, 1134, 1135, 1136, 1137, 1138, 1139
Offset: 1

Author

Keywords

Comments

As base 2 is included the only possible common digit between all the bases is either a 0 or 1.

Examples

			1 is a term as 1 written in all bases is 1.
81 is a term as 81_2 = 1010001, 81_3 = 10000, 81_4 = 1101, 81_5 = 311, 81_6 = 213, 81_7 = 144, 81_8 121, 81_9 = 100, 81_10 = 81, all of which contain the digit 1.
360 is a term as 360_2 = 101101000, 360_3 = 111100, 360_4 = 11220, 360_5 = 2420, 360_6 = 1400, 360_7 = 1023, 360_8 = 550, 360_9 = 550, 360_10 = 360, all of which contain the digit 0.
		

Programs

  • Python
    def hasdigits01(n, b):
        has0, has1 = False, False
        while n >= b:
            n, r = divmod(n, b)
            if r == 0: has0 = True
            if r == 1: has1 = True
            if has0 and has1: return (True, True)
        return (has0, has1 or n==1)
    def ok(n):
        all0, all1 = True, True
        for b in range(10, 1, -1):
            has0, has1 = hasdigits01(n, b)
            all0 &= has0; all1 &= has1
            if not all0 and not all1: return False
        return all0 or all1
    print([k for k in range(1140) if ok(k)]) # Michael S. Branicky, May 23 2022

A335051 a(n) is the smallest decimal number > 1 such that when it is written in all bases from base 2 to base n those numbers all contain both 0 and 1.

Original entry on oeis.org

2, 9, 19, 28, 145, 384, 1128, 2601, 2601, 101256, 103824, 382010, 572101, 971400, 1773017, 1773017, 22873201, 64041048, 64041048, 1193875201, 2496140640, 10729882801, 21660922801, 120068616277, 333679563001, 427313653201, 427313653201, 10436523921264, 10868368953601
Offset: 2

Author

Keywords

Comments

The sequence is infinite since 1 + lcm(2,...,n)^2 is always a candidate for a(n). - Giovanni Resta, May 24 2020

Examples

			a(3) = 9 as 9_2 = 1001 and 9_3 = 100, both of which contain a 0 and 1.
a(6) = 145 as 145_2 = 10010001, 145_3 = 12101, 145_4 = 2101, 145_5 = 1040, 145_6 = 401, all of which contain a 0 and 1.
a(9) = 2601 as 2601_2 = 101000101001, 2601_3 = 10120100, 2601_4 = 220221, 2601_5 = 40401, 2602_6 = 20013, 2601_7 = 10404, 2601_8 = 5051, 2601_9 = 3510, all of which contain a 0 and 1. Note that, as 2601 also contains a 0 and 1, a(10) = 2601.
a(16) = 1773017 as 1773017_2 = 110110000110111011001, 1773017_3 = 10100002010022, 1773017_4 = 12300313121, 1773017_5 = 423214032, 1773017_6 = 102000225, 1773017_7 = 21033101, 1773017_8 = 6606731, 1773017_9 = 3302108, 1773017_10 = 1773017, 1773017_11 = 1001104, 1773017_12 = 716075, 1773017_13 = 4A102C, 1773017_14 = 342201, 1773017_15 = 250512, 1773017_16 = 1B0DD9, all of which contain a 0 and 1.
		

Programs

  • Mathematica
    a[n_] := Block[{k=2}, While[ AnyTrue[ Range[n, 2, -1], ! SubsetQ[ IntegerDigits[k, #], {0, 1}] &], k++]; k]; a /@ Range[2, 13] (* Giovanni Resta, May 24 2020 *)
  • Python
    from numba import njit
    @njit
    def hasdigits01(n, b):
        has0, has1 = False, False
        while n >= b:
          n, r = divmod(n, b)
          if r == 0: has0 = True
          if r == 1: has1 = True
          if has0 and has1: return True
        return has0 and (has1 or n==1)
    @njit
    def a(n, start=2):
      k = start
      while True:
        for b in range(n, 1, -1):
          if not hasdigits01(k, b): break
        else: return k
        k += 1
    anm1 = 2
    for n in range(2, 21):
      an = a(n, start=anm1)
      print(an, end=", ")
      anm1 = an # Michael S. Branicky, Feb 09 2021

Extensions

a(29)-a(30) from Giovanni Resta, May 24 2020