Forums before death by AOL, social media and spammers... "We can't have nice things"
|    sci.math.symbolic    |    Symbolic algebra discussion    |    10,432 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 9,637 of 10,432    |
|    Nasser M. Abbasi to Luke Earles    |
|    Re: Determing if a number is Even or Odd    |
|    26 Sep 17 22:41:38    |
   
   0e8182e2   
   From: nma@12000.org   
      
   On 9/26/2017 8:00 PM, Luke Earles wrote:   
   > If we have an odd number n, then we multiply it by 3 and add one (n*3+1), we   
   know we will get an Even number p. How can one determine how many times p can   
   be divided by two before it is odd again?   
   >   
   > Another way of asking the same question. if we have (n*3+1)/(2 to some   
   power), how can we determine if the number produced will be odd or even   
   depending on the chosen n and the chosen power of two?   
   >   
   > Is there a way to symbolize divide by two until odd in a function?   
   > Thanks for all the help!   
   >   
      
   one way might be to find prime factorization of the number   
   and count how many powers of 2's are there? In Mathematica:   
      
   ===============   
   p=84;   
   r=FactorInteger[p];   
    2^2*3^1*7^1   
      
   Cases[r,{2,x_}:> x]   
    {2}   
   ==============   
      
   so after 2 divisions by 2, 84 becomes odd. 84->42->21   
      
   ==================   
   p=14448;   
   r=FactorInteger[p];   
    2^4*3^1*7^1*43^1   
      
   Cases[r,{2,x_}:> x]   
    {4}   
   ================   
      
   so after 4 divisions by 2, 14448 becomes odd.   
   14448->7224->3612->1806->903   
      
   If you are looking for a formula, I do not know.   
      
   --Nasser   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca