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

A318305
a(n) = Product_{primes p dividing n} p - Product_{primes p dividing n} (p-1).
5
0, 1, 1, 1, 1, 4, 1, 1, 1, 6, 1, 4, 1, 8, 7, 1, 1, 4, 1, 6, 9, 12, 1, 4, 1, 14, 1, 8, 1, 22, 1, 1, 13, 18, 11, 4, 1, 20, 15, 6, 1, 30, 1, 12, 7, 24, 1, 4, 1, 6, 19, 14, 1, 4, 15, 8, 21, 30, 1, 22, 1, 32, 9, 1, 17, 46, 1, 18, 25, 46, 1, 4, 1, 38, 7, 20, 17, 54, 1, 6, 1, 42, 1, 30, 21, 44, 31, 12, 1, 22, 19, 24, 33, 48, 23, 4, 1, 8
OFFSET
1,6
LINKS
FORMULA
a(n) = A051953(n)/A003557(n) = A007947(n) - A173557(n) = A173557(n) - A318304(n).
EXAMPLE
For n = 45 = 3^2 * 5, the prime factors are 3 and 5, thus a(45) = (3*5) - (2*4) = 15 - 8 = 7.
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = A065463 - A307868 = 0.232761... . - Amiram Eldar, Dec 07 2023
PROG
(PARI)
A003557(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); }; \\ From A003557
A051953(n) = (n - eulerphi(n));
A318305(n) = A051953(n)/A003557(n);
(PARI)
A007947(n) = factorback(factorint(n)[, 1]); \\ From A007947
A173557(n) = my(f=factor(n)[, 1]); prod(k=1, #f, f[k]-1); \\ From A173557
A318305(n) = (A007947(n) - A173557(n));
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 26 2018
EXTENSIONS
Corrected the notation in the definition - Antti Karttunen, Feb 03 2024
STATUS
approved