login
Number of transient terms if unitary-proper-divisor-sum-function f(x) = A063919(x) is iterated and the initial value is n.
6

%I #17 Jan 29 2024 13:48:58

%S 0,1,1,1,1,0,1,1,1,2,1,2,1,3,2,1,1,3,1,3,2,4,1,3,1,2,1,3,1,0,1,1,3,4,

%T 2,4,1,5,2,4,1,0,1,2,3,3,1,4,1,4,3,4,1,0,2,2,2,2,1,0,1,5,2,1,2,2,1,5,

%U 2,6,1,4,1,5,2,4,2,1,1,5,1,3,1,5,2,4,4,4,1,0,3,4,3,5,2,5,1,5,3,1,1,1,1,5,5

%N Number of transient terms if unitary-proper-divisor-sum-function f(x) = A063919(x) is iterated and the initial value is n.

%C This sequence implements the original definition given for A097033.

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

%F a(n) = A318882(n) - A097031(n).

%F a(n) = A097033(n) + A318880(n) - 1.

%e For n = 1, A063919(1) = 1, that is, we immediately end with a terminal cycle (of length 1 in this case), thus there are no transient part, and a(1) = 0.

%e For n = 2, A063919(2) = 1, and A063919(1) = 1, so we end with a terminal cycle after a transient part of length 1, thus a(2) = 1.

%e For n = 30, A063919(30) = 42, A063919(42) = 54, A063919(54) = 30, thus a(30) = a(42) = a(54) = 0, as 30, 42 and 54 are all contained in their own terminal cycle, without a preceding transient part.

%e For n = 1506, the iteration-list is {1506, 1518, 1938, 2382, 2394, 2406, [2418, 2958, 3522, 3534, 4146, 4158, 3906, 3774, 4434, 4446, 3954, 3966, 3978, 3582, 2418, ..., ad infinitum]}. After a transient of length 6 the iteration ends in a cycle of length 14, thus a(1506) = 6.

%e If a(n) = 0, then n is a term in an attractor set like A002827, A063991, A097024, A097030.

%t a063919[1] = 1; (* function a[] in A063919 by _Jean-François Alcover_ *)

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

%t transient[k_] := Module[{iter=NestWhileList[a063919, k, UnsameQ, All]}, Position[iter, Last[iter]][[1, 1]]]-1

%t a318883[n_] := Map[transient, Range[n]]

%t a318883[105] (* _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 A063919(n) = if(1==n,n,A034460(n));

%o A318883(n) = { my(visited = Map()); for(j=1, oo, if(mapisdefined(visited, n), return(mapget(visited, n)-1), mapput(visited, n, j)); n = A063919(n)); };

%o \\ Or by using lists:

%o pil(item,lista) = { for(i=1,#lista,if(lista[i]==item,return(i))); (0); };

%o A318883(n) = { my(visited = List([]), k); for(j=1, oo, if((k = pil(n,visited)) > 0, return(k-1)); listput(visited, n); n = A063919(n)); };

%Y Cf. A003062, A063919, A097031, A097033, A318880, A318882.

%K nonn

%O 1,10

%A _Antti Karttunen_, Sep 22 2018, after _Labos Elemer_'s A097033