OFFSET
1,2
COMMENTS
A polynomial curve. However, write 0, 1, 2, ... in a square spiral, with 0 at the origin and 1 immediately below it; sequence gives numbers parallel to the negative y-axis (see Example section). This sequence only encounters composite numbers as it expands to infinity.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
G.f.: x^2*(9-x)/(1-x)^3. - R. J. Mathar, Sep 15 2021, edited by M. F. Hasler, Apr 14 2026
Sum_{n>=2} 1/a(n) = 24/25 -3*log(2)/5 -Pi/10. - R. J. Mathar, May 30 2022
From Elmo R. Oliveira, Apr 14 2026: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
E.g.f.: 1 + exp(x)*(4*x^2 + x - 1). (End)
Sum_{n>=2} (-1)^n/a(n) = (32 - 5*sqrt(2)*Pi + 10*log(2) - 10*sqrt(2)*log(1+sqrt(2)))/50. - Amiram Eldar, Apr 22 2026
EXAMPLE
On a square lattice, place the nonnegative integers at lattice points forming a spiral as follows: place "0" at the origin; then move one step downward (i.e., in the negative y direction) and place "1" at the lattice point reached; then turn 90 degrees in either direction and place a "2" at the next lattice point; then make another 90-degree turn in the same direction and place a "3" at the lattice point; etc. The terms of the sequence, not including "0", will lie parallel to the negative y-axis, located within the fourth quadrant, as seen in the example below:
99 64--65--66--67--68--69--70--71--72
| | |
98 63 36--37--38--39--40--41--42 73
| | | | |
97 62 35 16--17--18--19--20 43 74
| | | | | | |
96 61 34 15 4---5---6 21 44 75
| | | | | | | | |
95 60 33 14 3 *0* 7 22 45 76
| | | | | | | | | |
94 59 32 13 2---1 8 23 46 77
| | | | | | | |
93 58 31 12--11--10--*9* 24 47 78
| | | | | |
92 57 30--29--28--27-*26*-25 48 79
| | | |
91 56--55--54--53--52-*51*-50--49 80
| |
90--89--88--87--86--85-*84*-83--82--81
MATHEMATICA
LinearRecurrence[{3, -3, 1}, {0, 9, 26}, 100] (* Paolo Xausa, Aug 27 2025 *)
PROG
(C) int a(int n) { return 4*n*n-3*n-1; }
(PARI) apply( {A343560(n)=(n-1)*(4*n+1)}, [1..55]) \\ M. F. Hasler, Apr 14 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zachary Dove, Apr 19 2021
STATUS
approved
