The definition of amicable numbers is
σ(m)-m=n
σ(n)-n=m
and the definition of quasi-amicable numbers is
σ(m)-m-1=n
σ(n)-n-1=m
or
σ(m)=σ(n)=m+n+1.
So the program can be used in trivial change,
30 N=fnSigma(M)-M:if N<=M then 50 40 R=fnSigma(N)-N:if R=M then print M,N
into
30 N=fnSigma(M)-M-1:if N<=M then 50 40 R=fnSigma(N)-N-1:if R=M then print M,N
There are 404 quasi-amicable pairs which smaller number is less than 1010.
previous | index | next |
---|