login
a(n) = 0 if iteration of the map k -> A034460(k) reaches zero when started from k = n, otherwise 1, when it ends into a cycle.
8

%I #12 Jan 29 2024 13:48:54

%S 0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,

%T 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,

%U 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0

%N a(n) = 0 if iteration of the map k -> A034460(k) reaches zero when started from k = n, otherwise 1, when it ends into a cycle.

%C Characteristic function of A003062.

%H Antti Karttunen, <a href="/A318880/b318880.txt">Table of n, a(n) for n = 1..87360</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%F a(A003062(n)) = 1, a(A097010(n)) = 0.

%t a034460[0] = 0; (* avoids dividing by 0 when an iteration reaches 0 *)

%t a034460[n_] := Total[Select[Divisors[n], GCD[#, n/#]==1&]]-n/;n>0

%t periodicB[k_] := Boole[NestWhile[a034460, k, UnsameQ, All]!=0]

%t a318880[n_] := Map[periodicB, Range[n]]

%t a318880[120] (* _Hartmut F. W. Hoft_, Jan 25 2024 *)

%o (PARI)

%o A034460(n) = (sumdivmult(n, d, if(gcd(d, n/d)==1, d))-n); \\ From A034460

%o A318880(n) = { my(visited = Map()); for(j=1, oo, if(mapisdefined(visited, n), return(1), mapput(visited, n, j)); n = A034460(n); if(!n,return(0))); };

%Y Cf. A003062, A034460, A097010, A097032, A097033, A318882, A318883.

%K nonn

%O 1

%A _Antti Karttunen_, Sep 23 2018