Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8624741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:36:25+00:00 2026-06-12T07:36:25+00:00

to check the divisibility of an integer (say A) by another integer(say B) ,

  • 0

to check the divisibility of an integer (say A) by another integer(say B) , i have tried an approach by factoring B and checking if A is divisible by all the prime factors of B . However i’m not sure if its correct ? Could you please suggest what can be done ? For e.g if we have a very large integer say 10^100 and we want to check if its divisible by another integer say 200 then i was trying if 10^100 is divisible by 2 and 5 (by noticing the last digit).
If A is small enough we could directly have checked if A%B==0 but i was trying this for larger numbers.
Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:36:26+00:00Added an answer on June 12, 2026 at 7:36 am

    You have to count the number of times that the prime appears in the factorization of B, and ensure that it appears at least as many times in the factorization of A.

    So, 200 = 23 * 52. Then A is divisible by 200 if and only if it is divisible by 23 and by 52.

    Unless you somehow know the factorization already, factorizing A is far slower than just dividing it by B. The reason is that it will take many trial divisions (or equivalent work) to fully factorize A, whereas it only takes one trial division to check it for divisibility by B. After all, consider the case where B is prime: you’ve found all prime factors of A, when all you needed was to test whether or not B is one of them. This cannot possibly be less work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to check, if a number is divisible by another number: for i
Check out this jsbin . I have a form with a custom button that
Check this jsfiddle , and have a look at the console. $$ is not
Check This Photo http://www.facebook.com/photo.php?fbid=10150146076506729 which have more then 40 likes. When i am trying
I was wondering what the fastest way is to check for divisibility in VB.NET.
Since many of the Project Euler problems require you to do a divisibility check
Check this simple sample: public class Someone{ // [the:A] } public class Another{ public
Check this site. It's working fine in all browsers but when I run this
I need to check the divisibility of a number in c. How can I
Check out my SQLFiddle here ( link ) In SQL Server 2008, I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.