login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(n) = A000265(n) for all other numbers, except that f(n) = 0 if n is an odd prime, and f(1) = -1 and f(2) = -2.
2

%I #6 Mar 04 2019 23:09:54

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

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

%U 3,9,3,27,28,4,29,15,3,16,30,17,3,6,3,31,32,18,33,19,3,7,34,35,3,10,36,37,38,11,3,20,39,21,40,41,42,5,3,22,43,12,3,23,3,13,44

%N Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(n) = A000265(n) for all other numbers, except that f(n) = 0 if n is an odd prime, and f(1) = -1 and f(2) = -2.

%C For all i, j:

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

%H Antti Karttunen, <a href="/A324399/b324399.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 A000265(n) = (n/2^valuation(n, 2));

%o Aux324399(n) = if(n<3,-n,if(isprime(n),0,A000265(n)));

%o v324399 = rgs_transform(vector(up_to, n, Aux324399(n)));

%o A324399(n) = v324399[n];

%Y Cf. A000040, A000265, A003602, A322809, A324401.

%K nonn

%O 1,2

%A _Antti Karttunen_, Mar 01 2019