Basic factoring program/subroutine

Discussion in 'Software' started by sach2, Jan 21, 2007.

  1. sach2

    sach2 Major Geek Extraordinaire

    Hi,

    I'm just trying to do some simple math calculations using the BASIC language because it's sufficient for my needs and readily available without figuring out how to install various compilers. I'm not worried about efficiency. Unfortunately, I never actually learned BASIC in my youth and thus can't jog my memory.

    What I need is a simple factoring subroutine for integers. I would like to be able to end up with a line that looks something like:

    Print #2, x, (x^2 -5) /4, FACTOR((x^2 -5) /4 ) .............Where Factor is a predefined subroutine that factors an integer.

    So for x = 17 my output would be:

    17 71 71 [or include 1 so 1x71]

    For x = 29 my output would be:

    29 209 11x19

    I hope someone can give me a basic subroutine and instructions on how to call it in BASIC. Even if you don't know BASIC can someone give me the lines for factoring an integer and printing the factors in any programming language and I'll try to translate. Thanks for all help! :)

    ****************

    If there is a more readily available program language and compiler for math applications particularly good for large integers, I'd be happy to hear about it. Again, thanks for any input.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds