Questions   
Sort: 
 #4
avatar+1495 
+1
Feb 20, 2018
 #2
avatar+26367 
+2

The numbers 1,2,3,4,5,6,7,8,9 are arranged in a list so that each number
is either greater than all the numbers that come before it or
is less than all the numbers that come before it.
For example, 4,5,6,3,2,7,1,8,9 is one such list:

notice that (for instance) the 6 is greater than all the numbers that come before it,
and the 2 is less than all the numbers that come before it.
How many are such lists of the numbers 1,2,3,4,5,6,7,8,9 possible?

 

\(\begin{array}{|rrrr|} \hline \begin{array}{r|r} 1.& 123456789 \\ 2.& 213456789 \\ 3.& 231456789 \\ 4.& 234156789 \\ 5.& 234516789 \\ 6.& 234561789 \\ 7.& 234567189 \\ 8.& 234567819 \\ 9.& 234567891 \\ 10.& 321456789 \\ 11.& 324156789 \\ 12.& 324516789 \\ 13.& 324561789 \\ 14.& 324567189 \\ 15.& 324567819 \\ 16.& 324567891 \\ 17.& 342156789 \\ 18.& 342516789 \\ 19.& 342561789 \\ 20.& 342567189 \\ 21.& 342567819 \\ 22.& 342567891 \\ 23.& 345216789 \\ 24.& 345261789 \\ 25.& 345267189 \\ 26.& 345267819 \\ 27.& 345267891 \\ 28.& 345621789 \\ 29.& 345627189 \\ 30.& 345627819 \\ 31.& 345627891 \\ 32.& 345672189 \\ 33.& 345672819 \\ 34.& 345672891 \\ 35.& 345678219 \\ 36.& 345678291 \\ 37.& 345678921 \\ 38.& 432156789 \\ 39.& 432516789 \\ 40.& 432561789 \\ 41.& 432567189 \\ 42.& 432567819 \\ 43.& 432567891 \\ 44.& 435216789 \\ 45.& 435261789 \\ 46.& 435267189 \\ 47.& 435267819 \\ 48.& 435267891 \\ 49.& 435621789 \\ 50.& 435627189 \\ 51.& 435627819 \\ 52.& 435627891 \\ 53.& 435672189 \\ 54.& 435672819 \\ 55.& 435672891 \\ 56.& 435678219 \\ 57.& 435678291 \\ 58.& 435678921 \\ 59.& 453216789 \\ 60.& 453261789 \\ 61.& 453267189 \\ 62.& 453267819 \\ 63.& 453267891 \\ 64.& 453621789 \\ \end{array} & \begin{array}{r|r} 65.& 453627189 \\ 66.& 453627819 \\ 67.& 453627891 \\ 68.& 453672189 \\ 69.& 453672819 \\ 70.& 453672891 \\ 71.& 453678219 \\ 72.& 453678291 \\ 73.& 453678921 \\ 74.& 456321789 \\ 75.& 456327189 \\ 76.& 456327819 \\ 77.& 456327891 \\ 78.& 456372189 \\ 79.& 456372819 \\ 80.& 456372891 \\ 81.& 456378219 \\ 82.& 456378291 \\ 83.& 456378921 \\ 84.& 456732189 \\ 85.& 456732819 \\ 86.& 456732891 \\ 87.& 456738219 \\ 88.& 456738291 \\ 89.& 456738921 \\ 90.& 456783219 \\ 91.& 456783291 \\ 92.& 456783921 \\ 93.& 456789321 \\ 94.& 543216789 \\ 95.& 543261789 \\ 96.& 543267189 \\ 97.& 543267819 \\ 98.& 543267891 \\ 99.& 543621789 \\ 100.& 543627189 \\ 101.& 543627819 \\ 102.& 543627891 \\ 103.& 543672189 \\ 104.& 543672819 \\ 105.& 543672891 \\ 106.& 543678219 \\ 107.& 543678291 \\ 108.& 543678921 \\ 109.& 546321789 \\ 110.& 546327189 \\ 111.& 546327819 \\ 112.& 546327891 \\ 113.& 546372189 \\ 114.& 546372819 \\ 115.& 546372891 \\ 116.& 546378219 \\ 117.& 546378291 \\ 118.& 546378921 \\ 119.& 546732189 \\ 120.& 546732819 \\ 121.& 546732891 \\ 122.& 546738219 \\ 123.& 546738291 \\ 124.& 546738921 \\ 125.& 546783219 \\ 126.& 546783291 \\ 127.& 546783921 \\ 128.& 546789321 \\ \end{array} & \begin{array}{r|r} 129.& 564321789 \\ 130.& 564327189 \\ 131.& 564327819 \\ 132.& 564327891 \\ 133.& 564372189 \\ 134.& 564372819 \\ 135.& 564372891 \\ 136.& 564378219 \\ 137.& 564378291 \\ 138.& 564378921 \\ 139.& 564732189 \\ 140.& 564732819 \\ 141.& 564732891 \\ 142.& 564738219 \\ 143.& 564738291 \\ 144.& 564738921 \\ 145.& 564783219 \\ 146.& 564783291 \\ 147.& 564783921 \\ 148.& 564789321 \\ 149.& 567432189 \\ 150.& 567432819 \\ 151.& 567432891 \\ 152.& 567438219 \\ 153.& 567438291 \\ 154.& 567438921 \\ 155.& 567483219 \\ 156.& 567483291 \\ 157.& 567483921 \\ 158.& 567489321 \\ 159.& 567843219 \\ 160.& 567843291 \\ 161.& 567843921 \\ 162.& 567849321 \\ 163.& 567894321 \\ 164.& 654321789 \\ 165.& 654327189 \\ 166.& 654327819 \\ 167.& 654327891 \\ 168.& 654372189 \\ 169.& 654372819 \\ 170.& 654372891 \\ 171.& 654378219 \\ 172.& 654378291 \\ 173.& 654378921 \\ 174.& 654732189 \\ 175.& 654732819 \\ 176.& 654732891 \\ 177.& 654738219 \\ 178.& 654738291 \\ 179.& 654738921 \\ 180.& 654783219 \\ 181.& 654783291 \\ 182.& 654783921 \\ 183.& 654789321 \\ 184.& 657432189 \\ 185.& 657432819 \\ 186.& 657432891 \\ 187.& 657438219 \\ 188.& 657438291 \\ 189.& 657438921 \\ 190.& 657483219 \\ 191.& 657483291 \\ 192.& 657483921 \\ \end{array} & \begin{array}{r|r} 193.& 657489321 \\ 194.& 657843219 \\ 195.& 657843291 \\ 196.& 657843921 \\ 197.& 657849321 \\ 198.& 657894321 \\ 199.& 675432189 \\ 200.& 675432819 \\ 201.& 675432891 \\ 202.& 675438219 \\ 203.& 675438291 \\ 204.& 675438921 \\ 205.& 675483219 \\ 206.& 675483291 \\ 207.& 675483921 \\ 208.& 675489321 \\ 209.& 675843219 \\ 210.& 675843291 \\ 211.& 675843921 \\ 212.& 675849321 \\ 213.& 675894321 \\ 214.& 678543219 \\ 215.& 678543291 \\ 216.& 678543921 \\ 217.& 678549321 \\ 218.& 678594321 \\ 219.& 678954321 \\ 220.& 765432189 \\ 221.& 765432819 \\ 222.& 765432891 \\ 223.& 765438219 \\ 224.& 765438291 \\ 225.& 765438921 \\ 226.& 765483219 \\ 227.& 765483291 \\ 228.& 765483921 \\ 229.& 765489321 \\ 230.& 765843219 \\ 231.& 765843291 \\ 232.& 765843921 \\ 233.& 765849321 \\ 234.& 765894321 \\ 235.& 768543219 \\ 236.& 768543291 \\ 237.& 768543921 \\ 238.& 768549321 \\ 239.& 768594321 \\ 240.& 768954321 \\ 241.& 786543219 \\ 242.& 786543291 \\ 243.& 786543921 \\ 244.& 786549321 \\ 245.& 786594321 \\ 246.& 786954321 \\ 247.& 789654321 \\ 248.& 876543219 \\ 249.& 876543291 \\ 250.& 876543921 \\ 251.& 876549321 \\ 252.& 876594321 \\ 253.& 876954321 \\ 254.& 879654321 \\ 255.& 897654321 \\ 256.& 987654321 \\ \end{array}\\ \hline \end{array}\)

 

The answer is 256

 

laugh

Feb 20, 2018
 #7
avatar+26367 
+2

Computing...

 

1.

\(\text{Numbers}:\\ \begin{array}{rrrrrrr} 31 & 30 & 29 & 28 & 27 & 26 & \\ 32 & 13 & 12 & 11 & 10 & 25 & \\ \ldots & 14 & 3 & 2 & 9 & 24 & \\ \ldots & 15 & 4 & 1 & 8 & 23 & \\ \ldots & 16 & 5 & 6 & 7 & 22 & \\ \ldots & 17 & 18 & 19 & 20 & 21 & \\ \end{array} \)

 

2.

\(\text{Coordinates of the lattice points}:\\ \begin{array}{rrrrrrr} \text{Start at $(0, 0) = 1$ }\\\\ (-3,3) & (-2,3) & (-1,3) & (0,3) & (1,3) & (2,3) & \\ (-3,2) & (-2,2) & (-1,2) & (0,2) & (1,2) & (2,2) & \\ \ldots & (-2,1) & (-1,1) & (0,1) & (1,1) & (2,1) & \\ \ldots & (-2,0) & (-1,0) & (0,0) & (1,0) & (2,0) & \\ \ldots & (-2,-1) & (-1,-1) & (0,-1) & (1,-1) & (2,-1) & \\ \ldots & (-2,-2) & (-1,-2) & (0,-2) & (1,-2) & (2,-2) & \\ \end{array}\)

 

3.

\(\text{Algorithem to get the lattice point coordinates:} \\ \begin{array}{|r|r|} \hline \text{lattice point number} & \text{coordinate }(x,y) \\ \hline 1.& (0,0) \\ 2.& (0,1) \\ 3.& (-1,1) \\ 4.& (-1,0) \\ 5.& (-1,-1) \\ 6.& (0,-1) \\ 7.& (1,-1) \\ 8.& (1,0) \\ 9.& (1,1) \\ 10.& (1,2) \\ 11.& (0,2) \\ 12.& (-1,2) \\ 13.& (-2,2) \\ 14.& (-2,1) \\ 15.& (-2,0) \\ 16.& (-2,-1) \\ 17.& (-2,-2) \\ 18.& (-1,-2) \\ 19.& (0,-2) \\ 20.& (1,-2) \\ 21.& (2,-2) \\ 22.& (2,-1) \\ 23.& (2,0) \\ 24.& (2,1) \\ 25.& (2,2) \\ 26.& (2,3) \\ 27.& (1,3) \\ 28.& (0,3) \\ 29.& (-1,3) \\ 30.& (-2,3) \\ 31.& (-3,3) \\ 32.& (-3,2) \\ \ldots \\ 1843.& (21,15) \\ \ldots \\ 2017.& (22,14) \\ \ldots \\ 2018.& (22,15) \\ \ldots \\ 2019.& (22,16) \\ \ldots \\ 2201.& (23,15) \\ \ldots \\ \hline \end{array}\)

 

4.

short algorithm to get (x,y) the index in a grid-net of the spiral in c++:

    int n_max = 2818;
    int y_coordinate = 0;
    int x_coordinate = 0;
    for(int i = 0; i < n_max; ++i) {
        // output Number i+1
        // output x_coordinate
        // output y_coordinate
        if(abs(y_coordinate) <= abs(x_coordinate) && (y_coordinate != x_coordinate || y_coordinate >= 0))
            y_coordinate += ((x_coordinate >= 0) ? 1 : -1);
        else
            x_coordinate += ((y_coordinate >= 0) ? -1 : 1);
    }

 

Find the lattice point coordinate of 2018.

We find (22,15).

 

The four numbers directly adjacent to the number “2018” in
this spiral are (21,15), (22,14), (22,16), (23,15).

The Numbers are 1843, 2017, 2019, 2201.

 

laugh

Feb 20, 2018
 #7
avatar+101 
+1
Feb 20, 2018

4 Online Users

avatar