Skip to main content
deleted 2 characters in body
Source Link
tomos
  • 1.4k
  • 7
  • 11

Unless I'm overlooking something (which is very very possible...) I think you can just use the Moebius function in the form \[ \sum _{d|n}\mu (d)=\left \{ \begin {array}{ll}1&\text { if }n=1\\ 0&\text { if }n\not =1\end {array}\right .\] so that, recalling the Chinese Residue Theorem also in the case of non-coprime moduli, \[ \sum _{k=1\atop {(k,n)=(k+r,n)=1}}^n1=\sum _{k=1}^n\sum _{d|k,n\atop {d'|k+r,n}}1=\sum _{d,d'|n}\mu (d)\mu (d')\sum _{k=1\atop {k\equiv 0(d)\atop {k\equiv -r(d')}}}^n1=n\sum _{d,d'|n\atop {(d,d')|r}}\frac {\mu (d)\mu (d')}{[d,d']}\] and this sum looks nice and multiplicativey - call it $f(n)$. If $n$ is a power of a prime $p$ we have \[ f(n)=\left (\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}+\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\right )\frac {\mu (d)\mu (d')}{[d,d']}=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\mu (d)\mu (d')=1+\frac {1}{p}\left (\sum _{d,d'|n\atop {(d,d')|r}}-\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}\right )\mu (d)\mu (d')=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r}}\mu (d)\mu (d')-1/p\]p=:1+S(n)/p-1/p.\] and the sum here isWe have \[ \sumS(n)=\sum _{h|r}\sum _{d,d'|n\atop {(d,d')=h}}\mu (d)\mu (d')=\sum _{h|r}\sum _{d,d'|n/h\atop {(d,d')=1}}\mu (dh)\mu (d'h)=\sum _{h|r}\mu (h)^2\sum _{d,d'|n\atop {(d,d')=1\atop {(dd',h)=1}}}\mu (d)\mu (d').\] The $d,d'$ sum is \[ \left \{ \begin {array}{ll}-1&\text { if }h=1\\ 1&\text { if }h\not =1\end {array}\right .\] so the $h$ sum is \[ \leftS(n)=\left \{ \begin {array}{ll}0&\text { if }p|r\\ -1&\text { if }p\not |r\end {array}\right .\] so \[ f(n)=\left \{ \begin {array}{ll}1-1/p&\text { if }p|r\\ 1-2/p&\text { if }p\not |r\end {array}\right \} =1-\nu (p)/p\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$, and we conclude \[ \sum _{k=1\atop {(k(k+r),n)=1}}^n1=n\prod _{p|n}\left (1-\nu (p)/p\right ).\]

Unless I'm overlooking something (which is very very possible...) I think you can just use the Moebius function in the form \[ \sum _{d|n}\mu (d)=\left \{ \begin {array}{ll}1&\text { if }n=1\\ 0&\text { if }n\not =1\end {array}\right .\] so that, recalling the Chinese Residue Theorem also in the case of non-coprime moduli, \[ \sum _{k=1\atop {(k,n)=(k+r,n)=1}}^n1=\sum _{k=1}^n\sum _{d|k,n\atop {d'|k+r,n}}1=\sum _{d,d'|n}\mu (d)\mu (d')\sum _{k=1\atop {k\equiv 0(d)\atop {k\equiv -r(d')}}}^n1=n\sum _{d,d'|n\atop {(d,d')|r}}\frac {\mu (d)\mu (d')}{[d,d']}\] and this sum looks nice and multiplicativey - call it $f(n)$. If $n$ is a power of a prime $p$ we have \[ f(n)=\left (\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}+\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\right )\frac {\mu (d)\mu (d')}{[d,d']}=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\mu (d)\mu (d')=1+\frac {1}{p}\left (\sum _{d,d'|n\atop {(d,d')|r}}-\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}\right )\mu (d)\mu (d')=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r}}\mu (d)\mu (d')-1/p\] and the sum here is \[ \sum _{h|r}\sum _{d,d'|n\atop {(d,d')=h}}\mu (d)\mu (d')=\sum _{h|r}\sum _{d,d'|n/h\atop {(d,d')=1}}\mu (dh)\mu (d'h)=\sum _{h|r}\mu (h)^2\sum _{d,d'|n\atop {(d,d')=1\atop {(dd',h)=1}}}\mu (d)\mu (d').\] The $d,d'$ sum is \[ \left \{ \begin {array}{ll}-1&\text { if }h=1\\ 1&\text { if }h\not =1\end {array}\right .\] so the $h$ sum is \[ \left \{ \begin {array}{ll}0&\text { if }p|r\\ -1&\text { if }p\not |r\end {array}\right .\] so \[ f(n)=\left \{ \begin {array}{ll}1-1/p&\text { if }p|r\\ 1-2/p&\text { if }p\not |r\end {array}\right \} =1-\nu (p)/p\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$, and we conclude \[ \sum _{k=1\atop {(k(k+r),n)=1}}^n1=n\prod _{p|n}\left (1-\nu (p)/p\right ).\]

Unless I'm overlooking something (which is very very possible...) I think you can just use the Moebius function in the form \[ \sum _{d|n}\mu (d)=\left \{ \begin {array}{ll}1&\text { if }n=1\\ 0&\text { if }n\not =1\end {array}\right .\] so that, recalling the Chinese Residue Theorem also in the case of non-coprime moduli, \[ \sum _{k=1\atop {(k,n)=(k+r,n)=1}}^n1=\sum _{k=1}^n\sum _{d|k,n\atop {d'|k+r,n}}1=\sum _{d,d'|n}\mu (d)\mu (d')\sum _{k=1\atop {k\equiv 0(d)\atop {k\equiv -r(d')}}}^n1=n\sum _{d,d'|n\atop {(d,d')|r}}\frac {\mu (d)\mu (d')}{[d,d']}\] and this sum looks nice and multiplicativey - call it $f(n)$. If $n$ is a power of a prime $p$ we have \[ f(n)=\left (\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}+\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\right )\frac {\mu (d)\mu (d')}{[d,d']}=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\mu (d)\mu (d')=1+\frac {1}{p}\left (\sum _{d,d'|n\atop {(d,d')|r}}-\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}\right )\mu (d)\mu (d')=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r}}\mu (d)\mu (d')-1/p=:1+S(n)/p-1/p.\] We have \[ S(n)=\sum _{h|r}\sum _{d,d'|n\atop {(d,d')=h}}\mu (d)\mu (d')=\sum _{h|r}\sum _{d,d'|n/h\atop {(d,d')=1}}\mu (dh)\mu (d'h)=\sum _{h|r}\mu (h)^2\sum _{d,d'|n\atop {(d,d')=1\atop {(dd',h)=1}}}\mu (d)\mu (d').\] The $d,d'$ sum is \[ \left \{ \begin {array}{ll}-1&\text { if }h=1\\ 1&\text { if }h\not =1\end {array}\right .\] so \[ S(n)=\left \{ \begin {array}{ll}0&\text { if }p|r\\ -1&\text { if }p\not |r\end {array}\right .\] so \[ f(n)=\left \{ \begin {array}{ll}1-1/p&\text { if }p|r\\ 1-2/p&\text { if }p\not |r\end {array}\right \} =1-\nu (p)/p\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$, and we conclude \[ \sum _{k=1\atop {(k(k+r),n)=1}}^n1=n\prod _{p|n}\left (1-\nu (p)/p\right ).\]

added 11 characters in body
Source Link
tomos
  • 1.4k
  • 7
  • 11

Unless I'm overlooking something (which is very very possible...), I think you can just use the Moebius function in the form \[ \mu\sum _{d|n}\mu (nd)=\left \{ \begin {array}{ll}1&\text { if }n=1\\ 0&\text { if }n\not =1\end {array}\right .\] so that, recalling the Chinese Residue Theorem also in the case of non-coprime moduli, \[ \sum _{k=1\atop {(k,n)=(k+r,n)=1}}^n1=\sum _{k=1}^n\sum _{d|k,n\atop {d'|k+r,n}}1=\sum _{d,d'|n}\mu (d)\mu (d')\sum _{k=1\atop {k\equiv 0(d)\atop {k\equiv -r(d')}}}^n1=n\sum _{d,d'|n\atop {(d,d')|r}}\frac {\mu (d)\mu (d')}{[d,d']}\] and this sum looks nice and multiplicativey - call it $f(n)$. If $n$ is a power of a prime $p$ we have \[ f(n)=\left (\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-1d']=1}}}+\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-pd']=p}}}\right )\frac {\mu (d)\mu (d')}{[d,d']}=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\mu (d)\mu (d')=1+\frac {1}{p}\left (\sum _{d,d'|n\atop {(d,d')|r}}-\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}\right )\mu (d)\mu (d')=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r}}\mu (d)\mu (d')-1/p\] and the sum here is \[ \sum _{h|r}\sum _{d,d'|n\atop {(d,d')=h}}\mu (d)\mu (d')=\sum _{h|r}\sum _{d,d'|n/h\atop {(d,d')=1}}\mu (dh)\mu (d'h)=\sum _{h|r}\mu (h)^2\sum _{d,d'|n\atop {(d,d')=1\atop {(dd',h)=1}}}\mu (d)\mu (d').\] The $d,d'$ sum is \[ \left \{ \begin {array}{ll}-1&\text { if }h=1\\ 1&\text { if }h\not =1\end {array}\right .\] so the $h$ sum is \[ \left \{ \begin {array}{ll}0&\text { if }p|r\\ -1&\text { if }p\not |r\end {array}\right .\] so \[ f(n)=\left \{ \begin {array}{ll}1-1/p&\text { if }p|r\\ 1-2/p&\text { if }p\not |r\end {array}\right \} =1-\nu (p)/p\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$, and we conclude \[ \sum _{k=1\atop {(k(k+r),n)=1}}^n1=n\prod _{p|n}\left (1-\nu (p)/p\right ).\]

Unless I'm overlooking something (which is very very possible...), I think you can just use the Moebius function in the form \[ \mu (n)=\left \{ \begin {array}{ll}1&\text { if }n=1\\ 0&\text { if }n\not =1\end {array}\right .\] so that, recalling the Chinese Residue Theorem also in the case of non-coprime moduli, \[ \sum _{k=1\atop {(k,n)=(k+r,n)=1}}^n1=\sum _{d,d'|n}\mu (d)\mu (d')\sum _{k=1\atop {k\equiv 0(d)\atop {k\equiv -r(d')}}}^n1=n\sum _{d,d'|n\atop {(d,d')|r}}\frac {\mu (d)\mu (d')}{[d,d']}\] and this sum looks nice and multiplicativey - call it $f(n)$. If $n$ is a power of a prime $p$ we have \[ f(n)=\left (\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-1}}}+\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-p}}}\right )\frac {\mu (d)\mu (d')}{[d,d']}=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\mu (d)\mu (d')=1+\frac {1}{p}\left (\sum _{d,d'|n\atop {(d,d')|r}}-\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}\right )\mu (d)\mu (d')=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r}}\mu (d)\mu (d')-1/p\] and the sum here is \[ \sum _{h|r}\sum _{d,d'|n\atop {(d,d')=h}}\mu (d)\mu (d')=\sum _{h|r}\sum _{d,d'|n/h\atop {(d,d')=1}}\mu (dh)\mu (d'h)=\sum _{h|r}\mu (h)^2\sum _{d,d'|n\atop {(d,d')=1\atop {(dd',h)=1}}}\mu (d)\mu (d').\] The $d,d'$ sum is \[ \left \{ \begin {array}{ll}-1&\text { if }h=1\\ 1&\text { if }h\not =1\end {array}\right .\] so the $h$ sum is \[ \left \{ \begin {array}{ll}0&\text { if }p|r\\ -1&\text { if }p\not |r\end {array}\right .\] so \[ f(n)=\left \{ \begin {array}{ll}1-1/p&\text { if }p|r\\ 1-2/p&\text { if }p\not |r\end {array}\right \} =1-\nu (p)/p\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$, and we conclude \[ \sum _{k=1\atop {(k(k+r),n)=1}}^n1=n\prod _{p|n}\left (1-\nu (p)/p\right ).\]

Unless I'm overlooking something (which is very very possible...) I think you can just use the Moebius function in the form \[ \sum _{d|n}\mu (d)=\left \{ \begin {array}{ll}1&\text { if }n=1\\ 0&\text { if }n\not =1\end {array}\right .\] so that, recalling the Chinese Residue Theorem also in the case of non-coprime moduli, \[ \sum _{k=1\atop {(k,n)=(k+r,n)=1}}^n1=\sum _{k=1}^n\sum _{d|k,n\atop {d'|k+r,n}}1=\sum _{d,d'|n}\mu (d)\mu (d')\sum _{k=1\atop {k\equiv 0(d)\atop {k\equiv -r(d')}}}^n1=n\sum _{d,d'|n\atop {(d,d')|r}}\frac {\mu (d)\mu (d')}{[d,d']}\] and this sum looks nice and multiplicativey - call it $f(n)$. If $n$ is a power of a prime $p$ we have \[ f(n)=\left (\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}+\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\right )\frac {\mu (d)\mu (d')}{[d,d']}=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\mu (d)\mu (d')=1+\frac {1}{p}\left (\sum _{d,d'|n\atop {(d,d')|r}}-\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}\right )\mu (d)\mu (d')=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r}}\mu (d)\mu (d')-1/p\] and the sum here is \[ \sum _{h|r}\sum _{d,d'|n\atop {(d,d')=h}}\mu (d)\mu (d')=\sum _{h|r}\sum _{d,d'|n/h\atop {(d,d')=1}}\mu (dh)\mu (d'h)=\sum _{h|r}\mu (h)^2\sum _{d,d'|n\atop {(d,d')=1\atop {(dd',h)=1}}}\mu (d)\mu (d').\] The $d,d'$ sum is \[ \left \{ \begin {array}{ll}-1&\text { if }h=1\\ 1&\text { if }h\not =1\end {array}\right .\] so the $h$ sum is \[ \left \{ \begin {array}{ll}0&\text { if }p|r\\ -1&\text { if }p\not |r\end {array}\right .\] so \[ f(n)=\left \{ \begin {array}{ll}1-1/p&\text { if }p|r\\ 1-2/p&\text { if }p\not |r\end {array}\right \} =1-\nu (p)/p\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$, and we conclude \[ \sum _{k=1\atop {(k(k+r),n)=1}}^n1=n\prod _{p|n}\left (1-\nu (p)/p\right ).\]

added 171 characters in body
Source Link
tomos
  • 1.4k
  • 7
  • 11

Unless I'm overlooking something (which is very very possible...), I think you can just use the Moebius function in the form \[ \mu (n)=\left \{ \begin {array}{ll}1&\text { if }n=1\\ 0&\text { if }n\not =1\end {array}\right .\] so that, recalling the Chinese Residue Theorem also in the case of non-coprime moduli, \[ \sum _{k=1\atop {(k,n)=(k+r,n)=1}}^n1=\sum _{d,d'|n}\mu (d)\mu (d')\sum _{k=1\atop {k\equiv 0(d)\atop {k\equiv -r(d')}}}^n1=n\sum _{d,d'|n\atop {(d,d')|r}}\frac {\mu (d)\mu (d')}{[d,d']}\] and this sum looks nice and multiplicativey - call it $f(n)$. If $n$ is a power of a prime $p$ we have \[ f(n)=\left (\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-1}}}+\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-p}}}\right )\frac {\mu (d)\mu (d')}{[d,d']}=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\mu (d)\mu (d')=1+\frac {1}{p}\left (\sum _{d,d'|n\atop {(d,d')|r}}-\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}\right )\mu (d)\mu (d')=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r}}\mu (d)\mu (d')-1/p.\]p\] Theand the sum here is then \[ \sum _{h|r}\sum _{d,d'|n\atop {(d,d')=h}}\mu (d)\mu (d')=\sum _{h|r}\sum _{d,d'|n/h\atop {(d,d')=1}}\mu (dh)\mu (d'h)=\sum _{h|r}\mu (h)^2\sum _{d,d'|n\atop {(d,d')=1\atop {(dd',h)=1}}}\mu (d)\mu (d').\] and thisThe $d,d'$ sum is \[ \left \{ \begin {array}{ll}-2&\text1&\text { if }h=1\\ 1&\text { if }h\not =1\end {array}\right .\] so the $h$ sum is \[ \left \{ \begin $-2${array}{ll}0&\text { if $p|r$ and it's}p|r\\ $-1$-1&\text { if $p\not |r$}p\not |r\end {array}\right . Therefore\] so \[ f(n)=\left \{ \begin $f(n)=1-1/p${array}{ll}1-1/p&\text { if $p|r$ and it's}p|r\\ 1-2/p&\text $1-2/p${ if $p\not |r$ so}p\not |r\end {array}\right \} =1-\nu (p)/p\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$, and we conclude \[ \sum _{k=1\atop {(k(k+r),n)=1}}^n1=n\prod _{p|n}\left (1-\nu (p)/p\right )\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$.\]

Unless I'm overlooking something (which is very very possible...), I think you can just use the Moebius function in the form \[ \mu (n)=\left \{ \begin {array}{ll}1&\text { if }n=1\\ 0&\text { if }n\not =1\end {array}\right .\] so that, recalling the Chinese Residue Theorem also in the case of non-coprime moduli, \[ \sum _{k=1\atop {(k,n)=(k+r,n)=1}}^n1=\sum _{d,d'|n}\mu (d)\mu (d')\sum _{k=1\atop {k\equiv 0(d)\atop {k\equiv -r(d')}}}^n1=n\sum _{d,d'|n\atop {(d,d')|r}}\frac {\mu (d)\mu (d')}{[d,d']}\] and this sum looks nice and multiplicativey - call it $f(n)$. If $n$ is a power of a prime $p$ we have \[ f(n)=\left (\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-1}}}+\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-p}}}\right )\frac {\mu (d)\mu (d')}{[d,d']}=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\mu (d)\mu (d')=1+\frac {1}{p}\left (\sum _{d,d'|n\atop {(d,d')|r}}-\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}\right )\mu (d)\mu (d')=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r}}\mu (d)\mu (d')-1/p.\] The sum here is then \[ \sum _{h|r}\sum _{d,d'|n\atop {(d,d')=h}}\mu (d)\mu (d')=\sum _{h|r}\sum _{d,d'|n/h\atop {(d,d')=1}}\mu (dh)\mu (d'h)=\sum _{h|r}\mu (h)^2\sum _{d,d'|n\atop {(d,d')=1\atop {(dd',h)=1}}}\mu (d)\mu (d')\] and this is \[ \left \{ \begin {array}{ll}-2&\text { if }h=1\\ 1&\text { if }h\not =1\end {array}\right .\] so the $h$ sum is $-2$ if $p|r$ and it's $-1$ if $p\not |r$. Therefore $f(n)=1-1/p$ if $p|r$ and it's $1-2/p$ if $p\not |r$ so we conclude \[ \sum _{k=1\atop {(k(k+r),n)=1}}^n1=n\prod _{p|n}\left (1-\nu (p)/p\right )\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$.

Unless I'm overlooking something (which is very very possible...), I think you can just use the Moebius function in the form \[ \mu (n)=\left \{ \begin {array}{ll}1&\text { if }n=1\\ 0&\text { if }n\not =1\end {array}\right .\] so that, recalling the Chinese Residue Theorem also in the case of non-coprime moduli, \[ \sum _{k=1\atop {(k,n)=(k+r,n)=1}}^n1=\sum _{d,d'|n}\mu (d)\mu (d')\sum _{k=1\atop {k\equiv 0(d)\atop {k\equiv -r(d')}}}^n1=n\sum _{d,d'|n\atop {(d,d')|r}}\frac {\mu (d)\mu (d')}{[d,d']}\] and this sum looks nice and multiplicativey - call it $f(n)$. If $n$ is a power of a prime $p$ we have \[ f(n)=\left (\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-1}}}+\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']-p}}}\right )\frac {\mu (d)\mu (d')}{[d,d']}=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=p}}}\mu (d)\mu (d')=1+\frac {1}{p}\left (\sum _{d,d'|n\atop {(d,d')|r}}-\sum _{d,d'|n\atop {(d,d')|r\atop {[d,d']=1}}}\right )\mu (d)\mu (d')=1+\frac {1}{p}\sum _{d,d'|n\atop {(d,d')|r}}\mu (d)\mu (d')-1/p\] and the sum here is \[ \sum _{h|r}\sum _{d,d'|n\atop {(d,d')=h}}\mu (d)\mu (d')=\sum _{h|r}\sum _{d,d'|n/h\atop {(d,d')=1}}\mu (dh)\mu (d'h)=\sum _{h|r}\mu (h)^2\sum _{d,d'|n\atop {(d,d')=1\atop {(dd',h)=1}}}\mu (d)\mu (d').\] The $d,d'$ sum is \[ \left \{ \begin {array}{ll}-1&\text { if }h=1\\ 1&\text { if }h\not =1\end {array}\right .\] so the $h$ sum is \[ \left \{ \begin {array}{ll}0&\text { if }p|r\\ -1&\text { if }p\not |r\end {array}\right .\] so \[ f(n)=\left \{ \begin {array}{ll}1-1/p&\text { if }p|r\\ 1-2/p&\text { if }p\not |r\end {array}\right \} =1-\nu (p)/p\] where $\nu (p)$ is the number of residues represented by $0,r$ modulo $p$, and we conclude \[ \sum _{k=1\atop {(k(k+r),n)=1}}^n1=n\prod _{p|n}\left (1-\nu (p)/p\right ).\]

added 171 characters in body
Source Link
tomos
  • 1.4k
  • 7
  • 11
Loading
added 859 characters in body
Source Link
tomos
  • 1.4k
  • 7
  • 11
Loading
deleted 1 character in body
Source Link
tomos
  • 1.4k
  • 7
  • 11
Loading
Source Link
tomos
  • 1.4k
  • 7
  • 11
Loading