Amicable Pair

Author

Eric W. Weisstein
April 7, 2006

This notebook downloaded from http://mathworld.wolfram.com/notebooks/NumberTheory/AmicablePair.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/AmicablePair.html.

©2006 Wolfram Research, Inc. except for portions noted otherwise

Check

AmicablePairQ[{2,2,5,11},{2,2,71}]

FactorInteger/@{1184,1210}

AmicablePairQ[{2,2,2,2,2,37},{2,5,11,11}]

AmicablePairQ[1184,1210]

AmicablePairQ[609928,686072]

AmicablePairQ[643336,652664]

Euler's Rule

tuples=Table[{2^m(2^(n-m)+1)-1,2^n( 2^(n-m)+1)-1,2^(n+m)(2^(n-m)+1)^2-1},{n,100},{m,n-1}];

Position[tuples,_?(And@@(PrimeQ/@#)&)]

pqr=Select[Flatten[tuples,1],And@@(PrimeQ/@#)&]

a={EvenPart[#[[2]]+1] #[[1]]#[[2]],EvenPart[#[[2]]+1]#[[3]]}&/@pqr

AmicablePairQ@@@a

Not Divisible by 6

2 3

p6={42262694537514864075544955198125,42405817271188606697466971841875};

Mod[p6,6]

AmicablePairQ@@p6

Length/@IntegerDigits/@p6

Not divisible by 30

2 3 5

AmicablePairFactors[30]={
{{7,7,7,7,11,13,13,17,19,23,23,29,31,37,53,59,59,61,71,79,97,139,193,211,283,439,467,643,659,877,1259,1459,1459,1667,1699,2801,2917,3541,74587,366983,2201897,19126727,714991703,22108315965121,8689461455946208667857,89,100329964009286143948575662850542265921787709},
{7,7,7,7,11,13,13,17,19,23,23,29,31,37,53,59,59,61,71,79,97,139,193,211,283,439,467,643,659,877,1259,1459,1459,1667,1699,2801,2917,3541,74587,366983,2201897,19126727,714991703,22108315965121,8689461455946208667857,9029696760835752955371809656548803932960893899}},
{{7,7,11,13,13,17,17,17,17,19,19,19,23,29,29,31,37,43,59,61,67,83,97,139,173,181,331,349,577,661,1321,4349,11093,41519,43973,44371,88741,15223567,91341401,264271333,1281651920873,47031498888355607,41277542598611381429,4870750026636143008621,179,1525663971924884048614628301903295821727019},
{7,7,11,13,13,17,17,17,17,19,19,19,23,29,29,31,37,43,59,61,67,83,97,139,173,181,331,349,577,661,1321,4349,11093,41519,43973,44371,88741,15223567,91341401,264271333,1281651920873,47031498888355607,41277542598611381429,4870750026636143008621,274619514946479128750633094342593247910863599}},
{{7,7,7,7,11,11,11,11,13,17,19,23,23,31,37,41,41,43,47,47,53,61,79,79,101,103,157,179,313,467,1429,1723,2161,2801,3221,3541,179351,193433,6963587,7532741,75327409,6902195101,138043902019,304322732359,1755237454438019882775808733561,100329372895677216499465227210346759,239,987241029293463810354737835749812108559},
{7,7,7,7,11,11,11,11,13,17,19,23,23,31,37,41,41,43,47,47,53,61,79,79,101,103,157,179,313,467,1429,1723,2161,2801,3221,3541,179351,193433,6963587,7532741,75327409,6902195101,138043902019,304322732359,1755237454438019882775808733561,100329372895677216499465227210346759,236937847030431314485137080579954906054399}}
};

Length/@IntegerDigits/@Times@@@#&/@AmicablePairFactors[30]

And@@Flatten[PrimeQ[#]]&/@AmicablePairFactors[30]

AmicablePairQ@@AmicablePairFactors[30][[1]]

Not divisible by 210

2 3 5 7

Largest Known

Date: Thu, 10 Mar 2005 08:47:11 -0500
From: Paul Jobling <Paul.Jobling@WhiteCross.com>
To: NMBRTHRY@LISTSERV.NODAK.EDU
Subject: A new largest known amicable pair

a={2,5,11};
S={37,173,409,461,2136109,2578171801921099,68340174428454377539};
p=925616938247297545037380170207625962997960453645121;
q=210958430218054117679018601985059107680988707437025081922673599999;
q1=(p+q)*p^235-1;
q2=(p-Times@@S)*p^235-1;

Print[Timing[PrimeQ[#]]]&/@{p,q,q1,q2}

Digits/@{Times@@Flatten[{a,S,Table[p,{235}],q1}],Times@@Flatten[{a,q,Table[p,{235}],q2}]}

AmicablePairQ[
{#[[1]],Length[#]}&/@Split[Sort[Flatten[{a,S,Table[p,{235}],q1}]]],
{#[[1]],Length[#]}&/@Split[Sort[Flatten[{a,q,Table[p,{235}],q2}]]]
]//Timing

Gaussian

AmicablePairQ[Sequence@@#,GaussianIntegers->True]&/@{{-1105+1020I,-2639-1228 I},{8008+3960I ,4232-8280I}}

RestrictedDivisorSigma[#,GaussianIntegers->True]&/@{8008+3960I ,4232-8280I}

RestrictedDivisorSigma[#,GaussianIntegers->True]&/@{-1105+1020I,-2639-1228I}