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”).

Lexicographically earliest such sequence a that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = 0 for odd primes, and A007947(n) for any other number.
10

%I #6 Dec 18 2018 17:04:47

%S 1,2,3,2,3,4,3,2,5,6,3,4,3,7,8,2,3,4,3,6,9,10,3,4,11,12,5,7,3,13,3,2,

%T 14,15,16,4,3,17,18,6,3,19,3,10,8,20,3,4,21,6,22,12,3,4,23,7,24,25,3,

%U 13,3,26,9,2,27,28,3,15,29,30,3,4,3,31,8,17,32,33,3,6,5,34,3,19,35,36,37,10,3,13,38,20,39,40,41,4,3,7,14,6,3,42,3,12,43

%N Lexicographically earliest such sequence a that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = 0 for odd primes, and A007947(n) for any other number.

%C For all i, j:

%C a(i) = a(j) => A066086(i) = A066086(j),

%C a(i) = a(j) => A322354(i) = A322354(j).

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

%o (PARI)

%o up_to = 65537;

%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 A007947(n) = factorback(factorint(n)[, 1]);

%o Aux322591(n) = if((n>2)&&isprime(n),0,A007947(n));

%o v322591 = rgs_transform(vector(up_to, n, Aux322591(n)));

%o A322591(n) = v322591[n];

%Y Cf. A007947, A305801, A322587, A322588, A322589, A322590, A322592.

%K nonn

%O 1,2

%A _Antti Karttunen_, Dec 18 2018