OFFSET
1,2
EXAMPLE
The square spiral starts:
.
38--36--34--35--33--30--32
| |
39 16--18--15--13--14 31
| | | |
37 19 2---7---5 10 29
| | | | | |
40 17 8 1---3 12 27
| | | | |
41 21 4--11---9---6 28
| | |
43 23--22--24--25--20--26
|
42--45--46--44--47--48--50..
.
a(2) = 3 as a(1) + 3 = 1 + 3 = 4, the smallest possible composite number.
a(3) = 5 as a(2) + 5 = 3 + 5 = 8. Note a(3) cannot be 2 or 4 as when these are added to 3 the result is a prime number.
a(4) = 7 as a(3) + 7 = 5 + 7 = 12, and a(1) + 7 = 1 + 7 = 8, both being composite.
a(9) = 9 as a(8) + 9 = 11 + 9 = 20, and a(2) + 9 = 3 + 9 = 12, both being composite.
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini and Scott R. Shannon, Apr 21 2021
STATUS
approved