[go: up one dir, main page]

login
A127705
a(n) = mu(n) + Sum_{k|n, k>1} (k+1)*mu(n/k), where mu = A008683.
2
1, 2, 3, 2, 5, 1, 7, 4, 6, 3, 11, 4, 13, 5, 7, 8, 17, 6, 19, 8, 11, 9, 23, 8, 20, 11, 18, 12, 29, 9, 31, 16, 19, 15, 23, 12, 37, 17, 23, 16, 41, 13, 43, 20, 24, 21, 47, 16, 42, 20, 31, 24, 53, 18, 39, 24, 35, 27, 59, 16, 61, 29, 36, 32, 47, 21, 67, 32, 43, 25, 71, 24, 73
OFFSET
1,2
COMMENTS
Previous name: Row sums of A127704.
From Robert Israel, Dec 29 2016: (Start)
a(n) = n if and only if n is in A008578.
a(p^j) = p^j - p^(j-1) if p is prime and j >= 2.
a(Product_{i=1..k} p_i) = Product_{i=1..k} (p_i-1) - (-1)^k if p_1, ..., p_k are distinct primes. (End)
LINKS
FORMULA
a(n) = mu(n) + Sum_{k|n,k>1} (k+1)*mu(n/k), where mu = A008683. - Robert Israel, Dec 29 2016
MAPLE
N := 100: # to get a(1)..a(N)
A:= Vector(N, numtheory:-mobius):
for k from 2 to N do
for j from 1 to floor(N/k) do
A[j*k]:= A[j*k] + (k+1)*numtheory:-mobius(j)
od od:
convert(A, list); # Robert Israel, Dec 29 2016
PROG
(Python)
def A127705_list(n):
upto = n + 1
p = [i for i in range(upto)]
for i in range(2, upto):
for j in range(i + i, upto , i):
p[j] -= p[i]
return p[1::]
print(A127705_list(1000)) # Peter Luschny, Sep 02 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Jan 24 2007
EXTENSIONS
Terms a(11) and beyond from Robert Israel, Dec 29 2016
New name using a formula of Robert Israel by Peter Luschny, Sep 02 2023
STATUS
approved