[Question]
  [
**This question already has answers here**:
 
 
[Numbers with Rotational Symmetry](/questions/77866/numbers-with-rotational-symmetry)
 (43 answers)
 
Closed 1 year ago.
## Background
You are working for some board-game manufacturer and need to produce wooden tiles with the numbers from 0 to *n* engraved on them for some game. However, without further ado, some tiles would become indistinguishable, e.g., `6` and `9`. To avoid this, you have to equip numbers that can be confused with others (and only those) with a disambiguating dot, e.g., you would have tiles like `9.` or `6089.`.
Unfortunately, you need to use some old, yet programmable wood-engraving device for this, whose interface is so broken that you have to encode every character of the program by hand in an unspeakably tedious process. Fortunately the device understands every existing programming language. Thus you are looking for the shortest program that prints such tiles.
## Actual task
Write the shortest program that:
* Takes a positive integer *n* as input. How the input is read is up to you.
* Prints each of the numbers from 0 to *n* (0 and *n* included) exactly once in an order of your choice, separated by a single whitespace character (including newline). The numbers are to be printed without leading zeros.
* Appends a dot (.) to every number that turns into another, valid number upon rotation by π (180 °), even if that number is larger than *n.* Your typeface’s 0 and 8 are rotation-symmetric and the 9 is a rotated 6. The 2 and 5 are distinct upon rotation; the 1 is not rotation-symmetric. Numbers with leading zeros are not valid.
## Examples
Each of the following numbers has to be printed exactly this way:
* `2`
* `4`
* `5`
* `6.`
* `8`
* `9.`
* `16`
* `60`
* `66.`
* `68.`
* `69`
* `906`
* `909.`
* `8088.`
* `9806.`
* `9886`
* `9889.`
  
[Answer]
# CJam, ~~46~~ ~~44~~ ~~43~~ 42 bytes
```
l~),{_A%g1$s_6890s-!\_69s_W%erW%=!&&'.*N}/
```
I think there's some room for improvement.
[Test it here.](http://cjam.aditsu.net/)
## Explanation
```
l~),{_A%g1$s_6890s-!\_69s_W%erW%=!&&'.*N}/
l~                                         "Read an eval input.";
  ),                                       "Get range from 0 to n.";
    {                                   }/ "For each...";
     _                                     "Get a copy of the integer.";
      A%g                                  "Ends with digit other than 0?";
         1$s_                              "Get another copy, convert to string, get a copy.";
             0689s-!                       "Contains rotation-safe digits?";
                    \                      "Swap with other copy.";
                     _                     "Get another copy.";
                      69s_W%er             "Swap 6 and 9.";
                              W%           "Reverse.";
                                =!         "Is different from original?";
                                  &&       "AND all three conditions.";
                                    '.*    "If true, push a period (else, an empty string).";
                                       N   "Push a newline.";
```
[Answer]
# CJam, ~~46 45 43~~ 42 bytes
```
ri){Is___69`96`erW%=!\6809`-!&IA%g&'.*N}fI
```
I think it can be golfed a little more.
Takes `n` from STDIN.
[Try it online here](http://cjam.aditsu.net/)
[Answer]
## [Pyth](https://github.com/isaacg1/pyth) - 34 ~~38~~
```
VhQJ`N+J*\.&nJX_J`69`96&eN!-J"0689
```
I must give thanks to @Sp3000 for helping me remove 4 bytes. I originally had an additional check `&@JK` which made sure there was a 6 or 9 in the number, but after perusing the answers before posting, I read his answer and noticed that my identical translation and reversal already took care of that.
Also thanks to @isaacg for pointing out that strings are iterables, and you can use set operations on them. Also for making the current code ;)
Explanation:
```
                                    : (implicit) Q=eval(input())
VhQ                                 : for N in range(Q+1):
   J`N                              : J=str(N)
      +J*\.                         : J + "." * ...
           &nJX_J`69`96             : J!=translate(reversed(J),"69","96") and...
                       &eN          : N%10 and...
                          !-J"0689  : not(setwise_difference(J, "0689"))
```
[Answer]
## APL 66
```
∊' ',¨{a←⌽'0.....9.86'[⎕D⍳b←⍕⍵]⋄'.'∊a:b⋄('0'=⊃a)∨⍵=⍎a:b⋄b,'.'}¨0,⍳
```
***Explanation:***
```
¨0,⍳           applies the function to each number 0-n
a←⌽'0.....9.86'[⎕D⍳b←⍕⍵] inverts 6s and 9s, leaving 8s and 0s, and replacing other numbers with dots. Reverses vector after substitution.
'.'∊a          if there is a dot in the number....
('0'=⊃a)       .. or if the number starts with 0...
⍵=⍎a           or if the (inverted) number is the same as original
:b             then print the original number
b,'.'          else print a dot in the end
∊' ',¨        Finally to give the result in the asked format i add a single space after each result and join them all 
```
Try it on [tryapl.org](http://tryapl.org/?a=%2C/%27%20%27%2C%A8%7Ba%u2190%u233D%270.....9.86%27%5B%u2395D%u2373b%u2190%u2355%u2375%5D%u22C4%27.%27%u220Aa%3Ab%u22C4%28%270%27%3D%u2283a%29%u2228%u2375%3D2%u2283%u2395VFI%20a%3Ab%u22C4b%2C%27.%27%7D%A80%2C%u237370&run)
*Note that in the online interpreter the ⍎ function doesn't work so i had to substitute it with 2⊃⎕VFI which does the same in this case, executes and returns the number, given a string.*
[Answer]
# Perl 5, 53 bytes
```
say$_,"."x(!/[1-57]|0$/&&reverse!=y/96/69/r)for 0..<>
```
[Online demo.](http://ideone.com/LNerEO)
Uses the Perl 5.10+ `say` feature, so needs to be run with `perl -M5.010` (or `perl -E`) to enable it. (See [this meta thread.](https://codegolf.meta.stackexchange.com/questions/273/on-interactive-answers-and-other-special-conditions)) Reads input from stdin, prints to stdout.
[Answer]
# Python 2, ~~130~~ ~~116~~ 113 bytes
```
def f(n):S=`n`;n and f(n-1);print S+"."*all([n%10,set(S)<=set("0689"),(u""+S[::-1]).translate({54:57,57:54})!=S])
```
Defines a function `f` which prints the numbers to STDOUT, in ascending order.
This time I thought I'd take a leaf out of @feersum's book with `.translate` :)
Expanded:
```
def f(n):
 S=`n`        
 n and f(n-1)                                      # Recurse if not 0                                     
 print S+"."*all([n%10,                            # Not divisible by 10
                  set(S)<=set("0689"),             # Consists of 0689
                  (u""+S[::-1]).translate
                  ({54:57,57:54})!=S])             # When rotated is not itself
```
---
Previous solution:
```
def f(n):S=`n`;print S+"."*all([n%10,set(S)<=set("0689"),eval("S[::-1]"+".replace('%s','%s')"*3%tuple("6a96a9"))!=S]);n and f(n-1)
```
Thanks to @xnor for showing me the `.replace` trick some time ago.
[Answer]
# C#, ~~343~~ 309 characters
*Way* too long, but anyway:
```
namespace System.Linq{class C{static void Main(){int n=int.Parse(Console.ReadLine());for(int i=0;i<=n;i++){var b=i+"";var c=b.Replace("6","9");Console.Write(b+(b.All(x=>x=='0'|x=='8'|x=='6'|x=='9')&!b.EndsWith("0")&!(b.Count(x=>x=='6')==b.Count(x=>x=='9')&new String(c.Reverse().ToArray())==c)?". ":" "));}}}}
```
How does it work? To add a period to the number, it must match the following requirements:
* Consists only of `0`, `8`, `6` and `9`.
* Does not end with a zero.
* Is not the same number when you rotate it:
	+ If a number has an equal amount of `6`s and `9`s, and
	+ if `c` = the number with all `6`s replaces with `9`s,
	+ and reversed `c` == `c`,
	+ then: the rotated number is the same as the number itself.
The numbers are separated by a space.
Code with indentation:
```
namespace System.Linq
{
    class C
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i <= n; i++)
            {
                var b = i + "";
                var c = b.Replace("6", "9");
                Console.Write(b +
                    (b.All(x => x == '0' | x == '8' | x == '6' | x == '9') &
                    !b.EndsWith("0") &
                    !(b.Count(x => x == '6') == b.Count(x => x == '9') &
                    new String(c.Reverse().ToArray()) == c) ? ". " : " "));
            }
        }
    }
}
```
[Answer]
# M (MUMPS) - ~~72~~ 70
```
R n F i=0:1:n W !,i S r=$TR($RE(i),69,96) W:r=+r*r'=i*'$TR(i,0689) "."
```
Most built-in commands and functions in M have abbreviated versions. I've used the full names below.
`READ n` - Read a string from the keyboard and store it in `n`.
`FOR i=0:1:n` - Loop from zero to `n`, incrementing `i` by 1 each time. (The remainder of the line constitutes the body of the loop.)
`WRITE !,i` - Print a newline followed by the value of `i`.
`SET r=$TRANSLATE($REVERSE(i),69,96))` - Reverse `i`, replace nines with sixes and sixes with nines, and store that in `r`.
`WRITE:r=+r*r'=i*'$TRANSLATE(i,0689) "."`
* `:` - Denotes a postconditional expression, so the `WRITE` command is only executed if `r=+r*r'=i*'$TRANSLATE(i,0689)` evaluates to a truthy value.
* `r=+r` - Check that `r` doesn't have a leading zero. The unary `+` operator converts a string to a number, which strips leading zeroes if there are any.
* `*` - Multiplication operator. M has no order of operations; all binary operators are evaluated in the order they appear from left to right.
* `r'=i` - Check that `i` isn't the same as it's flipped version `r`.
* `'$TRANSLATE(i,0689)` - Remove all zeros, sixes, eights, and nines from `i`, and check that there's nothing left. (`'` is the logical negation operator.)
* `"."` - Finally the argument to the `WRITE` command (a literal string).
**Edit:** Made it a little shorter by abusing the multiplication operator. Previous version:
```
R n F i=0:1:n W !,i S r=$TR($RE(i),69,96) I '$TR(i,0689),i'=r,r=+r W "."
```
[Answer]
# APL, 53 characters
[`∊{⍵,'. '↓⍨∨/(3≡⊃i)(5∊i),⍵≡'9608x'[i←⌽'6908'⍳⍵]}∘⍕¨0,⍳`](http://tryapl.org/?a=%u220A%7B%u2375%2C%27.%20%27%u2193%u2368%u2228/%283%u2261%u2283i%29%285%u220Ai%29%2C%u2375%u2261%279608x%27%5Bi%u2190%u233D%276908%27%u2373%u2375%5D%7D%u2218%u2355%A80%2C%u2373100&run)
```
0,⍳N        numbers 0..N
{...}∘⍕¨    format each number as a string and do the thing in curly braces
                inside the braces ⍵ is the current string
'6908'⍳⍵    encode '6' as 1, '9' as 2, '0' as 3, '8' as 4, and all others as 5
⌽           reverse
'9608x'[A]  use each element of A as an index in '9608x':
                effectively: swap '9'←→'6', preserve '08', mask other digits
⍵≡          does it match the original string?
                this is the first boolean condition, two more to come
5∊i         did we have a digit other than '0689'?
3≡⊃i        is the first of i (that is, the last of ⍵) a '0' (encoded as 3)?
∨/          disjunction ("or") over the three conditions, returns 0 or 1
'. '↓⍨      drop 0 or 1 elements from the beginning of the string '. '
⍵,          prepend ⍵
∊           flatten the results to obtain a single output string
```
[Answer]
# C# 205 ~~209~~
C# doesn't have to be so long...  
more or less, a port of my JavaScript answer
```
class P{static void Main(string[]a){for(int n=int.Parse(a[0]);n>=0;--n){string p="",u=n+p;int e=n%10;foreach(var d in u)p=(d<56?d!=54?d>48?e=0:0:9:120-d-d)+p;System.Console.WriteLine(e!=0&p!=u?u+".":u);}}}
```
**Ungolfed**
```
class P 
{
    static void Main(string[] a)
    {
        for (int n = int.Parse(a[0]); n >= 0; --n)
        {
            string p = "", u = n + p;
            int e = n % 10;
            foreach (var d in u) p = (d < 56 ? d != 54 ? d > 48 ? e = 0 : 0 : 9 : 120 - d - d) + p;
            System.Console.WriteLine(e != 0 & p != u ? u + "." : u);
        }
    }
}
```
[Answer]
# Ruby, 81
```
?0.upto(*$*){|x|puts x.reverse.tr('69','96')!=x&&x=~/^[0689]+$/&&/0$/!~x ?x+?.:x}
```
Input is taken from the command line.
Generates a list of `String`s from `0` to `n`. It loops trough them and prints them. It appends a dot if all conditions are satisfied:
* reversing the number and replacing the `6`s with `9`s doesn't yield the original
* the number only consists of the digits `0`, `6`, `8` and `9`
* the number doesn't end with `0`
[Answer]
# sed, 467
Longer than C#...
I pretty much completed this when @edc65 pointed out that answers need to process numbers 0-n and not just n. Adding the sed code to increment 0-n adds a LOT more code, as this task is ill-suited to arithmetic-less sed.
```
:l
/^[0689]*$/{
h
s/$/:/
:x
s/([0-9]):(.*)/:\2\1/
tx
s/://
y/69/96/
G
/^([0-9]+)\n\1/be
s/^[^0].*/&./
:e
s/.*\n//
}
p
s/\.//
s/[0-9]/<&/g
s/0//g;s/1/_/g;s/2/__/g;s/3/___/g;s/4/____/g;s/5/_____/g
s/6/______/g;s/7/_______/g;s/8/________/g;s/9/_________/g
:t
s/_</<__________/
tt
s/<//g
s/_//
:b
s/__________/</g
s/<([0-9]*)$/<0\1/
s/_________/9/;s/________/8/;s/_______/7/;s/______/6/
s/_____/5/;s/____/4/;s/___/3/;s/__/2/;s/_/1/
s/</_/g
tb
s/^$/0/
/^0$/by
bl
:y
c\
0
p
```
As per the OP, ordering doesn't matter, so we work downwards from n to 0.
### Output:
```
$ sed -rnf rotproof.sed <<< 100 | grep "\."
99.
98.
89.
86.
68.
66.
9.
6.
$ 
```
[Answer]
# bc, 158
After [doing this purely in sed](https://codegolf.stackexchange.com/a/42963/11259) using all string and regex operations with no native arithmetic, I was curious to see how this would look the other way around, i.e. all arithmetic and logic operations and no string/regex:
```
for(i=read();i+1;r=0){p=1
for(x=i;x;x/=A){d=x%A
if(x==i&&!d)p=0
if(d==6||d==9)d=F-d else if(d%8)p=0
r=r*A+d}
if(r==i)p=0
print i--
if(p)print "."
print "\n"}
```
Output is sorted in descending order.
### Output:
```
$ bc rotproof.bc <<< 100 | grep "\."
99.
98.
89.
86.
68.
66.
9.
6.
$ 
```
[Answer]
# JavaScript (ES6) 101 ~~104 106 109~~
A function with n as argument, output via console.log  
**Edit** using %10 to test for leading 0  
**Edit 2** `for` reorganization, I don't need array comprehension after all  
**Edit 3** modified (again) the check for leading 0
```
F=n=>{
   for(;e=~n;console.log(e*l&&p-n?n+'.':n),--n)
     for(d of(p='')+n)p=(l=d<8?d-6?-d?e=0:0:9:24-d-d)+p
}
```
**Ungolfed** and easier to test
```
F=n=>
{
  o = '';
  for( ; ~n; --n) // loop on n decreasing to 0 (~n is 0 when n==-1)
  {
    e = ~n; // init to a nonzero value, zero will mark 'invalid digit'
    p = ''; // build rotated number in p
    for(d of '' + n)
    {
      // l is the current digit, on exit will be the first digit of p
      l = d < 8 ?
            d != 6 ?
              d != 0 ?
                e = 0 // invalid char found, no matter what
                : 0 
              : 9 // 6 become 9
            : 24 - d - d; // calc 8 => 8, 9 => 6
      p = l + p;
    }       
    // e==0 if invalid char, l==0 if leading 0
    o += ' ' + ( e * l && p-n ? n+'.' : n);
  }
  console.log(o);
}
F(100)
```
*Output*
```
100 99. 98. 97 96 95 94 93 92 91 90 89. 88 87 86. 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68. 67 66. 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9. 8 7 6. 5 4 3 2 1 0
```
[Answer]
# Bash + coreutils, 105
```
for((i=0;i<=$1;i++));{
[ ${i//[0689]/} ]||[ $i = `rev<<<$i|tr 69 96` ]||((!${i: -1}))||d=.
echo $i$d
d=
}
```
### Test:
```
$ ./rotproof.sh 100 | grep "\."
6.
9.
66.
68.
86.
89.
98.
99.
$ 
```
[Answer]
## AWK: 120
```
{a[a[6]=9]=6;a[8]=8;for(j=a[0]=0;j<=$0;++j){r="";for(i=j;i;i=int(i/10))r=r a[i%10];print(j~/[^0689]|0$/||j==r)?j:j"."}}
```
Read the n value from stdin.
Test:
> 
> C:\AWK>gawk -f revnum.awk|grep \.  
> 
> 100  
> 
> ^Z  
> 
> 6.  
> 
> 9.  
> 
> 66.  
> 
> 68.  
> 
> 86.  
> 
> 89.  
> 
> 98.  
> 
> 99.
> 
> 
> 
[Answer]
# Rebol - 195
```
for n 0 do input 1[b: copy a: form n d: c: 0 parse reverse a[any[m:"6"(change m"9"++ c)|"9"(change m"6"++ c)|"0"|"8"| skip(++ d)]]print rejoin [b either all[d = 0 c > 0 a != b a/1 != #"0"]"."{}]]
```
Ungolfed + some annotations:
```
for n 0 do input 1 [
    b: copy a: form n
    d: c: 0
    ; reverse number and rotate "6" & "9"
    ; and do some counts (c when "6" or "9" and d when != "0689")
    parse reverse a [
        any [
            m:
              "6" (change m "9" ++ c)
            | "9" (change m "6" ++ c)
            | "0"
            | "8"
            | skip (++ d)
        ]
    ]
    print rejoin [
        b either all [
            d = 0               ; only has 0689 digits
            c > 0               ; must have at least one "6" or "9"
            a != b              ; not same when reversed
            a/1 != #"0"         ; does not "end" with zero
        ]
        "." {}                  ; if ALL then print "." else blank {}
    ]
]
```
[Answer]
# Python - 152
```
for i in range(input()+1):print`i`+("."*all([j in"0689"for j in`i`])and`i`[-1]!="0"and`i`!=`i`.replace("9","x").replace("6","9").replace("x","6")[::-1])
```
[Answer]
# JavaScript - 168 129 119 113 111 108
```
F=n=>{for(;~n;n--){r='';for(c of""+n)r=(c-6?c-9?c:6:9)+r;console.log(r-n&&!/[1-57]/.test(r)&&n%10?n+".":n)}}
```
> 
> 4 5 6. 8 9. 16 60 66. 68. 69 906 909. 6090 9806. 9886 9889.
> 
> 
> 
Or readable version:
```
F=n=>{for(;~n;n--){
    r='';for(c of ""+n)r=(c-6?c-9?c:6:9)+r; // rotate
    console.log( // output, new-line is added
        // original number, and
        // append dot only if number is different than its rotated version and no un-rotatable digit is present and there is no zero at the end
        r-n && !/[1-57]/.test(r) && n%10
           ?n+".":n
    )}}
```
I am not very happy with the regex, any ideas?
**Edit**: Learned neat trick with `~` and `for (... of ...)` from @edc65
  
**Edit2**: Reorganized conditions
  
**Edit3**: applied suggestions by @edc65
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~38~~ ~~37~~ ~~30~~ 29 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ÝεÐSUT%ĀiŽR!XåPiÐ69Â‡RÊi'.«]»
```
[Try it online.](https://tio.run/##ATgAx/9vc2FiaWX//8OdzrXDkFNVVCXEgGnFvVIhWMOlUGnDkDY5w4LigKFSw4ppJy7Cq13Cu///MTAwMA)
**Explanation:**
```
Ý                # Inclusive 0-based range: [0, (implicit) input]
 ε               # Map each integer to:
  Ð              #  Triplicate the current integer
  SU             #  Convert it to a list of digits, and pop and store it in variable `X`
    T%Āi         #  If the current integer contains no trailing zeros
    ŽR!XåPi      #  And if the current integer only consists of the digits [0689]
    Ð69Â‡RÊi     #  And if the current integer is not the same when its 6s and 9s
                 #  are swapped and then the total is reversed
             '.« #   Concat a '.'
                 #  Implicit else: use the top of the stack (the duplicate current integer)
]                # Close all three ifs and the map
 »               # Join the resulting list by newlines (and output implicitly)
```
Additional explanation for some parts:
```
T%Āi       # Check if the integer contains no trailing zeros:
T          #  Push 10 (T is a builtin for 10)
 %         #  Modulo
  Ā        #  Trutified: 0 remains 0 (falsey), everything else becomes 1 (truthy)
           #   i.e. 12 % 10 → 2 → 1 (truthy)
           #   i.e. 68 % 10 → 8 → 1 (truthy)
           #   i.e. 70 % 10 → 0 → 0 (falsey) (70 remains as is)
           #   i.e. 609 % 10 → 9 → 1 (truthy)
           #   i.e. 808 % 10 → 8 → 1 (truthy)
ŽR!XåPi    # Check if the integer only consists of the digits 0, 6, 8 and/or 9:
ŽR!        #  Push 6890 (Ž is a builtin for 2-char compressed integers, where R! is 6890)
   X       #  Push variable `X` (the list of digits)
    å      #  Check for each of these digits if they're in "6890"
     P     #  Take the product of that list
           #   i.e. [1,2] → [0,0] → 0 (falsey) (12 remains as is)
           #   i.e. [6,8] → [1,1] → 1 (truthy)
           #   i.e. [6,0,9] → [1,1,1] → 1 (truthy)
           #   i.e. [8,0,8] → [1,1,1] → 1 (truthy)
Ð69Â‡RÊi   # Check if the integer with 6s and 9s swapped and then reversed isn't unchanged:
Ð          #  Triplicate the integer
 69        #  Push 69
   Â       #  Bifurcate (short for Duplicate & Reverse)
    ‡      #  Transliterate (in `a` replace all characters `b` with characters `c`)
     R     #  Reverse
      Ê    #  Check for inequality
           #   i.e. 68 → "68" → "98" → "89" → 68 != "89" → 1 (truthy) (68 becomes "68.")
           #   i.e. 609 → "609" → "906" → "609" → 609 != "609" → 0 (falsey) (609 remains as is)
           #   i.e. 808 → "808" → "808" → "808" → 808 != "808" → 0 (falsey) (808 remains as is)
```
[Answer]
# Perl - 84
```
for(0..$ARGV[0]){s/6/x/g;s/9/6/g;s/x/9/g;printf"$_%s\n",$_=~/^[0689]+[689]$/?".":""}
```
[Answer]
# Powershell, ~~111~~ 102 bytes
```
param($s)$s+'.'*!($s-match'[1-57]|0$|'+-join$(switch -r($s[($s.Length-1)..0]){'0|8'{$_}'6'{9}'9'{6}}))
```
Explained test script:
```
$f = {
param($s)           # input string
$l=$s.Length        # length of the string
$c=$s[($l-1)..0]    # chars of the string in the reversed order
$d=switch -r($c){   # do switch with regex cases for each char
    '0|8'{$_}       # returns the current char if it equal to 8 or 0
    '6'{9}          # returns 9 if the current char is 6
    '9'{6}          # returns 6 if the current char is 9
}                   # returns array of new chars (contains 0,6,8,9 only)
$s+'.'*!(            # returns s. Add '.' if not...
    $s-match'[1-57]|0$|'+-join$d
                    # $s contains chars 1,2,3,4,5,7 or
                    # ends with 0 or
                    # equal to string of $d
)
}
@(
    ,('2'    ,'2'   )
    ,('4'    ,'4'   )
    ,('5'    ,'5'   )
    ,('6.'   ,'6'   )
    ,('7'    ,'7'   )
    ,('9.'   ,'9'   )
    ,('16'   ,'16'  )
    ,('60'   ,'60'  )
    ,('66.'  ,'66'  )
    ,('68.'  ,'68'  )
    ,('69'   ,'69'  )
    ,('906'  ,'906' )
    ,('909.' ,'909' )
    ,('8088.','8088')
    ,('9806.','9806')
    ,('9886' ,'9886')
    ,('9889.','9889')
) | % {
    $e,$s = $_
    $r = &$f $s
    "$($r-in$e): $r"
}
```
Output:
```
True: 2
True: 4
True: 5
True: 6.
True: 7
True: 9.
True: 16
True: 60
True: 66.
True: 68.
True: 69
True: 906
True: 909.
True: 8088.
True: 9806.
True: 9886
True: 9889.
```
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 27 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
Ç▒≈♣▌╬"÷╜─B↓«âpø←╚S☼ì>♫è;&╛
```
[Run and debug it](https://staxlang.xyz/#p=80b1f705ddce22f6bdc44219ae8370001bc8530f8d3e0e8a3b26be&i=100&a=1)
Unpacked, ungolfed, and commented, it looks like this.
```
0p      print 0 with no line break
F       for each [1 .. n] execute the rest of the program, where n is the input
  zP    print a newline
  q     peek and print the iterating variable without newline
  A%!C  modulo 10, and cancel iteration if zero (this cancels for multiples of 10)
  _$cc  convert iterating value to string and duplicate it twice on the stack
  7R6-$ construct the string "123457"
  |&C   if the character intersection is truthy, cancel the iteration
  r     reverse string
  69$:t map 6 and 9 characters to each other
  =C    if this rotated string is equal to the original, cancel iteration
        print "." with no newline 
        (this comment precedes the instruction because it's an unterminated literal)
  ".
```
[Run this one](https://staxlang.xyz/#c=0p+++++%09print+0+with+no+line+break%0AF++++++%09for+each+[1+..+n]+execute+the+rest+of+the+program,+where+n+is+the+input%0A++zP+++%09print+a+newline%0A++q++++%09peek+and+print+the+iterating+variable+without+newline%0A++A%25%21C+%09modulo+10,+and+cancel+iteration+if+zero+%28this+cancels+for+multiples+of+10%29%0A++_%24cc+%09convert+iterating+value+to+string+and+duplicate+it+twice+on+the+stack%0A++7R6-%24%09construct+the+string+%22123457%22%0A++%7C%26C++%09if+the+character+intersection+is+truthy,+cancel+the+iteration%0A++r++++%09reverse+string%0A++69%24%3At%09map+6+and+9+characters+to+each+other%0A++%3DC+++%09if+this+rotated+string+is+equal+to+the+original,+cancel+iteration%0A+++++++%09print+%22.%22+with+no+newline+%0A+++++++%09%28this+comment+precedes+the+instruction+because+it%27s+an+unterminated+literal%29%0A++%22.&i=100&a=1)
]