login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Restricted growth sequence transform of A293222, a product formed from the 2-digits present in the ternary expansions of proper divisors of n.
10

%I #8 Oct 18 2017 00:56:12

%S 1,1,1,2,1,2,1,2,1,3,1,4,1,4,2,5,1,4,1,3,6,3,1,7,2,2,1,5,1,7,1,7,2,5,

%T 4,8,1,9,1,10,1,11,1,12,4,12,1,13,6,14,4,14,1,8,3,15,16,3,1,17,1,2,18,

%U 15,2,11,1,7,9,19,1,20,1,2,21,12,4,11,1,22,1,3,1,23,5,4,2,22,1,24,6,25,1,12,9,26,1,14,4,27,1,13,1,28,23,14,1,29,1,30

%N Restricted growth sequence transform of A293222, a product formed from the 2-digits present in the ternary expansions of proper divisors of n.

%H Antti Karttunen, <a href="/A293224/b293224.txt">Table of n, a(n) for n = 1..19683</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 A289814(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==2, 1, 0)), 2); } \\ From _Remy Sigrist_

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

%o write_to_bfile(1,rgs_transform(vector(19683,n,A293222(n))),"b293224.txt");

%Y Cf. A293222.

%Y Cf. also A290092, A293223, A293215, A293217, A293232, A293225, A293226.

%K nonn

%O 1,4

%A _Antti Karttunen_, Oct 03 2017