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.

A292793 1/4 of the number of self-avoiding paths that are made of alternated vertical and horizontal n consecutive steps. (start point is different from end point.)

This page as a plain text file.
%I A292793 #28 Sep 14 2019 17:48:23
%S A292793 1,2,4,8,16,29,54,98,176,318,572,1026,1826,3255,5794,10233,18172,
%T A292793 32012,56488,99469,175034,307479,540068,947235,1659907,2908958,
%U A292793 5095019,8917677,15598100,27281252,47718310,83298748,145405769,253641303,442352671,770769569,1343166519,2339093953
%N A292793 1/4 of the number of self-avoiding paths that are made of alternated vertical and horizontal n consecutive steps. (start point is different from end point.)
%e A292793 a(2) = 1;
%e A292793    E
%e A292793    |
%e A292793    *
%e A292793    |
%e A292793 S--*
%e A292793 a(3) = 2;
%e A292793    *--*--*--E     E--*--*--*
%e A292793    |                       |
%e A292793    *                       *
%e A292793    |                       |
%e A292793 S--*                    S--*
%e A292793 a(4) = 4;
%e A292793             E                                      E
%e A292793             |                                      |
%e A292793             *                                      *
%e A292793             |                                      |
%e A292793             *                                      *
%e A292793             |                                      |
%e A292793             *                                      *
%e A292793             |                                      |
%e A292793    *--*--*--*        *--*--*--*     *--*--*--*     *--*--*--*
%e A292793    |                 |        |     |        |              |
%e A292793    *                 *        *     *        *              *
%e A292793    |                 |        |     |        |              |
%e A292793 S--*              S--*        *     *     S--*           S--*
%e A292793                               |     |
%e A292793                               E     E
%o A292793 (Ruby)
%o A292793 def A292793(n)
%o A292793   ary = [1]
%o A292793   b_ary = [[[0, 0], [1, 0], [1, 1], [1, 2]]]
%o A292793   s = 4
%o A292793   (3..n).each{|i|
%o A292793     s += i
%o A292793     f_ary, b_ary = b_ary, []
%o A292793     if i % 2 == 1
%o A292793       f_ary.each{|a|
%o A292793         b = a.clone
%o A292793         x, y = *b[-1]
%o A292793         b += (1..i).map{|j| [x + j, y]}
%o A292793         b_ary << b if b.uniq.size == s
%o A292793         c = a.clone
%o A292793         x, y = *c[-1]
%o A292793         c += (1..i).map{|j| [x - j, y]}
%o A292793         b_ary << c if c.uniq.size == s
%o A292793       }
%o A292793     else
%o A292793       f_ary.each{|a|
%o A292793         b = a.clone
%o A292793         x, y = *b[-1]
%o A292793         b += (1..i).map{|j| [x, y + j]}
%o A292793         b_ary << b if b.uniq.size == s
%o A292793         c = a.clone
%o A292793         x, y = *c[-1]
%o A292793         c += (1..i).map{|j| [x, y - j]}
%o A292793         b_ary << c if c.uniq.size == s
%o A292793       }
%o A292793     end
%o A292793     ary << b_ary.size
%o A292793   }
%o A292793   ary
%o A292793 end
%o A292793 p A292793(16)
%Y A292793 Cf. A101856.
%K A292793 nonn
%O A292793 2,2
%A A292793 _Seiichi Manyama_, Sep 23 2017
%E A292793 a(25)-a(39) from _Bert Dobbelaere_, Sep 14 2019