login

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

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

%I #6 Jan 04 2019 09:05:09

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

%T 16,3,13,17,18,19,10,3,20,21,16,3,22,3,17,23,24,3,25,26,9,27,21,3,16,

%U 28,22,29,30,3,31,3,32,19,25,33,34,3,27,35,36,3,16,3,37,11,29,38,39,3,31,23,40,3,41,42,43,44,34,3,45,46,35,47,48,49,50,3,12,28,11,3,51,3,39,52

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

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

%H Antti Karttunen, <a href="/A323078/b323078.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 A097246(n) = { my(f=factor(n)); prod(i=1, #f~, (nextprime(f[i,1]+1)^(f[i,2]\2))*((f[i,1])^(f[i,2]%2))); };

%o A323078aux(n) = if((n>2)&&isprime(n),0,A097246(n));

%o v323078 = rgs_transform(vector(up_to,n,A323078aux(n)));

%o A323078(n) = v323078[n];

%Y Cf. A097246, A305801, A322808, A322869.

%K nonn

%O 1,2

%A _Antti Karttunen_, Jan 03 2019