cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A169781 a(n) = A169780(2^n).

This page as a plain text file.
%I A169781 #10 May 08 2020 16:13:11
%S A169781 1,3,9,29,99,361,1373,5349,21109,83859,334275,1334769,5334413,
%T A169781 21328351,85294869
%N A169781 a(n) = A169780(2^n).
%C A169781 These are the "high water marks" in A169780.
%t A169781 initTriangle[ ] := {{1, 0, 1, 0, 1}, {1, 0, 1, 1, 0, 1}, {1, 0, 1, 0, 1, 0, 1}, {1, 0, 1, 1, 1, 1, 0, 1}, {1, 0, 1, 0, 0, 0, 1, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}};
%t A169781 nextRow[k_] := Join[{1, 0}, Table[0, k], {0, 1}]
%t A169781 neighborPosList[{i_, j_}] := {{i - 1, j - 1}, {i - 1, j}, {i, j - 1}, {i, j + 1}, {i + 1, j}, {i + 1, j + 1}}
%t A169781 neighborEmptyList[{i_, j_}] := Select[neighborPosList[{i, j}], nTriangle[[Apply[Sequence, #]]] == 0 &]
%t A169781 getCellValue[{i_, j_}] := nTriangle[[i, j]]
%t A169781 a169781[n_] := Module[{newGen = { }, lastGen = {{5, 3}, {5, 7}}, newCount = 0, totalCount = 11, k, p, emptyNs, q, emptyCs, r}, nTriangle = initTriangle[ ]; For[k = 6, k <= n, k++, AppendTo[nTriangle, nextRow[k + 1]]; For[p = 1, p <= Length[lastGen], p++, emptyNs = Select[neighborPosList[lastGen[[p]]], getCellValue[#] == 0 &]; For[q = 1, q <= Length[emptyNs], q++, emptyCs = Select[neighborPosList[emptyNs[[q]]], getCellValue[#] == 1 &]; If[Length[emptyCs] == 1, AppendTo[newGen, emptyNs[[q]]]]]]; For[r = 1, r <= Length[newGen], r++, nTriangle[[Apply[Sequence, newGen[[r]]]]] = 1]; lastGen = newGen; totalCount += Length[newGen]; newGen = { }]; totalCount]/;(n>=2^3 && IntegerQ[Log[2, n]])
%t A169781 a169781[2^11] (* sample invocation for a(11) - _Hartmut F. W. Hoft_, Apr 17 2020 *)
%Y A169781 Cf. A169780, A169785.
%K A169781 nonn,more
%O A169781 0,2
%A A169781 _N. J. A. Sloane_, May 11 2010
%E A169781 a(11)-a(14) from _Hartmut F. W. Hoft_, Apr 17 2020