Skip to main content
deleted 265 characters in body
Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264

#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 | tr '\n' ' ' | foldgrep -s"\."
0 1 2 3 4 5 6. 7 8  
9. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 
55 56 57 58 59 60 61 62 63 64 65 66. 67  
68. 69 70 71 72 73 74 75 76 77 78 79 80 
81 82 83 84 85 86. 87 88  
89. 90 91 92 93 94 95 96 97  
98.  
99. 100 $ 
$ 

#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 | tr '\n' ' ' | fold -s
0 1 2 3 4 5 6. 7 8 9. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 
55 56 57 58 59 60 61 62 63 64 65 66. 67 68. 69 70 71 72 73 74 75 76 77 78 79 80 
81 82 83 84 85 86. 87 88 89. 90 91 92 93 94 95 96 97 98. 99. 100 $ 
$

#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.
$ 
added 191 characters in body
Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264

#Bash + coreutils, 77105

for((i=0;i<=$1;i++));{
[ ${1i//[0689]/} ]||[ $1$i = `rev<<<$1|tr`rev<<<$i|tr 69 96` ]||((!${1i: -1}))||d=.
echo $1$d$i$d
d=
}

###Test:

$ for./rotproof.sh i100 in| tr '\n' ' ' | fold -s
0 1 2 3 4 5 6. 7 8 9. 10 11 12 13 14 15 16 6017 6618 6819 6920 90621 90922 980623 988624 9889;25 do26 ./rotproof.sh27 $i;28 done
2
4
5
6.
8
9.
1629 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 
55 56 57 58 59 60
  61 62 63 64 65 66.
  67 68.
  69
906 70 71 72 73 74 75 76 77 78 79 80 
90981 82 83 84 85 86.
9806 87 88 89.
9886
9889 90 91 92 93 94 95 96 97 98. 99. 100 $ 
$

#Bash + coreutils, 77

[ ${1//[0689]/} ]||[ $1 = `rev<<<$1|tr 69 96` ]||((!${1: -1}))||d=.
echo $1$d

###Test:

$ for i in 2 4 5 6 8 9 16 60 66 68 69 906 909 9806 9886 9889; do ./rotproof.sh $i; done
2
4
5
6.
8
9.
16
60
 66.
 68.
 69
906
909.
9806.
9886
9889.
$

#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 | tr '\n' ' ' | fold -s
0 1 2 3 4 5 6. 7 8 9. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 
55 56 57 58 59 60 61 62 63 64 65 66. 67 68. 69 70 71 72 73 74 75 76 77 78 79 80 
81 82 83 84 85 86. 87 88 89. 90 91 92 93 94 95 96 97 98. 99. 100 $ 
$
Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264

#Bash + coreutils, 77

[ ${1//[0689]/} ]||[ $1 = `rev<<<$1|tr 69 96` ]||((!${1: -1}))||d=.
echo $1$d

###Test:

$ for i in 2 4 5 6 8 9 16 60 66 68 69 906 909 9806 9886 9889; do ./rotproof.sh $i; done
2
4
5
6.
8
9.
16
60
66.
68.
69
906
909.
9806.
9886
9889.
$