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

Home > Numbers
Upside down (OEIS A045573) (Posted on 2014-04-11) Difficulty: 3 of 5
Some numbers remain numbers when turned upside down (using digits 0125689, with no final 0's): 1, 2, 5, 6, 8, 9, 11, 12, … etc

IF a1=1, a2=2, a3=5,... a8=12,…, etc

a.Evaluate a100
b. Evaluate a1000
c. If an= 888, what is n?

See The Solution 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 6

valid$ = "0125689"

PRINT
FOR i = 1 TO 19000
  s$ = LTRIM$(STR$(i))
  found = 1
  FOR j = 1 TO LEN(s$)
     IF INSTR(valid$, MID$(s$, j, 1)) = 0 THEN found = 0
  NEXT
  IF RIGHT$(s$, 1) = "0" THEN found = 0
  IF found THEN
     ct = ct + 1
     IF ct < 15 OR ct = 100 OR ct = 1000 OR i = 888 THEN PRINT ct, i:
  END IF
NEXT

finds

n            a(n)
1             1
2             2
3             5
4             6
5             8
6             9
7             11
8             12
9             15
10            16
11            18
12            19
13            21
14            22
100           226
245           888
1000          5286

 

So:

a. 226
b. 5286
c. 245

The proscription on terminal zero prevents easy use of an isomorphism with base-7 numbers, where we'd just assign the valid digits to the successive base-7 digits and use base-conversion algorithms.


  Posted by Charlie on 2014-04-11 15:47:31
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 (24)
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