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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:26:31+00:00 2026-06-15T15:26:31+00:00

I am trying to do a dynamic Collatz algorithm but seem to have incorrect

  • 0

I am trying to do a dynamic Collatz algorithm but seem to have incorrect answers beyond at least 626331 or greater. all of the others seem to be correct. ive been working on this for hours and cant figure out what my problem is. can anyone give me a suggestion to help. thanks

int DynamicCollatz::DynCollatzConjecture(__int64 n)
  • 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-15T15:26:32+00:00Added an answer on June 15, 2026 at 3:26 pm

    The maximum value generated by the Collatz algorithm for value 626331 is:

    o = 626331 m = 7222283188 c = 508
    

    That number is tidily larger than will fit into a 32-bit (unsigned) int. (The c is the count of the steps taken to get to 1.)

    I used this bc script (which I have stashed away because the Collatz algorithm turns up on SO most years) to deduce that information:

    define collatz(n) {
        if (n<=0) halt;
        m=n;o=n;c=0;
        while(n>1){
            if(n%2)n=n*3+1 else n/=2; c=c+1;
            if(n>m)m=n;
        }
        print "o = ",o," m = ",m," c = ",c,"\n";
    }
    
    collatz(626331)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add dynamic form fields to jsf form. But even following
I have been trying to use dynamic LINQ to Entity in my application for
I'm trying to write dynamic method that calls Parallel.ForEach. I have checked a IL
I'm trying to implement Dynamic Scrollbox found in http://demo.webdeveloperplus.com/dynamic-scrollbox/ but it has a problem
I have a dynamic page and am trying to build dynamic links (domain.com/#/page2/content/etc). If
So here is the problem: I am trying to create dynamic buttons that have
I am trying to use Dynamic Linq library in my code, but it gives
I am trying to dynamic radio buttons to a custom dialog but not able
We are trying to add dynamic kml to google earth.But we are failing in
I am trying to create dynamic html table but the problem is that it

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.