# How many Strobogrammatic numbers are there from 0 to 99999

0,1,2,5,8,11,69,96 are Strobogrammatic numbers.

We call a Strobogrammatic numbers if:

When it is typed on a calculator, and the calculator is spun 180 degrees, the number visually looks the same.

How many Strobogrammatic numbers are there from 0 to 99999?

This is a no-computer puzzle; only the first right answer with explanation will be accepted.

• When your calculator use a segment-display, 1 would not be spin-able number (use segment b and c, but turned, it would be segment e and f). And if it use a other display, no Number would be a spin-able Number. Are leading zeros allowed, so that 020, 050, 080 or 0220 are are spin-able numbers? – 12431234123412341234123 Sep 27 '16 at 14:20
• When I spin my calculator by 180 degrees, the only digits I see are the serial number. – I'm with Monica Sep 27 '16 at 14:38
• For reference, these are the Strobogrammatic numbers – mbomb007 Sep 27 '16 at 15:55

assumption: we can not usually have leading zeroes on a calculator, they are usually stripped.

the spinnable digits are 0, 1, 2, 5, (6/9), and 8

For 1 digit

Pos 1: we can have any of the five non-paired options (0 is not stripped in this one instance, as 0 is displayed on the calculator)

Total: 5

For 2 digits:

Pos 1: we can have any of the six non-zero spinnable digits
Pos 2: we can only have the inverse digit of pos 1

Total 6x1 = 6

For 3 digits:

Pos 1: we can have any of the six non-zero spinnable digits
Pos 2: we can have any of the five self-referential spinnable digits
Pos 3: we can only have the inverse digit of pos 1

Total 6x5x1 = 30

For 4 digits:

Pos 1: we can have any of the six non-zero spinnable digits
Pos 2: we can have any of the seven spinnable digits
Pos 3: we can only have the inverse digit of pos 2
Pos 4: we can only have the inverse digit of pos 1

Total: 6x7x1x1 = 42

For 5 digits

Pos 1: we can have any of the six non-zero spinnable digits
Pos 2: we can have any of the seven spinnable digits
Pos 3: we can have any of the five self-referential spinnable digits
Pos 4: we can only have the inverse digit of pos 2
Pos 5: we can only have the inverse digit of pos 1
Total: 6x7x5x1x1 = 210

Thus all spinnable numbers from 0 to 99999 is the sum:
5+6+30+42+210 = 293

So:

There are 293 spinnable numbers between 0 and 99999

• 2 spun around is still 2, not 5, just like 5 spun around is still 5, not 2. – Josh Sep 27 '16 at 2:38
• Beside Josh comment, there are more than 195 numbers. – Jamal Senjaya Sep 27 '16 at 2:42
• @Josh ugh, you are right, brain is clearly not working, that bumps up the multiplications a bit, i'll amend – crcroberts Sep 27 '16 at 2:44
• @crcroberts Well done, green tick and upvote four you !! – Jamal Senjaya Sep 27 '16 at 2:52
• Heh, seems I'm WAY off. Time to go to sleep. Work all day with numbers, forget how to use them at night. :p – Josh Sep 27 '16 at 2:56

Late, but different approach.

Self spinnable numbers: 0, 1, 2, 5, 8
Spinnable pair: 6 and 9

1 digit (5)

All the self spinnable numbers

2 digits (6)

Self spinnable: 11, 22, 55, 88
Pair spinnable: 69, 96

3 digits (30)

Self spinnable: 1x1, 2x2, 5x5, 8x8
Pair spinnable: 6x9, 9x6

One digit spinnable numbers go into x
So, 6 x 5 = 30

4 digits (42)

Self spinnable: 1xx1, 2xx2, 5xx5, 8xx8
Pair spinnable: 6xx9, 9xx6

Two digits spinnable numbers (including 00) go into xx
So, 6 x 7 = 42

5 digits (210)

Self spinnable: 1xxx1, 2xxx2, 5xxx5, 8xxx8
Pair spinnable: 6xxx9, 9xxx6

Three digits spinnable numbers (including 000) go into xxx
So, 6 x (7 x 5) = 210

And, 5 + 6 + 30 + 42 + 210 is 293.

• I think the statement including 000 in your 5 digits calculation should really be including 0x0, otherwise your calculation would be 6 x (30 + 1) instead of 6 x ((6+1) x 5). – YowE3K Sep 27 '16 at 3:27