This site is supported by donations to The OEIS Foundation.
User:Nathan L. Skirrow
Contents
OEIS links
sequences I authored, edit history, currently-open drafts search results for my name (containing notes upon other sequences)
Me
I have a Github account, on which I share mainly suspicious Python programs (though I began using Scratch). My first large endeavour in Python (in which my understanding became functionally complete) was my tablebase program, which renders and simulates state transition diagrams in 3D, and led to the creation of A357723 and A357740 (enumerating king positions under symmetry, that arise in tablebases), and A358339 (enumerating positions with each distance to mate in a king and rook vs. king (KRvK) endgame). After learning about the Pólya enumeration theorem, I made A361870 (counting 2-colorings of hypercube arrays under their symmetry groups).
I have a LifeWiki account (with somewhat more of a synopsis than this), and have made many more contributions there than here (many of which are from using my Life simulator to identify interesting and notable patterns in Catagolue, but a few technical articles as well).
I will use this page as something of a buffer in which to store things before submitting them.
Ideas for future sequences
I have several, but unfortunately the draft approval process very often takes many weeks (or even months) after a sequence is complete, so most of the time I am waiting.
- c-colourings of hexagonal arrays of edge length n+1 (equivalently, number of transitions in c-state INT rules in range-n hexagonal neighbourhoods), (c3*n*(n+1)+1+3*c(3*n+2)*(n+1)/2+3*c(3*n2+4*n+2)//2+c3*n*(n+1)/2+1+2*cn2+n+1+2*cn*(n+1)/2+1)/12, probably the sequence will be for c=2 like A054247.
- In One-dimensional cellular automaton/Wolfram rule, I noted that for n>=1, there are (22n+2(2n+2(n+1)//2)/2+22n-1+n%2)/4 nonequivalent Wolfram rules on a width-n neighbourhood under action of left/right reflection and black/white reversal (where the second term's exponent is A005418(n+1)=A361870(1,n)). (For n=0, probably there should be considered to be 1, from the empty set to itself, or perhaps it should be forgone.) Note that as an enumeration of equivalence classes of boolean functions under four actions (from compositions of the two self-inverse functions: bitwise reversal and NOT of their truth tables (rule integers), equivalently complementing the colours and inverting the axial positions within a hypercube; and reversal of binary representations of bits' indexes (reversing the order of precedence of the axes), it is Θ(22n/4), whereas A000616 has a n!*2n actions so is Θ(22n/(n!*2n)).
- In a similar manner to A361870, I found some equations for 2-colorings of n-dimensional orthoplexes inscribed within edge-length-k hypercubes (equivalently, INT transitions in higher-range von Neumann neighbourhoods in higher-dimensional cellular automata), I would like to make a similar array by antidiagonals for them eventually. As with A361870, a(1,k)=A005418(k+1)=(2k+2(k+1)//2)/2, however for a(2,k),
- ( 2(k2+1)/2+2*2(k+1)2/4+2*2k*(k+1)/4+2(k2+3)/4+2*2(k2+7)/8
.if k≡3 (mod 4) else
. 2k*(k+2)/2+2*2(k+1)*(k+2)/4+3*2k*(k+2)/4+2*2k*(k+2)/8
.if k≡2 (mod 4) else
. 2(k2+1)/2+2*2(k+1)2/4+2*2(k2+k+2)/4+2(k2+3)/4+2*2(k2+7)/8
.if k≡1 (mod 4) else
. 2k*(k+2)/2+2*2k*(k+3)/4+3*2k*(k+2)/4+2*2k*(k+2)/8)/8
- ( 2(k2+1)/2+2*2(k+1)2/4+2*2k*(k+1)/4+2(k2+3)/4+2*2(k2+7)/8
- though there is a nicer form (in terms of floordivs) over the vertex- and cell-centred cases (but seemingly not both together),
- ( 2(k2+1)/2+2*2(k+1)2/4+2*2((k+1)//2)2-(k+1)//4+2(k2+3)/4+2*2(k2+7)/8
.if k≡1 (mod 2) else
. 2k*(k+2)/2+2*2(k+2)*(k+1)//4+3*2k*(k+2)/4+2*2k*(k+2)/8)/8
- ( 2(k2+1)/2+2*2(k+1)2/4+2*2((k+1)//2)2-(k+1)//4+2(k2+3)/4+2*2(k2+7)/8
- and for a(3,k) (octahedra),
- ( 2k*(k2+5)/6+3*2k*(k2+11)/12+3*2(k3+3*k2+5*k+3)/12+6*2(2*k3+3*k2+10*k+9)/24+6*2(k3+8*k+6-k%4*3)/12+2(k3+5*k+6)/12+8*2(k3+9*k+8*((k+1)%3-1))/18+6*2k*(k2+23)/24+6*2(k3+11*k+12)/24+8*2(k3+9*k+18+8*((k+1)%3-1))/36
.if k≡1 (mod 2) else
. 2k*(k3+6*k+8)/6+13*2k*(k2+6*k+8)/12+6*2(2*k3+15*k2+28*k+k%4*6)/24+8*2(k3+6*k2+12*k+k%3*8)/18+12*2k*(k2+6*k+8)/24+8*2((k3+6*k2+12*k+k%3*8)/36)/48
- ( 2k*(k2+5)/6+3*2k*(k2+11)/12+3*2(k3+3*k2+5*k+3)/12+6*2(2*k3+3*k2+10*k+9)/24+6*2(k3+8*k+6-k%4*3)/12+2(k3+5*k+6)/12+8*2(k3+9*k+8*((k+1)%3-1))/18+6*2k*(k2+23)/24+6*2(k3+11*k+12)/24+8*2(k3+9*k+18+8*((k+1)%3-1))/36
- In my dimensional INT enumerator program, the function permutatenumerator allows for 2- and k-colourings of edge-length-k hypercubes in n dimensions, however differing from A361870 in considering equivalence under action of not only reflection through diagonals (axis-swapping) but also swapping of cells in the n-1-dimensional hyperplanes through it. Notably, the k-colourings one is a better generalisation of A000616 than A361870 is, because it computes nonequivalent n-adic k-ary functions under action of permuting inputs and mapping individual inputs through bijective functions.
Minor things to perhaps note
- The g.f. for A000975 is provided in both factorised and expanded form, however its e.g.f. (4*e2*x-3*ex-e-x)/6 factorises to (1-e-x)*(4*e2*x+ex+1)/6.
- If Vaclav Kotesovec's conjecture for A225552 is correct (which is strongly suggested by the fact that A358339(n,2*A225552(n)) seems to become constant for odd n>=15, I imagine it does for even n>=26 but will need to run my program for longer to check),
- the g.f. is x3*(x28-x27-x22+x21-x15+x14-x13+x12+x10-x8-x7-x6+2*x5+2*x4+2*x3+3*x2+4*x+3)/((1-x)2*(1+x)*(1-x+x2)*(1+x+x2)) (the denominator expands to 1-x-x6+x7, making it linear-recurrent with signature (1,0,0,0,0,1,-1), the one shared by all with 6-periodic first differences)
- the e.g.f. is (7*(x-1)*ex-e-x-x3+((x6-(x9+(x11-x24/15543540607795200)/110)/504)/40-sqrt(3)*(3*ex/2+e-x/2)*sin(sqrt(3)*x/2)+6*cos(sqrt(3)*x/2)*cosh(x/2))/6)/3+3-x2 (however maybe I ought not to put that :-)
Python functions to eventually add for computing sequences
- A235791, 72.2 times faster (in testing) than Indranil Ghosh's existing version (that was made before Python 3.8's introduction of isqrt and needlessly converts back and forth to floats and computes sqrt to unnecessary precision),
from math import isqrt A002024=lambda n: isqrt(8*n)+1>>1 A235791=lambda n,k: (n+(k*(1-k)>>1))//k for n in range(1,21): print([A235791(n,k) for k in range(1,A002024(n+1))]) A006463=lambda n: (lambda r: r*(r**2-1+3*(n-r*(r+1)//2))//3)(A003056(n)) A235791index=lambda n,k: A006463(n)+k
- I made an edit to A030101, which reworded much to be clearer and removed the trivially wrong conjecture, before Kevin Ryde told me not to interfere with other people's comments. I intended to add a program, which provides the well-known method in O(log(n)) operations, with both in-place-mutation-based and closed forms for the masks (in Python, due to its bigints),
def A030101(n): #commented versions of lines provide alternative way not dependent on preceding iterations b=n.bit_length()-1 l=b.bit_length() o=c=(1<<(1<<l))-1 for i in range(l): s=1<<l+~i #s=1<<i o^=o<<s #o=c//((1<<(s<<1))-1)*((1<<s)-1) n=(n&o)<<s|n>>s&o return(n>>(1<<l)+~b), but he said it was inferior because it was slower than the trivial A030101=lambda n: int(bin(n)[:1:-1],2), maybe I will try again with it in the future.
- Colin Barker's conjecture on Jan 05 2016 about the closed form for A266725 (Total number of OFF (white) cells after n iterations of the "Rule 59" elementary cellular automaton starting with a single ON (black) cell.) is true (trivially from inspection, though maybe he assumed it would be more chaotic or fractal-like).
- It begins with a single on cell in an infinite tape of off cells.
- In iteration 1, all off cells with only off neighbours will become on (59&1=1), the one a single cell to the left of the on cell (59>>1&1=1) and right (59>>4&1=1) will also. The initial on cell, however, will become off (59>>2&1=0), it is equivalent to inverting the state.
- In iteration 2 (and all even ones >=2), the infinite tape outside the perturbation becomes off again (59>>7&1=0). The cell to the single off cell's left will also (59>>6&1=0), the off cell becomes on (59>>5&1=1), and the cell to its right remains on (59>>4&1=1), leaving two adjacent on cells in an infinite tape of off cells.
- In iteration 3 (and all odd ones >=3), as before the infinite tape outside the perturbation becomes off, and the cells to the left and right of the perturbation do so also, however inside it the left cell remains on (59>>3&1=1), only the right one becomes dead (59>>6&1=0) and thus the perturbation is comprised of only one off cell (and a(2*n+1)=a(2*n)+1).
- Hereafter, the resultant states in the cases for even and odd generations become each other (shifting right by one cell per two iterations), so by induction, the 'reference frame' in which the off cells are measured in even generations is of width 2*n+1 and we subtract the 2 on cells, so for n>=1, a(2*n)=a(2*n-1)+4*n-1, which provides the sequence.
- It has e.g.f. ((2*x2+4*x+1)*ex-(2*x+1)*e-x)/4 (or ((x2+3*x+1)*sinh(x)+x*(x+1)*cosh(x))/2 if you'd prefer) and is given (in languages with bitwise operators like Python and C) by A266725=lambda n: (n|1)**2>>1|n&1.
- I happened upon it because a(n) counts also the number of cells in a diamond on square lattices, inscribed in an n*n lattice-aligned square and with all cells no more than a Manhattan distance of n//2 from the centre (alternating between being vertex- and cell-centred). (Note that a(2*n+1)=a(2*n)+1 is provable geometrically, because if you shift each quadrant of the even-width one half a cell in the direction 45º clockwise from its direction from the centre, a single-cell gap is created in the centre.) (In the aforementioned potential von Neumann neighbourhood colouring sequence, it could thus be noted that a(2,k) ~ 2A266725(k)/8.)
- Integer arithmetic functions for all functions given in Michael Somos's document, Indexing Functions for Triangular or Rectangular Arrays, by order of appearance therein (comments are as of Jul 02 2023)
from math import isqrt A025581=lambda n: ((isqrt(n<<3|1)+1|1)**2>>3)+~n #similar to M. F. Hasler's A002262=lambda n: n-((isqrt(n+1<<3)-1|1)**2-1>>3) #equivalent to Michael S. Branicky's A004736=lambda n: ((isqrt(n<<3)+1|1)**2-1>>3)+1-n #equivalent to M. F. Hasler's but no allocation A002260=lambda n: n-((isqrt(n<<3)-1|1)**2-1>>3) #equivalent to M. F. Hasler's A003056=lambda n: isqrt(n<<3|1)-1>>1 #given by M. F. Hasler, more elegant than Chai Wah Wu's A002262=lambda n: n-((isqrt(n<<3|1)-1|1)**2-1>>3) #perhaps could be deemed more elegant than Michael S. Branicky's A002024=lambda n: isqrt(n<<3)+1>>1 #given by Chai Wah Wu A003057=lambda n: n and isqrt(n-1<<3)+3>>1 #not given in any language (equivalent to but more elegant than Chai Wah Wu's) A055086=lambda n: isqrt(n<<2|1)-1 #known A055087=lambda n: (n<<2|1)-isqrt(n<<2|1)**2>>2 #known A073188=lambda n: isqrt(24*(n+1))-3>>1 #seemingly not given in any language A073189=lambda n: n-(isqrt(24*(n+1))-1|1)**2//24 #neither is this A000194=lambda n: isqrt(n<<2)+1>>1 #more elegant than Chai Wah Wu's A048760=isqrt #trivial A053186=lambda n: n-isqrt(n)**2 #trivial A003059=lambda n: isqrt(n-1)+1 #added by Chai Wah Wu A071797=lambda n: n-isqrt(n-1)**2 #trivial
- The form for A073188 (defined as floor(sqrt(6n+6)-3/2)) is only due to multiplying by the offset's denominator before all floor-imparting operations (like isqrt) and floordivving by it thereafter, and for A073189 by inverting each operation (in a floor-taking manner) to get the smallest integer that could return the given value, but both only have definitions involving intermediate floating-point values (and thus precision loss).