login
a(n) = position of n in A169851.
2

%I #11 Jan 02 2025 09:35:00

%S 2,5,3,13,4,10,8,6,1,18,7,22,9,12,15,31,16,35,14,11,17,41,20,26,21,24,

%T 28,56,25,60,29,19,30,27,33,66,34,23,38,73,37,80,39,43,40,88,44,49,45,

%U 32,46,99,47,52,48,36,55,106,51,114,59,50,63,53,58,127,64,42,54,133,62,137,65

%N a(n) = position of n in A169851.

%C A generalization of A064421.

%H Robert Israel, <a href="/A169852/b169852.txt">Table of n, a(n) for n = 2..10000</a>

%p N:= 100: V:= Vector(N): count:= 1: x:= 10: V[10]:= 1: Cands:= [$2..9,$11..1000]: nC:= nops(Cands):

%p for iter from 2 while count < N-1 do

%p found:= false;

%p for i from 1 to nC do

%p if igcd(Cands[i],x) > 1 then

%p x:= Cands[i];

%p Cands:= subsop(i=NULL,Cands);

%p found:= true;

%p if x <= N then V[x]:= iter; count:= count+1; fi;

%p break;

%p fi

%p od;

%p if not found then break fi

%p od:

%p convert(V[2..N],list); # _Robert Israel_, Dec 31 2024

%K nonn

%O 2,1

%A _T. D. Noe_ and _N. J. A. Sloane_, Jun 02 2010