Friendly Pair

Author

Eric W. Weisstein
December 30, 2016

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/FriendlyPair.nb.

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

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

Examples

DivisorSigma[1,#]/#&/@{4320,4680}

DivisorSigma[1,#]/#&/@{24,91963648}

Enumeration

Friendly numbers

A074902

a074902={6,12,24,28,30,40,42,56,60,66,78,80,84,96,102,108,114,120,132,135,138,140,150,168,174,186,200,204,210,222,224,228,234,240,246,252,258,264,270,273,276,280,282,294,300,308,312,318,330,348,354,360,364,366,372};

If any other numbers up to 372 are friendly, their smallest corresponding friends are > 10^30.

Complement[Range[100],a074902]

Numbers believed but not proved to be solitary:

10, 14, 15, 20, 22, 26, 33, 34, 38, 44, 46, 51, 54, 58, 62, 68, 69, 70, 72, 74, 76, 82, 86, 87, 88, 90, 91, 92, 94, 95, 99, 104, 105, 106

Friendly tuples

(10^6)

DivisorSigma[1,Range[10]]

l=DivisorSigma[1,Range[(10^6)]]/Range[(10^6)];//Timing

l=Table[DivisorSigma[1,n]/n,{n,10^6}];//Timing

friendlytuples=Sort[Select[SplitBy[Sort[Transpose[{l//N,Range[Length[l]]}]],First],Length[#]>1&][[All,All,2]]];//Timing

(friendly=Union[Flatten[friendlytuples]])//Take[#,100]&

Complement[a074902,friendly]

(10^7)

Timing[l=Table[DivisorSigma[1,n]/n,{n,10^7}];]

MaxMemoryUsed[]/10^9. GB

friendlytuples=Sort[Select[SplitBy[Sort[Transpose[{l,Range[Length[l]]}]],First],Length[#]>1&][[All,All,2]]];

(friendly7=Union[Flatten[friendlytuples]])//Take[#,100]&

Complement[friendly7,friendly]//Take[#,10]&

Complement[a074902,friendly7]

91963648//N

(10^8)

Timing[l=Table[DivisorSigma[1,n]/n,{n,10^8}];]

MaxMemoryUsed[]/10^9. GB

friendlytuples=Sort[Select[SplitBy[Sort[Transpose[{l//N,Range[Length[l]]}]],First],Length[#]>1&][[All,All,2]]];//Timing

(friendly8=Union[Flatten[friendlytuples]])//Take[#,100]&

Complement[friendly8,friendly7]//Take[#,10]&

Complement[a074902,friendly8]

Sequences of pairs ordered by largest member

Sort[Reverse/@Flatten[Subsets[#,{2}]&/@friendlytuples,1]]

Transpose[Take[%87,20]]

Friendly pairs (which are not part of triples, ...)

Pick[friendlytuples,Length/@friendlytuples,2]

Friendly triples

Pick[friendlytuples,Length/@friendlytuples,3]

Friendly quadruples

Pick[friendlytuples,Length/@friendlytuples,4]

Friendly quintuples and up...

Select[friendlytuples,Length[#]>4&]

Friendly numbers

Take[Union[Flatten[s]],20]