login
Restricted growth sequence transform of A293231, where A293231(n) = Product_{d|n, d<n} A019565(A193231(d)).
8

%I #13 Jul 10 2021 03:52:19

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

%T 21,2,22,23,24,25,26,2,27,28,29,2,30,2,31,32,33,2,34,7,35,36,37,2,38,

%U 39,40,41,42,2,43,2,44,45,46,23,47,2,48,49,50,2,51,2,52,53,54,55,56,2,57,58,59,2,60,61,62,63,64,2,65,66,67,68,69,70,71,2,72

%N Restricted growth sequence transform of A293231, where A293231(n) = Product_{d|n, d<n} A019565(A193231(d)).

%H Antti Karttunen, <a href="/A293232/b293232.txt">Table of n, a(n) for n = 1..65537</a>

%o (PARI)

%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 write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }

%o A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from _M. F. Hasler_

%o A193231(n) = { my(x='x); subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2) }; \\ This function from _Franklin T. Adams-Watters_

%o A293231(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A193231(d)))); m; };

%o write_to_bfile(1,rgs_transform(vector(65537,n,A293231(n))),"b293232.txt");

%Y Cf. A019565, A193231.

%Y Cf. A290090.

%Y Differs from related A293215 for the first time at n=55, where a(55) = 39, while A293215(55) = 28.

%K nonn

%O 1,2

%A _Antti Karttunen_, Oct 03 2017