All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Number and 2023 Remainder Resolution (Posted on 2023-09-24) Difficulty: 3 of 5
   N = 1234.........78798081
Determine the remainder and the last four digits of the quotient when N is divided by 2023.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution | Comment 1 of 2
The last four digits are 5846
The remainder is 1623

61026588779590771831518397524479101494934566130959
12666008083854366752552764925628509564757860867748
6731382086315503532657774033468696360591086395846
with remainder 1623

---------------
def large_divide(divisor, dividend):
    if type(dividend) == str:
        dividend = [int(i) for i in dividend]
    elif type(dividend) == int:
        dividend = [int(i) for i in str(dividend)]
    quotient = []
    tempdividend = 0
    i=0
    for i,v in enumerate(dividend):
        tempdividend = tempdividend*10 + dividend[i]
        quotient.append(tempdividend // divisor)
        tempdividend = tempdividend % divisor
    wholepart = ''.join([str(j) for j in quotient])
    remainder = tempdividend
    ans = wholepart.lstrip('0')+'\nwith remainder '+ str(remainder)
    return ans

strN = ''.join([str(i) for i in range(1,82)])
print(large_divide(2023, strN))


  Posted by Larry on 2023-09-24 07:56:25
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information