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)|.
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
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
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).
Programs
-
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 *)
-
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}
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) }.
Comments