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

Home > Numbers
Pandigital? (Posted on 2013-01-25) Difficulty: 3 of 5
What is the largest perfect power (in base ten) that contains no repeated digits?.

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 7

The largest exponent would be the one needed make 2^p reach 9876543210--that's log2(9876543210) > 33, so we'll use 34 as the largest exponent. With each exponent we'll raise the base number until we get too large a number. The highest non-repeating-digit result will be reported.


DEFDBL A-Z
FOR pwr = 2 TO 34
  b = 2
  DO
    n = INT(b ^ pwr + .5)
    ns$ = LTRIM$(STR$(n))
    good = 1
    FOR i = 1 TO LEN(ns$) - 1
     FOR j = i + 1 TO LEN(ns$)
      IF MID$(ns$, i, 1) = MID$(ns$, j, 1) THEN good = 0: EXIT FOR
     NEXT
     IF good = 0 THEN EXIT FOR
    NEXT
    IF good THEN
     IF n > max THEN max = n: bmax = b: pmax = pwr
    END IF
    IF n > 9999999999# THEN EXIT DO
    b = b + 1
  LOOP
NEXT pwr
PRINT bmax; "^"; pmax; "="; max

finds

 99066 ^ 2 = 9814072356

 

Edited on January 26, 2013, 10:24 am
  Posted by Charlie on 2013-01-25 16:29:24

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