A361374 Make a square spiral starting with a(1)=1, a(2)=2. Then, each position gets the smallest unused number which is the sum of a path of numbers starting from that position.
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, 74
Offset: 1
Keywords
Examples
For a(42), the first candidate to check is 42, as it is the least unused positive integer. 20-22 is a valid path which ends at a(42) and whose sum is 42, so a(42) = 42. (path shown below) . 37 36 35 34 33 32 31 . 38 17 16 15 14 13 30 . 39 18 5 4 3 12 29 . 40 19 6 1 2 11 28 . 41 20 7 8 9 10 27 . / \ start 21 22 23 24 25 26 . For a(73), the first candidate to check is 73, as it is the least unused positive integer. No paths starting at a(73) equal 73, so check the next candidate, 74. 43-21-7-1-2 is a valid path starting at a(73) and whose sum is 74, so a(73) = 74. (path shown below) . 65 64 63 62 61 60 59 58 57 . 66 37 36 35 34 33 32 31 56 . 67 38 17 16 15 14 13 30 55 . 68 39 18 5 4 3 12 29 54 . 69 40 19 6 1----2 11 28 53 . / 70 41 20 7 8 9 10 27 52 . / 71 42 21 22 23 24 25 26 51 . / 72 43 44 45 46 47 48 49 50 / start . The first 144 terms: . 164-162-159-155-153-152-151-149-148-147-146-158 | 102-100--99--96--94--93--92--91--90--89-101 154 | | | 103 65--64--63--62--61--60--59--58--57 98 150 | | | | | 104 66 37--36--35--34--33--32--31 56 95 141 | | | | | | | 105 67 38 17--16--15--14--13 30 55 85 140 | | | | | | | | | 106 68 39 18 5---4---3 12 29 54 84 139 | | | | | | | | | | | 107 69 40 19 6 1---2 11 28 53 82 135 | | | | | | | | | | 108 70 41 20 7---8---9--10 27 52 81 134 | | | | | | | | 110 71 42 21--22--23--24--25--26 51 88 133 | | | | | | 112 72 43--44--45--46--47--48--49--50 87 138 | | | | 114 74--73--75--76--77--78--79--80--83--86 137 | | 117-116-118-119-120-121-122-124-126-128-132-136 . Note that 97 does not (and will not) occur. A path must start with one of the outer-most cells, all of which are greater than 97, and nothing below their minimum can ever be reached again.
Links
- Samuel Harkness, Table of n, a(n) for n = 1..10000
- Samuel Harkness, MATLAB program
Programs
-
MATLAB
See Links section.
Comments