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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:54:23+00:00 2026-06-13T09:54:23+00:00

let n be an integer and A = {2,3,…,10} and I want to do

  • 0

let n be an integer and A = {2,3,…,10} and I want to do as follows:

  1. divide n to 2, so there is a reminder r2 and a quotient q2.
  2. divide q2 to 3, so there is a reminder r3 and a quotient q3.
  3. we repeat this until the quotient is less than the next number.
  4. write together the last quotient with the previous reminders.

For example n=45

45/2 .......    r_2=1, q_2=22
22/3 .......    r_3=1, q_3=7
 7/4 .......    r_4=3, q_4=1

since q4 = 1 is less than the next number i.e. 5, we break.

the result is q4r4r3r2 where it is equal to 1311.

Thank you for your help.

I did this but it does not work

n = 45;
i = 2;
list = {Mod[n, i]};

While[Quotient[n, i] >= i + 1, n == Quotient[n, i]; i++; 
   AppendTo[list, Mod[n, i]];
   If[Quotient[n, i] < i + 1, Break[]]; AppendTo[list, Quotient[n, i]]];

list
Row[Reverse[list]]

which gives

{1, 0, 15, 1, 11, 0, 9, 3, 7, 3}
Row[{3, 7, 3, 9, 0, 11, 1, 15, 0, 1}]

where it is not my desired result.

  • 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-13T09:54:24+00:00Added an answer on June 13, 2026 at 9:54 am

    This is the code:

    A = Table[i, {i, 2, 10}]; (* array of numbers *)
    n = 45; (* initial value *)
    ans = {}; (* future answer which is now empty list *)
    For[i = 1, i <= Length[A], i++, (* looping over A *)
     If[n < A[[i]], (* exit condition *)
      ans = Append[ans, n]; (* appending last n when exit *)
      Break[]
      ];
     qr = QuotientRemainder[n, A[[i]]]; (* calculating both quotient and reminder *)
     ans = Append[ans, qr[[2]]]; (* adding second member to the answer *)
     Print[qr]; (* printing *)
     n = qr[[1]]; (* using first member as new n to process *)
     ];
    ans (* printing result in Mathematica manner *)
    

    It gives

    {1, 1, 3, 1}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have following quiz: Let x be an integer larger than the odd number
Let's say I have an integer called 'score', that looks like this: int score
Let's say I have integer variables x and y, and I want an array
Let's say I have $t0 , and I'd like to divide its integer contents
Let's say I want to upload unsigned integer and float data to the graphics
Let say we have a table with 6 million records. There are 16 integer
I have a table with an auto-increment integer field ID. Let's say there's a
Is there any way to let Drools handle a String, Integer comparison without having
Let's say there is a linked list with a point for each integer in
Let's say that i have a variable questionId which is an integer, and i

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.