login

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

Ordinal transform of A323075 (and also of A323164).
3

%I #9 Dec 20 2021 14:37:04

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

%T 2,3,1,7,4,8,1,7,1,3,2,3,1,9,2,5,3,5,1,10,3,4,6,8,1,4,1,3,3,4,2,7,1,5,

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

%N Ordinal transform of A323075 (and also of A323164).

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

%t f[n_] := n - n/FactorInteger[n][[1, 1]]; (* f is A060681 *)

%t g[n_] := g[n] = If[n == 1+f[n], n, g[1+f[n]]]; (* g is A323075 *)

%t b[_] = 0;

%t a[n_] := a[n] = With[{t = g[n]}, b[t] = b[t]+1];

%t Array[a, 105] (* _Jean-François Alcover_, Dec 20 2021 *)

%o (PARI)

%o up_to = 65537;

%o ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };

%o A060681(n) = (n-if(1==n,n,n/vecmin(factor(n)[,1])));

%o A323075(n) = { my(nn = 1+A060681(n)); if(nn==n,n,A323075(nn)); };

%o v323165 = ordinal_transform(vector(up_to,n,A323075(n)));

%o A323165(n) = v323165[n];

%Y Cf. A060681, A323075, A323164.

%K nonn

%O 1,4

%A _Antti Karttunen_, Jan 08 2019