OFFSET
1,2
COMMENTS
LINKS
Jianing Song, Table of n, a(n) for n = 1..10000
StormTurbo, Using 1s to form the numbers, Bilibili video, Aug 04 2023 (in Chinese).
FORMULA
a(2) = 2, a(p) = a(p-1)+1 for primes p > 2; a(p^e) = a(p) + a(e); a(m*n) = a(m) + a(n) for gcd(m,n) = 1.
EXAMPLE
For n = 47029248, we have n = 2^10*3^8*7 = 2^(2*5)*3^(2^3)*7 = (1+1)^((1+1)*(4+1))*(2+1)^((1+1)^(2+1))*(6+1) = (1+1)^((1+1)*(2^2+1))*(2+1)^((1+1)^(2+1))*(2*3+1) = (1+1)^((1+1)*((1+1)^(1+1)+1))*(1+1+1)^((1+1)^(1+1+1))*((1+1)*(2+1)+1) = (1+1)^((1+1)*((1+1)^(1+1)+1))*(1+1+1)^((1+1)^(1+1+1))*((1+1)*(1+1+1)+1). The total number of 1s used is 23, so a(47029248) = 23.
a(1) = 0 since the prime factorization of 1 is empty.
a(2) = 2 since 2 = 1+1.
a(3) = 3 since 3 = 1+1+1.
a(4) = 4 since 4 = (1+1)^(1+1).
a(5) = 5 since 5 = (1+1)^(1+1)+1.
a(6) = 5 since 6 = (1+1)*(1+1+1).
a(7) = 6 since 7 = (1+1)*(1+1+1)+1.
a(8) = 5 since 8 = (1+1)^(1+1+1).
a(9) = 5 since 9 = (1+1+1)^(1+1).
a(10) = 7 since 10 = (1+1)*((1+1)^(1+1)+1).
PROG
(PARI) a(n) = if(n==2, 2, if(isprime(n), a(n-1)+1, my(f=factor(n)); sum(i=1, #f~, a(f[i, 1])+a(f[i, 2]))))
(Python)
from functools import lru_cache
from sympy import factorint, isprime
@lru_cache(maxsize=None)
def A365092(n): return n-1<<1 if n <= 2 else (sum(A365092(p)+A365092(e) for p, e in factorint(n).items()) if not isprime(n) else A365092(n-1)+1) # Chai Wah Wu, Aug 23 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Aug 21 2023
STATUS
approved