|
|
A097032
|
|
Total length of transient and terminal cycle if unitary-proper-divisor-sum function f(x) = A034460(x) is iterated and the initial value is n. Number of distinct terms in iteration list, including also the terminal 0 in the count if the iteration doesn't end in a cycle.
|
|
10
|
|
|
2, 3, 3, 3, 3, 1, 3, 3, 3, 4, 3, 4, 3, 5, 4, 3, 3, 5, 3, 5, 4, 6, 3, 5, 3, 4, 3, 5, 3, 3, 3, 3, 5, 6, 4, 6, 3, 7, 4, 6, 3, 3, 3, 4, 5, 5, 3, 6, 3, 6, 5, 6, 3, 3, 4, 4, 4, 4, 3, 1, 3, 7, 4, 3, 4, 3, 3, 7, 4, 8, 3, 6, 3, 7, 4, 6, 4, 2, 3, 7, 3, 5, 3, 7, 4, 6, 6, 6, 3, 1, 5, 6, 5, 7, 4, 7, 3, 7, 5, 4, 3, 3, 3, 7, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For n = 1, A034460(1) = 0, thus a(1) = 1+1 = 2.
For n = 2, A034460(2) = 1, and A034460(1) = 0, so we end to the zero after a transient part of length 2, thus a(2) = 2+1 = 3.
For n = 30, A034460(30) = 42, A034460(42) = 54, A034460(54) = 30, thus a(30) = a(42) = a(54) = 0+3 = 3, as 30, 42 and 54 are all contained in their own terminal cycle of length 3, without a preceding transient part. (End)
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+14 = 20.
|
|
MATHEMATICA
|
a034460[0] = 0; (* avoids dividing by 0 when an iteration reaches 0 *)
a034460[n_] := Total[Select[Divisors[n], GCD[#, n/#]==1&]]-n/; n>0
a097032[n_] := Map[Length[NestWhileList[a034460, #, UnsameQ, All]]-1&, Range[n]]
|
|
PROG
|
(PARI)
A034460(n) = (sumdivmult(n, d, if(gcd(d, n/d)==1, d))-n); \\ From A034460
A097032(n) = { my(visited = Map()); for(j=1, oo, if(mapisdefined(visited, n), return(j-1), mapput(visited, n, j)); n = A034460(n); if(!n, return(j+1))); }; \\ Antti Karttunen, Sep 23 2018
|
|
CROSSREFS
|
Cf. A002827 (the positions of ones).
Cf. A318882 (sequence that implements the original definition of this sequence).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|