Champernowne table, by diagonals

12 views
Skip to first unread message

Ruud H.G. van Tol

unread,
Sep 11, 2026, 5:36:29 PM (8 days ago) Sep 11
to seq...@googlegroups.com

Is this sequence in any way interesting?

I still don't think so, but it was fun to investigate.


(PARI)
? {
my(t=List(), w=32);

for(b=1, w\2
, my(r=List());
for(i=0, w
, listput(~r, if(b<2, 0, !i,[0], digits(fromdigits(digits(i,b)))))
);
listput(~t, concat(r))
);

for(i=1, #t, t[i]=t[i][1..w]);
t=Mat(Vec(t)~); printp(t);

my(r=List());
for(n=1, 12
, for(c=1, n, listput(~r, t[c, n+1-c]))
);
Vec(r)[1..w*2]
} \\ best ignore the messy code :)

[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 1 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0]
[0 1 2 1 0 1 1 1 2 2 0 2 1 2 2 1 0 0 1 0 1 1 0 2 1 1 0 1 1 1 1 1]
[0 1 2 3 1 0 1 1 1 2 1 3 2 0 2 1 2 2 2 3 3 0 3 1 3 2 3 3 1 0 0 1]
[0 1 2 3 4 1 0 1 1 1 2 1 3 1 4 2 0 2 1 2 2 2 3 2 4 3 0 3 1 3 2 3]
[0 1 2 3 4 5 1 0 1 1 1 2 1 3 1 4 1 5 2 0 2 1 2 2 2 3 2 4 2 5 3 0]
[0 1 2 3 4 5 6 1 0 1 1 1 2 1 3 1 4 1 5 1 6 2 0 2 1 2 2 2 3 2 4 2]
[0 1 2 3 4 5 6 7 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 2 0 2 1 2 2 2 3]
[0 1 2 3 4 5 6 7 8 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 2 0 2 1 2]
[0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0]
[0 1 2 3 4 5 6 7 8 9 1 0 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9]
[0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8]
[0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7]
[0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 0 1 1 1 2 1 3 1 4 1 5 1 6]
[0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 0 1 1 1 2 1 3 1 4 1 5]
[0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 0 1 1 1 2 1 3 1 4]
[...]

which gives:

[0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 2, 1, 0, 0, 1, 1, 2, 1, 0, 0, 1, 0,
3, 2, 1, 0, 0, 1, 1, 1, 3, 2, 1, 0, 0, 0, 1, 0, 4, 3, 2, 1, 0, 0, 0, 1,
1, 1, 4, 3, 2, 1, 0, 0, 1, 2, 1, 0, 5, 4, 3, 2, ...]

Of course the diagonals can also be done the other way around.
What also makes me hesitate, is the way that bases > 10 are done.

If you think this, or some variant of it, is interesting, then feel free
to pick it up and contribute it. Or try to convince me why I shouldn't
just forget about it.

-- Ruud

Ruud H.G. van Tol

unread,
Sep 11, 2026, 6:29:55 PM (8 days ago) Sep 11
to seq...@googlegroups.com
On 11/09/2026 23:36, 'Ruud H.G. van Tol' via SeqFan wrote:
>
> [0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 2, 1, 0, 0, 1, 1, 2, 1, 0, 0, 1, 0,
> 3, 2, 1, 0, 0, 1, 1, 1, 3, 2, 1, 0, 0, 0, 1, 0, 4, 3, 2, 1, 0, 0, 0, 1,
> 1, 1, 4, 3, 2, 1, 0, 0, 1, 2, 1, 0, 5, 4, 3, 2, ...]
It already looks more interesting if the terms are not limited to single
digits:

? { my(t=List(),w=120);for(b=1,w,my(r=List());
for(i=0,w,listput(~r,if(b<2,0,!i,[0],digits(i,b))));
listput(~t,concat(r))); for(i=1,#t,t[i]=t[i][1..w]); t=Mat(Vec(t)~);
printp(t); my(r=List()); for(n=1,w,for(c=1,n,listput(~r,t[n+1-c,c])));
Vec(r)[1..w*2] }

[...]

[0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 0, 1, 2, 1, 1, 0, 0, 1, 2,
3, 0, 1, 0, 0, 1, 2, 3, 1, 1, 1, 0, 0, 1, 2, 3, 4, 0, 1, 0, 0, 0, 1, 2,
3, 4, 1, 1, 1, 0, 0, 0, 1, 2, 3, 4, 5, 0, 1, 2, 1, 0, 0, 1, 2, 3, 4, 5,
1, 1, 1, 2, 0, 0, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 0, 1, 0, 0, 1, 2, 3, 4,
5, 6, 1, 1, 1, 1, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 1, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 2, 2, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7,
8, 0, 1, 2, 3, 0, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 1, 1, 1, 1, 2,
1, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 1, 0, 1, 0, 0, 1,
2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 1, 1, 1, 2, 2, 0, 1, 0, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 0, 2, 1, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8,
...]

as then the table has more structure.

-- Ruud

Reply all
Reply to author
Forward
0 new messages