A255215 Numbers that belong to at least one amicable tuple.
1, 220, 284, 1184, 1210, 1980, 2016, 2556, 2620, 2924, 5020, 5564, 6232, 6368, 9180, 9504, 10744, 10856, 11556, 12285, 14595, 17296, 18416, 21168, 22200, 23940, 27312, 31284, 32136, 37380, 38940, 39480, 40068, 40608, 41412, 41952, 42168, 43890, 46368, 47124
Offset: 1
Keywords
Examples
1 belongs to this sequence because {1} is considered an amicable one-tuple. 284 belongs to this sequence because {220, 284} is an amicable pair. 2016 belongs to this sequence because {1980, 2016, 2556} is an amicable triple. 38940 is included in this sequence only once even if both {38940, 40068, 41952} and {38940, 40608, 41412} are amicable. 1000 does not belong to this sequence. To prove that, note that sigma(1000)=2340. Then find all x such that sigma(x)=2340, these are 792, 1000, 1062, 1305, 1611, 1945, 2339. Run through all subsets of 792, 1000, 1062, 1305, 1611, 1945, 2339 that include 1000 to verify that no such subset has a sum of 2340. A tuple (or multiset) like {1560, 1740, 1740} where some element(s) are repeated, is not allowed here, and neither 1560 nor 1740 belongs to this sequence.
Links
- Jeppe Stig Nielsen, Table of n, a(n) for n = 1..361
Programs
-
PARI
(notSubsetSum(desiredSum, searchSet) = { /* strongly inspired by is_A006037 function from A006037 */ local(t); /* return nonzero iff desiredSum is not the sum of a subset of searchSet */ setsearch( Set(searchSet), desiredSum ) & return /* equal to one element of searchSet */; while( #searchSet & searchSet[ #searchSet]>desiredSum, searchSet=vecextract(searchSet, "^-1")); desiredSum >= (t = sum(i=1, #searchSet, searchSet[i])) & return( desiredSum-t /* nonzero if desiredSum>t */ ); desiredSum > searchSet[ #searchSet] & ! notSubsetSum( desiredSum - searchSet[ #searchSet], searchSet=vecextract( searchSet, "^-1" )) & return; notSubsetSum( desiredSum, searchSet ) }); (othersWithSameSigma(n) = { s=sigma(n); [ x | x<-[1..s-1] , sigma(x)==s&&x!=n ] }); (is_A255215(x) = !notSubsetSum(sigma(x)-x, othersWithSameSigma(x)))
Comments