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”).

A377482
Iterated integer log of n: denote A001414(n) by b(n). a(n) = n if b(n) = n. Otherwise, a(n) = b(n) + b(b(n)) + ... + b^k(n), where k is the smallest integer such that b^k(n) is prime.
0
1, 2, 3, 4, 5, 5, 7, 11, 11, 7, 11, 7, 13, 20, 19, 19, 17, 19, 19, 20, 17, 13, 23, 20, 17, 34, 20, 11, 29, 17, 31, 17, 34, 19, 19, 17, 37, 38, 35, 11, 41, 19, 43, 34, 11, 42, 47, 11, 34, 19, 40, 17, 53, 11, 35, 13, 35, 31, 59, 19, 61, 67, 13, 19, 37, 35, 67
OFFSET
1,2
COMMENTS
Can be understood as an exotic way of measuring how far a number is from being prime, since omitting n = 1, 4, |a(n) - n| = 0 if and only if n is prime. Note that A274718(n) = k - 1 when a(n) = b(n) + b(b(n)) + ... + b^k(n). The scatter plot for n >= 10000 shows intriguing regularities.
EXAMPLE
a(24) is computed as follows: 24 = (2^3) * 3, 2 * 3 + 3 = 9. 9 = (3^2), 3 + 3 = 6. 6 = 2 * 3, 2 + 3 = 5. Since 5 is prime, we stop and take the sum: 9 + 6 + 5 = 20.
PROG
(Python)
from sympy import*
def a(n):
t=0
while n not in (1, 4) and not isprime(n):
n=sum(p*e for p, e in factorint(n).items()); t+=n
return t or n
CROSSREFS
Sequence in context: A094017 A092762 A017844 * A303655 A011156 A213478
KEYWORD
nonn,easy,look
AUTHOR
Louis-Simon Cyr, Oct 29 2024
STATUS
approved