login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of symmetrical fountains of n coins.
2

%I #32 Nov 14 2020 08:37:08

%S 1,1,1,2,1,3,3,5,4,9,8,15,14,26,24,46,42,79,73,137,128,239,221,414,

%T 385,719,668,1249,1161,2167,2016,3762,3499,6531,6075,11336,10546,

%U 19676,18306,34153,31775,59279,55155,102890,95733,178587,166165,309968,288412

%N Number of symmetrical fountains of n coins.

%H Alois P. Heinz, <a href="/A288005/b288005.txt">Table of n, a(n) for n = 0..8354</a>

%e a(7) = 5:

%e .. O O O ....... O O ....... O ... O ......... O ........................

%e . O O O O ... O O O O O ... O O O O O ... O O O O O O ... O O O O O O O .

%p b:= proc(n, i, p) option remember; `if`(n<0, 0, `if`(n=0,

%p `if`(p<0 and i=1, 1, 0), `if`(n=i or n=i+p, 1, 0)+

%p `if`(i<1 and p=1, 0, b(n-2*i, i, -p))+b(n-2*(i+p), i+p, -p)))

%p end:

%p a:= n-> `if`(n=0, 1, b(n, 0, 1)):

%p seq(a(n), n=0..60); # _Alois P. Heinz_, Sep 02 2017

%t b[n_, i_, p_] := b[n, i, p] = If[n < 0, 0, If[n == 0, If[p < 0 && i == 1, 1, 0], If[n == i || n == i + p, 1, 0] + If[i < 1 && p == 1, 0, b[n - 2i, i, -p]] + b[n - 2(i + p), i + p, -p]]];

%t a[n_] := If[n == 0, 1, b[n, 0, 1]];

%t a /@ Range[0, 60] (* _Jean-François Alcover_, Nov 14 2020, after _Alois P. Heinz_ *)

%Y Cf. A005169, A288006.

%K nonn

%O 0,4

%A _Seiichi Manyama_, Sep 01 2017

%E a(33)-a(48) from _Alois P. Heinz_, Sep 02 2017