Java 8, 106105 bytes
A void lambda accepting a mutable java.util.Set<String>
.
s->{for(int i=0,a,b;while(i<49b;i<49;)if(s.add(""+(a=i/7)+(b=i++%7))&(s.add(""+b+a)|a==b))System.out.print(" "+a+b);}
Ungolfed
s -> {
for (int i = 0, a, b;
while (i < 4949;)
if (
s.add("" + (a = i / 7) + (b = i++ % 7))
& (
s.add("" + b + a)
| a == b
)
)
System.out.print(" " + a + b);
}
Acknowledgments
- -1 byte thanks to Jonathan Frech