## Number sequence puzzle

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

### Number sequence puzzle

Guess the next number in the sequence:

Code: Select all

``1, 6, 36, 146, 511, 1512``
Bozo knows the answer, although this required an embarrassingly large amount of coding time.

Big hint: it's tablebase related.

marcelk
Posts: 348
Joined: Fri Feb 26, 2010 11:21 pm
Contact:

### Re: Number sequence puzzle

sje wrote:Guess the next number in the sequence:

Code: Select all

``1, 6, 36, 146, 511, 1512``
Bozo knows the answer, although this required an embarrassingly large amount of coding time.

Big hint: it's tablebase related.
Is it different from 4032, with applications in chemistry (alkanes)? That would be really cool.

sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

### Re: Number sequence puzzle

marcelk wrote:Is it different from 4032, with applications in chemistry (alkanes)? That would be really cool.
You got it. Did you calculate the number, or did you find it somewhere?

Rémi Coulom
Posts: 426
Joined: Mon Apr 24, 2006 6:06 pm
Contact:

### Re: Number sequence puzzle

sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

### Re: Number sequence puzzle

The numbers are the counts of distinct endgame classes:

Code: Select all

``````    &#123; Tablebase class counts, each for N men &#125;

tbcm02len =     1;
tbcm03len =     6;
tbcm04len =    36;
tbcm05len =   146;
tbcm06len =   511;
tbcm07len =  1512;
tbcm08len =  4032;
tbcm09len =  9752;
tbcm10len = 21942;
``````
That this should match the alkane sequence first described in 1897 is quite unexpected.

The match ends at N=10 because at N=11 the KPPPPPPPPPK class would be included, but would be inadmissible as it has nine pawns and so is unreachable.

Ajedrecista
Posts: 1390
Joined: Wed Jul 13, 2011 7:04 pm
Location: Madrid, Spain.
Contact:

### Number sequence puzzle and interesting download.

Hello Steven:
sje wrote:Guess the next number in the sequence:

Code: Select all

``1, 6, 36, 146, 511, 1512``
Bozo knows the answer, although this required an embarrassingly large amount of coding time.

Big hint: it's tablebase related.
The hint was crucial. During much time I did not get it and also I forgot about thinking more in it. At 21:00 h in Madrid, Spain (which is GMT + 1) I turned off the computer and ten minutes later I realized about the key! But I decided to wait for the next day to answer: when you sad that was tablebase related I only thought about sorts of endgames, and I remembered 1, 5, 30, 110, ..., 1001 (I did not remember the number of different endgames in 6-man but yes in 7-man (because someone commented something somewhere a while ago (<ironic> I am highly accurate </ironic>) about Generator Chess), and I did not get that 6 = 1 + 5; 36 = 1 + 5 + 30; [...] and so on. A curious thing is that I searched this sequence in Google and I read about Losanitsch's Triangle (the first time I hear about that triangle), but I got nothing from there... it is like I would have K+Q (me) vs. K against Kasparov and I draw by stalemate... so silly!

I was going to try to calculate these numbers on my own (very risky) but I remember that once I downloaded an excellent Excel file about that! This forum is excellent and I recommend it. Here is where I downloaded it:

http://kirill-kryukov.com/chess/discuss ... 6be#p58156

TBs combinatorics.rar (351.75 KiB)

Great merit of user kronsteen. Please download it because it deserves the download. The numbers match: 2520 different types for 8-man and 1512 + 2520 = 4032 is the next number of this sequence.

I am curious about this required an embarrassingly large amount of coding time... how much time (if you want to say it)?

Regards from Spain.

Ajedrecista.

sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

### Re: Number sequence puzzle and interesting download.

Ajedrecista wrote:I am curious about this required an embarrassingly large amount of coding time... how much time (if you want to say it)?
It took hours of thought and coding, and the sad part is that I had solved a very similar problem (TB class dependency) long ago. My major mistake was to first try using the material signature as a sort of index variable; what I should have done from the start was to split the signature into its two color indexed components.

For details, send me your email address and I'll reply with the CookieCat source.

sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

### Re: Number sequence puzzle

Someone should inform OEIS and Wikipedia of the serendipitous discovery of this connection between chess and chemistry.

Thompson calculated the first four elements of the TB class name sequence some thirty years ago and the paraffin series has been around for more than a century. But apparently not until this week has anyone made the connection.

Ajedrecista
Posts: 1390
Joined: Wed Jul 13, 2011 7:04 pm
Location: Madrid, Spain.
Contact:

### Thank you Steven.

Hello Steven:
sje wrote:
Ajedrecista wrote:I am curious about this required an embarrassingly large amount of coding time... how much time (if you want to say it)?
It took hours of thought and coding, and the sad part is that I had solved a very similar problem (TB class dependency) long ago. My major mistake was to first try using the material signature as a sort of index variable; what I should have done from the start was to split the signature into its two color indexed components.

For details, send me your email address and I'll reply with the CookieCat source.
You are implied in some projects (run of Perft(13), BozoChess / CookeCat...) and the results seem to be fairly good! Congratulations. I wish you good luck.

You are so kind when you offer to share CookieCat sources, but I am not interested because I will not understand them. I am a total inexpert in programming: I do not know how to do the 'Hello world' exercise in any programming language (maybe in Fortran '90). So, if you want to share your sources, please do it with someone that will understand them. Sending me CookieCat sources is a total waste of time, be sure of it. Anyway, thanks for the offering: I really appreciate it.

Regards from Spain.

Ajedrecista.