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: Lee Burnette

Lee Burnette's wiki page.

Lee Burnette has authored 2 sequences.

A268754 The period of an n X 1 rectangular oscillator in the B1/S Life-like cellular automaton.

Original entry on oeis.org

1, 2, 1, 6, 4, 14, 1, 14, 12, 62, 8, 126, 28, 30, 1, 30, 28, 1022, 24, 126, 124, 4094, 16, 2046, 252, 1022, 56, 32766, 60, 62, 1, 62, 60, 8190, 56, 174762, 2044, 8190, 48, 2046, 252, 254, 248, 8190, 8188, 16777214, 32, 4194302, 4092, 510, 504, 134217726, 2044, 2097150
Offset: 1

Author

Lee Burnette, Feb 12 2016

Keywords

Comments

The seed in each case is a single live cell at the left end.
Terms of the form 2^k-1 have a period of 1 since all cells die.
In binary, all terms (except the 1's) have at least one 1 followed by at least one 0. The exceptions are the 36th and 94th terms and their derivatives, which have alternating 1's and 0's in their binary expansion.

Examples

			a(10) = 62 because a strip of 10 cells has period 62 in this rule.
		

Crossrefs

Even-indexed terms are exactly A160657. [corrected by Adam P. Goucher, Jan 13 2019]
Seems to be a shifted bisection of A334504 and A334507.

Programs

  • Mathematica
    g = Function[{sq, p}, Module[{l = Length[sq]},
    Do[If[sq[[i]] == sq[[j]], Return[p^(j - 1) - p^(i - 1)]],
    {j, 2, l}, {i, 1, j - 1}]]];
    MPM = Algebra`MatrixPowerMod;
    EventualPeriod = Function[{m, v, p},
    Module[{n = Length[m], w, sq, k, primes},
    sq = NestList[(MPM[#, p, p]) &, m, n];
    w = Mod[Last[sq].v, p];
    sq = Map[(Mod[#.w, p]) &, sq];
    k = g[sq, p];
    If[k == Null, k = p^n Apply[LCM, Table[p^r - 1, {r, 1, n}]]];
    primes = Map[First, FactorInteger[k]];
    primes = Select[primes, (# > 1) &];
    While[Length[primes] > 0,
    primes = Select[primes, (Mod[k, #] == 0) &];
    primes = Select[primes, (Mod[MPM[m, k/#, p].w, p] == w) &];
    k = k/Fold[Times, 1, primes];
    ]; k ]];
    mat = Function[{n}, Table[Boole[Abs[i - j] == 1], {i, 1, n}, {j, 1, n}]];
    vec = Function[{n}, Table[Boole[i == 1], {i, 1, n}]];
    Table[EventualPeriod[mat[n], vec[n], 2], {n, 1, 100}]
    (* Adam P. Goucher, Jan 13 2019 *)
  • Python
    def electron_period(n):
      wire_mask = (1 << n) - 1
      power = lam = 1
      tortoise, hare = 1, 2
      while tortoise != hare:
        if power == lam:
          tortoise = hare
          power *= 2
          lam = 0
        hare = ((hare << 1) ^ (hare >> 1)) & wire_mask
        lam += 1
      return lam

Formula

No general formula for even-indexed terms is known. For odd-indexed terms, a(2n+1) = 2*a(n), except when n is of the form (2^k - 1), in which case a(n) = 1.

A263542 Triangle T(M, N): Number of M X N matrices where 1

Original entry on oeis.org

24, 112, 376, 768, 2160, 20352, 5376, 5904, 86208, 51840, 64512, 56736, 1628352, 1342656, 44084736
Offset: 2

Author

Lee Burnette, Oct 20 2015

Keywords

Comments

This sequence is given in this order: (2,2), (3,2), (3,3), (4,2), (4,3), (4,4), etc.
The idea of the program below is that the first row, first column, and the (1,1)th element uniquely determine the rest of the matrix. Hence, all permutations of m+n integers in the range 0..m*n-1 are generated to fill the first row, first column, and (1,1). Then the empty spots in the matrix are filled in and if at any point a condition is violated (duplicate, < 0, >= M*N), the program immediately moves on to the next permutation.
Much of the conversation in the main chat room of the Programming Puzzles and Code Golf Stack Exchange site - the Nineteenth Byte - following the linked message in the Links section deals with finding the terms of this sequence.
Observation: at least the first 15 terms are divisible by 8. - Omar E. Pol, Oct 20 2015, Nov 21 2015
When M and N are both even, the block sum is 2(MN-1). When one or both is odd the block sum can vary: e.g., for M=N=3, it varies from 12 to 20. - Peter J. Taylor, Oct 21 2015
When M and N are both even, all solutions are toroidal: the block sums created by wrapping from the last column to the first column or the last row to the first row also equal 2(MN-1). When one of M or N is even, all solutions are cylindrical, with wrapping in the even dimension, but they are toroidal only in the trivial case of Odd X 2. When both M and N are odd, except in the trivial case of 1 X 1, solutions do not wrap in either direction. - Peter J. Taylor, Oct 21 2015

Examples

			One 3 X 3 solution (with a sum of 19) is:
   0 4 2
   8 7 6
   3 1 5
One 4 X 4 solution (with a sum of 30) is:
    0  3  4  7
   12 15  8 11
    1  2  5  6
   13 14  9 10
One 5 X 5 solution (with a sum of 48) is:
    0 24  1 23  2
    9 15  8 16  7
   10 14 11 13 12
   19  5 18  6 17
   20  4 21  3 22
The triangle T(M, N) begins:
M\N    2      3       4       5        6 ...
2:    24
3:   112    376
4:   768   2160   20352
5:  5376   5904   86208   51840
6: 64512  56736 1628352 1342656 44084736
...reformatted. - _Wolfdieter Lang_, Dec 16 2015
		

Programs

  • Python
    from itertools import permutations as P
    n = 4; m = 4; permutes = P(range(m*n), m+n); counter = 0
    for p in permutes:
      grid = [p[:n]]
      for i in range(m-1):
        grid.append([p[n+i]]+[-1]*(n-1))
      grid[1][1] = p[-1]
      s = p[0]+p[1]+p[n]+p[-1]
      has = list(p)
      fail = 0
      for y in range(1,m):
        for x in range(1,n):
          if x == y == 1: continue
          r = s - (grid[y-1][x-1] + grid[y-1][x] + grid[y][x-1])
          if r not in has and 0 <= r < m*n:
            grid[y][x]=r
            has.append(r)
          else:
           fail = 1
           break
        if fail: break
      if not fail:
        counter += 1
    print(counter)