login
A256750
Start with n, and repeatedly apply the arithmetic derivative A003415. |a(n)| = the number of iterations to reach 0 (then a(n) is taken nonnegative) or a number having a factor of the form p^p with prime p, in which case a(n) = -|a(n)|.
18
0, 1, 2, 2, 0, 2, 3, 2, 0, 4, 3, 2, 0, 2, 5, -1, 0, 2, 5, 2, 0, 4, 3, 2, 0, 4, -2, 0, 0, 2, 3, 2, 0, 6, 3, -1, 0, 2, 5, -1, 0, 2, 3, 2, 0, -2, 5, 2, 0, 6, -3, -1, 0, 2, 0, -1, 0, 4, 3, 2, 0, 2, 7, -2, 0, 6, 3, 2, 0, -3, 3, 2, 0, 2, -2, -2, 0, 6, 3, 2, 0, 0, 3, 2, 0, 4, -3, -1, 0, 2, -2, -1, 0, 4, 7, -1, 0, 2, 7, -3
OFFSET
0,3
COMMENTS
Under iterations of the arithmetic derivative, the orbit of some numbers ends in zero, and the orbit of all others (I conjecture) reaches a number of the form m*p^p with prime p, from where on it keeps this form and grows to infinity iff m>1, or remains at this fixed point if m=1.
This is an extension of the sequence A099307 which counts the steps to reach 0 or yields 0 if this never happens.
LINKS
FORMULA
a(n) = 0 <=> n = 0 or n = m*p^p for some prime p and some m >= 1 (which is a fixed point iff m = 1).
a(n) = 1 <=> n = 1.
a(n) = 2 <=> n is prime.
a(n) <= 0 <=> n is in A099309 U {0}. If n > 0, the iterations of A003415 applied to n end in a nonzero fixed point or grow to infinity.
a(n) > 0 <=> n is in A099308 \ {0}.
A099307(n) = min { 0, a(n) }.
MATHEMATICA
w = {}; nn = 2^16; k = 1; While[Set[m, #^#] <= nn &[Prime[k]], AppendTo[w, m]; k++]; a3415[n_] := a3415[n] = Which[n < 2, 0, PrimeQ[n], 1, True, n Total[#2/#1 & @@@ FactorInteger[n]]]{0, 1}~Join~Reap[Do[Which[PrimeQ[n], Sow[2], MemberQ[w, n], Sow[0], True, Sow@ If[#[[-1]] == 0, Length[#] - 1, -Length[#] + 1] &[NestWhileList[a3415, n, And[! Divisible[#, 4], FreeQ[w, #]] &, 1]]], {n, 2, nn}] ][[-1, -1]] (* Michael De Vlieger, Jan 04 2023 *)
PROG
(PARI) a(n, c=0)={n&&until(!n=factorback(n~)*sum(i=1, #n, n[2, i]/n[1, i]), for(i=1, #n=factor(n)~, n[1, i]>n[2, i]||return(-c)); c++); c}
CROSSREFS
Cf. A003415 (arithmetic derivative of n), A099307 (least k such that the k-th arithmetic derivative of n is zero), A099308 (numbers whose k-th arithmetic derivative is zero for some k, positions of terms > 0 after the initial 0), A099309 (numbers whose k-th arithmetic derivative is nonzero for all k, positions of terms <= 0 after the initial 0), A359547 (positions of negative terms), A327934 (positions of -1's).
Cf. also A327966, A327969 (A328324).
Sequence in context: A341879 A099307 A361869 * A228430 A241533 A370885
KEYWORD
sign
AUTHOR
M. F. Hasler, Apr 09 2015
STATUS
approved