Devise an algorithm that determines whether a given positive integer N is divisible by 13, and if NOT, to find the remainder.
N can contain up to 20,220 digits.
Note: Simply dividing by 13 or, performing long division by 13 is NOT permissible.
(In reply to
No Subject by Larry)
I would think
if temp%13 == 0:
return [True, temp%13]
else:
return [False, temp%13]
would not be allowable. This is basically asking if this final result is divisible by 13 by doing the division and finding the remainder.
|
Posted by Charlie
on 2022-04-15 11:23:57 |