OFFSET
1,1
LINKS
FORMULA
a(n) = 2*n + 9*round(sqrt(2*(n + 1))/3)^2.
G.f. 2/(1-x)^2 + 9*F(x^9)/(1-x), where F(x) = Sum_{n>=0} (2*n+1) * x^(n*(n+1)/2) is the g.f. of A198954. - Paul D. Hanna, Nov 09 2025
EXAMPLE
The spiral begins:
15
/ \
16 14
/ \
17 3 13
/ / \ \
18 4 2 12
/ / \ \
19 5 0---1 11
/ / \
20 6---7---8---9--10
/
a(1) = 11, since 1 sits at the midpoint between 0 and 11.
a(2) = 13, since 2 sits at the midpoint between 0 and 13.
a(3) = 15, since 3 sits at the midpoint between 0 and 15.
a(4) = 17, since 4 sits at the midpoint between 0 and 17.
MATHEMATICA
Table[2 n + 9 Round[Sqrt[2 (n + 1)]/3]^2, {n, 60}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zhining Yang, Sep 23 2025
STATUS
approved
