Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > rec.puzzles > #28058

Re: series puzzle

From Phil Carmody <pc+usenet@asdf.org>
Newsgroups rec.puzzles
Subject Re: series puzzle
Date 2026-08-31 22:22 +0300
Organization A noiseless patient Spider
Message-ID <87pkyy2izd.fsf@asdf.ee> (permalink)
References <8733vz45sz.fsf@asdf.ee> <116so5c$4t1g$1@artemis.inf.ed.ac.uk>

Show all headers | View raw


richard@cogsci.ed.ac.uk (Richard Tobin) writes:
> In article <8733vz45sz.fsf@asdf.ee>, Phil Carmody  <pc+usenet@asdf.org> wrote:
>>Bonus points for the mathmos: give an expression for how quickly this
>>series grows: how many digits would you expect the 1000th, 10000th,
>>100000th, and 1000000th terms to have?
> So if log10(N) is less than log10(T(N))/10 the number of digits
> will tend to reduce, otherwise it will tend to increase.  We will get
> equilibrium when log10(T(N)) = 10 log10(N), or T(N) = N^10.

Yup, that's the heuristic I arrived at too. It doesn't seem to deviate far:

10000000: [71]=11369436279154838514569735263935293883868829566247715738211151771131572
100000000: [90]=111892791617298738664974975189485467758117557576382896636315253382745554253755326351157248

I think I have a heuristic for your followup:

> Another bonus question: why do those all begin with 1?

As the numbers get multiplied by 997..., 998..., 999..., they shrink
towards 1, but cannot cross that barier. Were they able to flip from
11... to 109... they'd instead become 19.... However, as the
multiplicand grows beyond a couple of digits, even that gulf is
uncrossable, so the 111... instead would fail to flip to 1109 and hit
119... instead. Thus they are ultimately destined to just bounce around
somewhere just above 111...

I think this should be the 10^10th term:
10000000000: [101]=11115592733643186436631888321432897482694847579734846162383383488896288842919911525326836588516428648

In some ways, I'm surprised the string of leading 1s across the
odometric thresholds isn't growing as fast as I would expect it to.

The longest value I reached was term 7563152347 at 133 digits.
The shortest outliers are in the 50+ digits range:

[54]=19157 - 9992661725
[53]=14828 - 9547032791
[52]=18363 - 9428280749
[51]=13518 - 9323809783
[50]=12069 - 8444484882

[length]=first appearance - last appearance

So I'm sure length 54 will be seen again, not so sure about the others.

Source, for the interested, follows. (Took <4 hours on a repurposed
set-top box, so it's probably easier to just start it running on a fast
machine rather than modifying the code to be able to resume.)

Phil

----- 8< --- BEGIN: ftcrl.c ---
#if 0
exec /usr/bin/tcc -run "$0" "$@"
#endif

#define LMAX 400
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

unsigned int mul(unsigned char *buf, unsigned int l, unsigned long m)
{
    unsigned long carry=0;
    unsigned int pin, pout;
    while(m%10==0) { m/=10; }
    for(pout=pin=0; pin<l; ++pin) {
	unsigned long v=buf[pin]*m+carry;
	if(v%10) { buf[pout++]=v%10; }
	carry=v/10;
    }
    while(carry) {
	while(carry%10==0) { carry/=10; }
	buf[pout++]=carry%10;
	carry/=10;
    }
    return pout;
}
void print(unsigned long n, const unsigned char *buf, unsigned int l)
{
    printf("%lu: [%u]=", n, l);
    while(l-->0) { putchar(buf[l]+'0'); }
    puts("");
}
int main(int argc, char **argv)
{
    unsigned long max=argc>1?strtoull(argv[1],NULL,0):24;
    int verbosity=argc>2?atoi(argv[2]):1;
    unsigned char buffer[LMAX]={1,0};
    unsigned int len=1;
    unsigned long n=0;
    unsigned long lastl[LMAX]={0};
    unsigned long firstl[LMAX]={0};
    unsigned int lmax=0;
    while(n<max) {
	n++;
	len=mul(buffer, len, n);
	if(verbosity>1||n%1000000==0) { print(n,buffer,len); }
	else if(verbosity==1||n%100000==0) { printf("%lu: %u\n", n, len); }
	lastl[len]=n;
	if(len>lmax) { lmax=len; }
	if(!firstl[len]) { firstl[len]=n; }
    }
    if(verbosity<=1) { print(n, buffer, len); }
    do {
	printf("[%u]=%lu - %lu\n", lmax, firstl[lmax], lastl[lmax]);
    } while(lmax-->0);
}
----- 8< --- END: fctrl.c ---

-- 
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

Back to rec.puzzles | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

series puzzle Phil Carmody <pc+usenet@asdf.org> - 2026-08-28 00:22 +0300
  Re: series puzzle David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> - 2026-08-28 08:56 +0000
  Re: series puzzle richard@cogsci.ed.ac.uk (Richard Tobin) - 2026-08-28 17:54 +0000
  Re: series puzzle richard@cogsci.ed.ac.uk (Richard Tobin) - 2026-08-28 19:39 +0000
    Re: series puzzle richard@cogsci.ed.ac.uk (Richard Tobin) - 2026-08-28 19:49 +0000
      Re: series puzzle David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> - 2026-08-30 08:49 +0000
        Re: series puzzle richard@cogsci.ed.ac.uk (Richard Tobin) - 2026-08-30 11:51 +0000
    Re: series puzzle richard@cogsci.ed.ac.uk (Richard Tobin) - 2026-08-30 12:06 +0000
      Re: series puzzle Phil Carmody <pc+usenet@asdf.org> - 2026-09-01 12:14 +0300
        Re: series puzzle richard@cogsci.ed.ac.uk (Richard Tobin) - 2026-09-01 10:03 +0000
          Re: series puzzle richard@cogsci.ed.ac.uk (Richard Tobin) - 2026-09-05 10:11 +0000
            Re: series puzzle richard@cogsci.ed.ac.uk (Richard Tobin) - 2026-09-05 10:51 +0000
              Re: series puzzle David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> - 2026-09-06 07:52 +0000
    Re: series puzzle Phil Carmody <pc+usenet@asdf.org> - 2026-08-31 22:22 +0300

csiph-web