Number sequence puzzle

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Number sequence puzzle

Post by sje »

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.
User avatar
marcelk
Posts: 348
Joined: Sat Feb 27, 2010 12:21 am

Re: Number sequence puzzle

Post by marcelk »

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.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Number sequence puzzle

Post by sje »

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: 438
Joined: Mon Apr 24, 2006 8:06 pm

Re: Number sequence puzzle

Post by Rémi Coulom »

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Number sequence puzzle

Post by sje »

The numbers are the counts of distinct endgame classes:

Code: Select all

    { Tablebase class counts, each for N men }

    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.
User avatar
Ajedrecista
Posts: 1966
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Number sequence puzzle and interesting download.

Post by Ajedrecista »

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.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Number sequence puzzle and interesting download.

Post by sje »

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.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Number sequence puzzle

Post by sje »

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.
User avatar
Ajedrecista
Posts: 1966
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Thank you Steven.

Post by Ajedrecista »

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.