OFFSET
0,3
COMMENTS
To evaluate a(n) consider the neighbors of a(n) that are present in the spiral when a(n) should be a new term in the spiral.
LINKS
JungHwan Min, Table of n, a(n) for n = 0..10000
EXAMPLE
Illustration of initial terms as a spiral:
.
. 22 - 19 - 14
. / \
. 29 3 - 2 12
. / / \ \
. 33 4 1 - 1 9
. \ \ /
. 42 5 - 7 - 8
. \
. 47 - 59 - 74
.
a(16) = 47 because the sum of its two neighbors is 42 + 5 = 47.
a(17) = 59 because the sum of its three neighbors is 47 + 5 + 7 = 59.
a(18) = 74 because the sum of its three neighbors is 59 + 7 + 8 = 74.
a(19) = 82 because the sum of its two neighbors is 74 + 8 = 82.
MATHEMATICA
A278181[0] = A278181[1] = 1; A278181[n_] := A278181[n] = With[{lev = Ceiling[1/6 (-3 + Sqrt[3] Sqrt[3 + 4 n])]}, With[{pos = 3 lev (lev - 1) + (n - 3 lev (1 + lev))/lev*(lev - 1)}, A278181[n - 1] + A278181[Ceiling[pos]] + If[Mod[n, lev] == 0 || n - 3 lev (lev - 1) == 1, 0, A278181[Floor[pos]]] + If[3 lev (1 + lev) == n, A278181[n - 6 lev + 1], 0]]]; Array[A278181, 61, 0] (* JungHwan Min, Nov 21 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Nov 14 2016
STATUS
approved