%I #9 Dec 18 2021 15:01:00
%S 0,1,1,1,1,1,6,7,7,7,7,7,6,7,7,7,7,7,6,7,7,7,7,7,6,7,7,7,7,7,6,7,7,7,
%T 7,7,18,19,19,19,19,19,18,19,19,19,19,19,18,19,19,19,19,19,18,19,19,
%U 19,19,19,18,19,19,19,19,19,18,19,19,19,19,19,24,25
%N For any n >= 0, consider a sandpile model on the infinite hexagonal lattice starting with n grains at the origin, the other sites being empty; a(n) gives the number of nonempty sites after stabilization of this sandpile model.
%C A site is unstable when it holds 6 or more grains.
%C As long as there is an unstable site:
%C  choose such an unstable site,
%C  remove 6 grains from this site and add 1 grain to each of its six neighbors.
%C This procedure is guaranteed to result in a stable configuration, which does not depend on the order in which we treat the unstable sites.
%H Rémy Sigrist, <a href="/A349991/a349991.png">Colored representation of the stabilized configuration for n = 1000000</a> (white, green, purple, gold, blue and red pixels correspond to sites with 0, 1, 2, 3, 4 and 5 grains, respectively)
%H Rémy Sigrist, <a href="/A349991/a349991.txt">C++ program for A349991</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Abelian_sandpile_model#Sandpile_models_on_infinite_grids">Sandpile models on infinite grids</a>
%F a(6*n) + 1 = a(6*n + k) for k = 1..5.
%e For n = 54:
%e  after stabilization, we have the following configuration:
%e 2
%e 4 4
%e 2 3 2
%e 3 3
%e 4 4
%e 3 3
%e 2 3 2
%e 4 4
%e 2
%e  we have 18 nonnempty sites,
%e  so a(54) = 18.
%o (C++) See Links section.
%Y Cf. A349990.
%K nonn
%O 0,7
%A _Rémy Sigrist_, Dec 08 2021
