login
A393817
Return time for an n X n picture by the baker's map.
0
1, 3, 6, 5, 72, 60, 18, 7, 660, 556920, 770, 1008, 985320, 339660, 34320, 9, 1670760, 15300, 61261200, 1244880, 6284880, 3006556993440, 199767760920, 15048, 26466884524080, 61710920040, 1163962800, 3661447149360, 50821170440040, 205980334560, 3262313854800, 11, 168473954880
OFFSET
1,2
COMMENTS
The baker's map is defined on [0,n-1]^2 by baker(i,j). Define (i1,j1) = ([i/2], 2*j + i mod 2). If j1 < n then baker(i,j) = (i1,j1); otherwise baker(i,j) = (n-1-i1, 2*n - 1 - j1).
a(n) is the smallest k so that baker^k(i,j) = (i,j) for each (i,j).
REFERENCES
Jean-Paul Delahaye, Jeux finis et infinis, Seuil, coll. Science ouverte, chap. 5 (Le retour surprise d'une image), p. 129-160.
LINKS
Jean-Paul Delahaye and Philippe Mathieu, Images brouillées, Images retrouvées, Pour la Science, no 242, décembre 1997, p. 102-106.
Wikipedia, Baker's map.
FORMULA
a(2^k) = 2*k + 1.
EXAMPLE
For n = 2:
a b
c d
becomes
a c
d b
then
a d
b c
then
a b
c d
so a(2) = 3.
MAPLE
baker:=proc(i, j, n) local i1, j1: i1:=iquo(i, 2); j1:=2*j+irem(i, 2); if j1<n then [i1, j1] else [n-1-i1, 2*n-1-j1] fi end:
pixelperiod:=proc(i, j, n) local U, m: U:=baker(i, j, n) : for m while not(U=[i, j]) do U:=baker(U[1], U[2], n) od : return(m) end:
U:=NULL:for n to 20 do period:=1:for i from 0 to n-1 do for j from 0 to n-1 do per:=pixelperiod(i, j, n): period:=lcm(period, per) od od:U:=U, period od:U;
PROG
(Python)
from math import lcm
def baker(i, j, n):
i1 = i // 2
j1 = 2 * j + (i % 2)
if j1 < n:
return [i1, j1]
else:
return [n - 1 - i1, 2 * n - 1 - j1]
def pixelperiod(i, j, n):
U = baker(i, j, n)
m = 1
while U != [i, j]:
U = baker(U[0], U[1], n)
m += 1
return m
U = []
for n in range(1, 33):
period = 1
for i in range(n):
for j in range(n):
per = pixelperiod(i, j, n)
period = lcm(period, per)
U.append(period)
print(U)
(PARI) baker(i, j, n) = my(i1 = i\2, j1 = 2*j + (i % 2)); if (j1 < n, [i1, j1], [n - 1 - i1, 2*n - 1 - j1]);
pixelp(i, j, n) = my(U = baker(i, j, n), m = 1); while (U != [i, j], U = baker(U[1], U[2], n); m ++); m;
a(n) = my(period = 1); for (i=0, n-1, for (j=0, n-1, period = lcm(period, pixelp(i, j, n); ); ); ); period; \\ Michel Marcus, Mar 05 2026
CROSSREFS
Sequence in context: A121867 A307132 A300673 * A335633 A009193 A144253
KEYWORD
nonn
AUTHOR
Robert FERREOL, Mar 01 2026
EXTENSIONS
More terms from Michel Marcus, Mar 05 2026
STATUS
approved