login
Lexicographically earliest infinite sequence such that a(i) = a(j) => A365711(i) = A365711(j) for all i, j >= 1, where A365711 is the Dirichlet inverse of balanced ternary enumeration of integers (A117966).
3

%I #9 Oct 06 2023 21:22:57

%S 1,1,2,2,3,2,4,2,5,6,7,8,9,10,11,11,12,5,13,5,14,15,16,8,17,9,5,18,19,

%T 20,21,22,23,24,21,5,25,26,27,28,29,30,31,32,5,12,33,34,34,28,17,35,6,

%U 5,36,37,38,39,40,5,41,21,5,42,43,44,45,46,47,48,49,5,50,25,51,52,4,27,53,5,5,54,55,56,57,58,59,60,61,5

%N Lexicographically earliest infinite sequence such that a(i) = a(j) => A365711(i) = A365711(j) for all i, j >= 1, where A365711 is the Dirichlet inverse of balanced ternary enumeration of integers (A117966).

%C Restricted growth sequence transform of A365711.

%C For all i, j: a(i) = a(j) => A365428(i) = A365428(j) => A359377(i) = A359377(j).

%H Antti Karttunen, <a href="/A366293/b366293.txt">Table of n, a(n) for n = 1..59049</a>

%o (PARI)

%o up_to = 3^10;

%o rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };

%o DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(d<n, v[n/d]*u[d], 0)))); (u) }; \\ Compute the Dirichlet inverse of the sequence given in input vector v.

%o A117966(n) = subst(Pol(apply(x->if(x == 2, -1, x), digits(n, 3)), 'x), 'x, 3); \\ From A117966

%o v366293 = rgs_transform(DirInverseCorrect(vector(up_to,n,A117966(n))));

%o A366293(n) = v366293[n];

%Y Cf. A117966, A359377, A365428, A365711.

%K nonn

%O 1,3

%A _Antti Karttunen_, Oct 06 2023