login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A261085
Number of steps needed to reach zero when starting from the n-th prime [i.e., setting k to A000040(n)] and repeatedly applying the map that replaces k with k - d(k), where d(k) is the number of divisors of k (A000005).
7
1, 2, 3, 4, 4, 5, 6, 7, 8, 10, 11, 13, 14, 15, 15, 17, 19, 20, 22, 23, 24, 26, 16, 18, 20, 21, 22, 22, 23, 24, 23, 24, 25, 26, 28, 29, 31, 33, 33, 34, 36, 37, 39, 40, 40, 41, 44, 47, 34, 35, 49, 51, 52, 54, 54, 55, 57, 58, 59, 58, 59, 62, 48, 49, 50, 66, 69, 71, 73, 74, 74, 76, 55, 57, 59, 60, 61, 63, 63, 65, 68, 69, 71, 72, 74, 62, 64, 65, 66, 67, 67, 70, 72, 73, 75, 76, 77, 80, 81, 75, 77, 79, 79, 81
OFFSET
1,2
LINKS
FORMULA
a(n) = A155043(A000040(n)).
EXAMPLE
For n=4 we have prime(4) = 7, from which we start subtracting the number of divisors, to get the following path: 7 - 2 = 5, 5 - 2 = 3, 3 - 2 = 1, 1 - 1 = 0, and we have reached zero in four steps, thus a(4) = 4.
For n=5 we have prime(5) = 11, for which the similar process results: 11 - 2 = 9, 9 - 3 = 6, 6 - 4 = 2, 2 - 2 = 0, and again we have reached zero in four steps, thus also a(5) = 4.
MATHEMATICA
mpr[p_]:=Length[NestWhileList[#-DivisorSigma[0, #]&, p, #>0&]]-1; mpr/@Prime[ Range[ 120]] (* Harvey P. Dale, Aug 18 2022 *)
PROG
(PARI)
uplim = 65537;
v155043 = vector(uplim);
v155043[1] = 1; v155043[2] = 1;
for(i=3, uplim, v155043[i] = 1 + v155043[i-numdiv(i)]);
A155043 = n -> if(!n, n, v155043[n]);
n=0; forprime(p=2, uplim, n++; write("b261085.txt", n, " ", A155043(p)));
(Scheme) (define (A261085 n) (A155043 (A000040 n)))
CROSSREFS
Cf. A261086 (gives the positions of drops, i.e., where nonmonotonic) and A261087 (the corresponding primes).
Sequence in context: A325106 A309687 A268084 * A017876 A356860 A017865
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 23 2015
STATUS
approved