Talk:Proper divisors: Difference between revisions

Line 21:
:: I guess my point was about the input 1. The proper divisors of 1 should be the empty set, while all the current implementations are using the "always includes 1" to mean it should be {1}. Another interesting case is the input 0, but I think we can ignore that. [[User:Danaj|Danaj]] ([[User talk:Danaj|talk]]) 21:09, 16 December 2014 (UTC)
::: Well... on the one hand, the definition of of what proper divisors are for 1 has changed during this discussion, which makes talking about that a bit odd. On the other hand, the list of factors of zero is probably infinite: 0 = 0*1*2*3*4... Or, put differently: the remainder of dividing zero by 100 is zero. So that can't be adequately represented on a computer, so we probably always treat it as an error case (either that or by never returning from a request for that list of divisors). --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 00:05, 18 December 2014 (UTC)
:::: The task has been changed, so the point of this topic is now settled (for me at least). Re 0, I see the task says "of a positive integer N" so sidesteps the 0 input entirely. Even if we did care, it would for this task be "whatever you've justified divisors(0) returning, without 0 if it was present." That covers divisors returning {}, {0}, {0,1}, error, a lazy list, etc. As an aside, I see sometime between Pari 2.5.3 and 2.6.2 they changed from returning {0,1} to giving a domain error. Sage returns a value error. Wolfram/Alpha indicates "(all non-zero integers are divisors of 0)" [[User:Danaj|Danaj]] ([[User talk:Danaj|talk]]) 01:16, 18 December 2014 (UTC)
Anonymous user