You wrote:

The bases that exit for one selected period (your proc) are pairwise conected to another base in the set. I can see this in the plots.
So it's possible to run only the half of the loop with some extra calculations for pairfinding. I think this may reduce the time to 60% of running the fulll loop.
Yes, both of those observations are essentially correct, but actually the time reduction is usually much greater. The "orbits" of a given base with respect to a given period are not just pairs but have size totient(period). So, for example, for period = 11, the bases come in groups of size totient(11) = 10. Knowing any one base in that orbit, the other 9 are trivial to generate. Here is a program for it:
restart:
Periods:= module()
export
#prime factorization in convenient list form (see ?ifactors):
Ifactors:= (n::posint)> (thisproc(n):= ifactors(n)[2]),
#prefactored form of the totient, making it more efficient to compute the
#Carmichael number at the same time:
TotSeq:= (n::posint)>
local p;
(thisproc(n):= [seq]((p[1]1)*p[1]^(p[2]1), p= Ifactors(n))),
#Euler's totient function:
Totient:= (n::posint)> (thisproc(n):= mul(TotSeq(n))),
#Carmichael's lambda function:
Carmichael:= (n::And(posint, Not(1)))>
local T:= TotSeq(n);
(thisproc(n):= ilcm(`if`(n::even and T[1]>2, [T[1]/2, T[2..][]], T)[])),
#list of prime divisors of n:
PrimeDivisors:= (n::posint)> (thisproc(n):= op~(1, Ifactors(n))),
#Carmichael number reduced by its prime divisors:
PreCarmichael:= (n::And(posint, Not(1)))>
local L:= Carmichael(n);
(thisproc(n):= iquo~(L, PrimeDivisors(L))),
(* Find any element of order Carmichael(n). The optional table Ex contains
elements to NOT check. The optional 3rd argument St is the element
to start with. *)
Generator:= proc(
n::And(posint, Not({1,2})), Ex::table:= table('sparse'), St::posint:= 2
)
local E:= PreCarmichael(n), a, e;
for a from St to n1 do
if Ex[a]=0 and igcd(a,n)=1 and andseq(a&^e mod n <> 1, e= E) then
return a
fi
od;
FAIL
end proc,
#Find the elements of order ord. The optional 3rd argument NG is the
#maximum number of generators to use.
Bases:= proc(
n::And(posint, Not({1,2})),
ord::And(posint, Not(1)),
NG::posint:= infinity
)
local
Ex:= table('sparse'), L:= Carmichael(n), LP:= iquo(L, ord),
E:= select(igcd=1, [$1..ord1], ord), EG:= select(igcd=1, [$1..L1], L),
G, e, g:= 1, r, ng:= 0, h, TT:= Totient(Totient(n))
;
if irem(L, ord) <> 0 then return {} fi;
E:= E[2..] ~ E[..2];
EG:= EG[2..] ~ EG[..2];
{
to NG while ng <> TT and (g:= Generator(n, Ex, g+1)) <> FAIL do
G:= e> (thisproc(e):= g&^e mod n);
Ex[(h:= g)]:= 1; ng++;
for e in EG do
if Ex[(h:= h*G(e) mod n)]=0 then Ex[h]:= 1; ng++ fi
od;
r:= g&^LP mod n;
G:= e> (thisproc(e):= r&^e mod n);
((h:= r), seq((h:= h*G(e) mod n), e= E))
od
}
end proc
;
end module
:
den:= 11842585: #same number that you used
NumberTheory:Divisors(Periods:Carmichael(den));
{1, 2, 3, 4, 6, 7, 11, 12, 13, 14, 21, 22, 26, 28, 33, 39, 42,
44, 52, 66, 77, 78, 84, 91, 132, 143, 154, 156, 182, 231, 273,
286, 308, 364, 429, 462, 546, 572, 858, 924, 1001, 1092, 1716,
2002, 3003, 4004, 6006, 12012}
bases11:= CodeTools:Usage(Periods:Bases(den, 11));
memory used=287.81MiB, alloc change=0 bytes,
cpu time=4.28s, real time=3.79s, gc time=703.12ms
bases11 := {207496, 299716, 338141, 484156, 514896, 561006,
568691, 737761, 853036, 1029791, 1098956, 1237286, 1367931,
1452466, 1544686, 1590796, 1598481, 1752181, 1767551, 1844401,
2105691, 2128746, 2159486, 2267076, 2282446, 2359296, 2482256,
2620586, 2781971, 2797341, 3135481, 3143166, 3189276, 3312236,
3389086, 3573526, 3658061, 3673431, 4026941, 4188326, 4418876,
4457301, 4541836, 4603316, 4634056, 4733961, 4933771, 5202746,
5248856, 5448666, 5487091, 5663846, 5717641, 5733011, 5871341,
5963561, 6086521, 6148001, 6224851, 6247906, 6401606, 6601416,
6662896, 6747431, 6793541, 6901131, 7031776, 7208531, 7254641,
7277696, 7308436, 7431396, 7546671, 7631206, 7723426, 7777221,
8207581, 8292116, 8307486, 8338226, 8445816, 8660996, 8722476,
8799326, 8807011, 8822381, 8960711, 8976081, 9052931, 9091356,
9175891, 9268111, 9314221, 9321906, 9337276, 9368016, 9490976,
9606251, 9690786, 9752266, 9783006, 9852171, 9882911, 10082721,
10205681, 10397806, 10505396, 10636041, 10782056, 10812796,
10858906, 10912701, 11020291, 11035661, 11296951, 11373801,
11550556, 11627406, 11665831, 11811846}