cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A323165 #9 Dec 20 2021 14:37:04
%S A323165 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 A323165 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 A323165 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 A323165 Ordinal transform of A323075 (and also of A323164).
%H A323165 Antti Karttunen, <a href="/A323165/b323165.txt">Table of n, a(n) for n = 1..65537</a>
%t A323165 f[n_] := n - n/FactorInteger[n][[1, 1]]; (* f is A060681 *)
%t A323165 g[n_] := g[n] = If[n == 1+f[n], n, g[1+f[n]]]; (* g is A323075 *)
%t A323165 b[_] = 0;
%t A323165 a[n_] := a[n] = With[{t = g[n]}, b[t] = b[t]+1];
%t A323165 Array[a, 105] (* _Jean-François Alcover_, Dec 20 2021 *)
%o A323165 (PARI)
%o A323165 up_to = 65537;
%o A323165 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 A323165 A060681(n) = (n-if(1==n,n,n/vecmin(factor(n)[,1])));
%o A323165 A323075(n) = { my(nn = 1+A060681(n)); if(nn==n,n,A323075(nn)); };
%o A323165 v323165 = ordinal_transform(vector(up_to,n,A323075(n)));
%o A323165 A323165(n) = v323165[n];
%Y A323165 Cf. A060681, A323075, A323164.
%K A323165 nonn
%O A323165 1,4
%A A323165 _Antti Karttunen_, Jan 08 2019