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 7178069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:50:43+00:00 2026-05-28T16:50:43+00:00

I have this number x which i need to find in the (40 mod

  • 0

I have this number x which i need to find in the (40 mod x) = 1

a possible answer for x is 3, or 39 as it goes into the number 40 and leaves a remainder of 1.

What kind of code would I need if I was to find all possible answers of x?

  • 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-05-28T16:50:44+00:00Added an answer on May 28, 2026 at 4:50 pm

    Mathematically, to solve (a mod x) = b, just find all of the divisors of a-b that aren’t divisors of a. e.g. for (40 mod x) = 1, find the divisors of 40 – 1 (i.e. 39), which are 3, 13, and 39. The divisors of 40 are 2, 4, 5, 8, 10, 20, 40. None of the numbers in the first set are in the second, so the solutions are 3, 13, and 19.

    For (40 mod x) = 5, you find the divisors of 40 – 5 (i.e. 35), which are 5, 7, and 35. 5 is on the list of divisors of 40, but the other two aren’t, so the solutions are 7 and 35.

    Of course, for such small numbers, it’s more work to find all of the factors of a and a-b than it is to simply do all of the trial divisions of a by x, so the right way to solve your problem is to take exactly the question you asked and put it into code (forgive my VB, I haven’t written any in the past 15 years or so…)

    for x = 2 to 39
       if (40 % x) = 1
          MsgBox(x)
       end if
     next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code which adds a x number of views to a Multiview
:-) I have this script, which find a users position taken from the number
I need to find how many days have in this month which we can
I have a number which is in this form : 2012-01 (2012 as current
I have this code: # Compare phone number phone_pattern = '^\d{3} ?\d{3}-\d{4}$' phoneNumber =
I have this two strings of equal length, which I need to compare. I
I have a number of stores, all have post codes/ZIP code... I need to
So, I have several sets, and I need to find the smallest number of
Given an integer array, i need to find which number occurred most number of
I have this string of numbers var array = 1,6,2,9,5 which is retrieved from

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.