All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Factor it (Posted on 2019-03-19) Difficulty: 3 of 5
What is the largest prime factor of 8888888899999999?

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
re: Solution .... hmmm | Comment 2 of 4 |
(In reply to Solution by Jer)

The following program runs on an Android phone, using an available app, Basic, from Mintoris, in the Play Store, that is used to interpret it. It factors 8888888899999999 in under a second, much faster apparently than the calculator program, and I'd think the program entry is no more tedious than entering a program on say a TI-84.


The number in question is at about the limit of the available accuracy.

1 INPUT n
PRINT n
prev = 2 * n
limit = CEIL(SQRT(n))
dv = 2
GOSUB 10000
dv = 3
GOSUB 10000
dv = 5
GOSUB 10000
dv = 7
100   GOSUB 10000
   dv = dv + 4
   GOSUB 10000
   dv = dv + 2
   GOSUB 10000
   dv = dv + 4
   GOSUB 10000
   dv = dv + 2
   GOSUB 10000
   dv = dv + 4
   GOSUB 10000
   dv = dv + 6
   GOSUB 10000
   dv = dv + 2
   GOSUB 10000
   dv = dv + 6
IF dv <= limit THEN 100
IF n > 1 THEN
 PRINT
 PRINT n;
ENDIF
PRINT
WAIT
CLS
GOTO 1

10000 q = INT(n / dv)
    IF q * dv <> n OR n <= 0 THEN 10200
    n = q
    IF dv <> prev THEN PRINT
    IF   dv = prev THEN PRINT ",";
    PRINT dv;
    prev = dv
    IF n > 0 THEN limit = CEIL(SQRT(n))
    IF n = 0 THEN limit = 0
GOTO 10000
10200 RETURN

The line numbers were left over from translation from Applesoft Basic on an Apple ][+ computer.

  Posted by Charlie on 2019-03-19 11:37:55
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information