# The largest Saturday number

No weekend love yet shown, therefore I will fix that.

A Saturday number is a number in which for all $$1 \le i \le l$$, where $$l$$ is the length of the number, the first $$l$$ digits (from the left) divide by $$l$$. For example, 3816547290 is a valid Saturday number for 10, so your answer must, at minimum, be larger than or equal to that. Leading zeroes are not permitted.

If there is a largest Saturday number, find it, else, if there are an infinite number of them, find an example with 200 digits.

• should that be the first i digits divide by i? Jun 16 '21 at 15:07
• Cross-site duplicate of Find the largest number having this property. Jun 17 '21 at 4:48
• I’m voting to close this question because it already has an answer at math.stackexchange.com/questions/411897/… (cross-site duplicate) Jun 17 '21 at 12:45
• @Steve Voting to leave open; that's not a reason to close a question on this site. Jun 17 '21 at 19:00
• @JanIvan In general, I'd say what exists or not on another site shouldn't at all affect a question's closability on this site. Same way as we don't close/migrate questions just for being on-topic on another site, if they're also on-topic here. Not sure about any meta guideline though. Jun 18 '21 at 10:13

The more common name for a Saturday number is

There is a good argument for believing that they cannot grow to any length:

If you remove the last digit from a Polydivisible number you get a smaller Polydivisible number. Conversely, you can only get a length $$n$$ Polydivisible number if you append a digit $$d$$ to a length $$n-1$$ Polydivisible number $$q$$. For that to work you need $$q,d$$ to be such that $$10q+d\equiv 0 \bmod n$$. Only $$10$$ values are possible for the digit $$d$$, so no more than $$10$$ out of $$n$$ residue classes for $$10q \bmod n$$ allow this extension to work. Assuming that each residue class is equally probable, the probability that you can extend a Polydivisible number is $$10/n$$, so when $$n>10$$ you expected there to be fewer Polydivisible numbers remaining each time you try to extend them.

The longest Saturday number is:

3608528850368400786036725, which is 25 digits long.

To be honest, I wrote a computer program to find it, and only found the common name for this type of number after I googled the number that I found. These numbers are listed in the OEIS.

For those interested, here is the simple C# program I wrote:

  using System;
using System.Collections.Generic;
using System.Numerics;

namespace TempProg
{
class PSEsaturday
{
public static void Main()
{
List<BigInteger> current = new List<BigInteger>();
List<BigInteger> next = new List<BigInteger>();

for (int i = 1; i <= 9; i++)

int length = 1;
while(current.Count > 0)
{
length++;
foreach (var n in current)
{
for( int d=0; d<=9; d++)
{
var n2 = n * 10 + d;
if(n2 % length == 0)
{
Console.WriteLine(n2);
}
}
}
var t = current;
current = next;
next = t;
next.Clear();
}
}
}
}

• Perfect proof and answer - this is getting accepted. Jun 16 '21 at 15:36
• Nice! Could you share a pastebin link or something to your code too? I'm just curious to see how you did that. Jun 16 '21 at 15:48
• @KabirKanhaArora I added my program code. Jun 16 '21 at 15:59
• Curiously the OEIS cites the stackexchange network, bringing this full circle! Jun 17 '21 at 12:48
• Now that proof would imply that it might be possible to get bigger if you don't restrict yourself to base 10. I could see a potential OEIS for largest number in base N that meets the criteria... Jun 17 '21 at 13:34