login
A345161
If n = Product (p_j^k_j) then a(n) = max (nextprime(p_j) - p_j), where nextprime = A151800.
1
1, 1, 2, 1, 2, 2, 4, 1, 2, 2, 2, 2, 4, 4, 2, 1, 2, 2, 4, 2, 4, 2, 6, 2, 2, 4, 2, 4, 2, 2, 6, 1, 2, 2, 4, 2, 4, 4, 4, 2, 2, 4, 4, 2, 2, 6, 6, 2, 4, 2, 2, 4, 6, 2, 2, 4, 4, 2, 2, 2, 6, 6, 4, 1, 4, 2, 4, 2, 6, 4, 2, 2, 6, 4, 2, 4, 4, 4, 4, 2, 2, 2, 6, 4, 2, 4, 2, 2, 8, 2
OFFSET
1,3
FORMULA
If n = Product (p_j^k_j) then a(n) = max (prime(pi(p_j) + 1) - p_j), where pi = A000720.
a(2^j*n) = a(n).
a(n^j) = a(n), j > 0.
a(prime(n)^j) = A001223(n), j > 0.
a(n!) = A327441(n).
a(prime(n)#) = A063095(n).
2 + Sum_{k=1..n-1} a(prime(k)^j) = prime(n), j > 0.
Sum_{d|n} mu(n/d) * a(d) = 0 if n is an even number or an odd number divisible by a square > 1.
EXAMPLE
a(39) = a(3 * 13) = a(prime(2) * prime(6)), prime(3) - prime(2) = 5 - 3 = 2, prime(7) - prime(6) = 17 - 13 = 4, so a(39) = max(2, 4) = 4.
MATHEMATICA
a[n_] := Max @@ (NextPrime[#[[1]]] - #[[1]] & /@ FactorInteger[n]); Table[a[n], {n, 1, 90}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Aug 26 2021
STATUS
approved