OFFSET
2,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (3,2,-3,1).
FORMULA
G.f.: x^2/(1-3*x-2*x^2+3*x^3-x^4).
a(n) = 3*a(n-1) + 2*a(n-2) - 3*(a-3) + a(n-4) for n > 5.
EXAMPLE
a(2) = 1;
+--+
| |
+ +
| |
+ +
| |
+--+
a(3) = 3;
+--+--+ +--+--+ +--+--+
| | | | | |
+--* + + *--+ + +
| | | | | |
+--* + + *--+ + +
| | | | | |
+--+--+ +--+--+ +--+--+
PROG
(PARI) N=40; x='x+O('x^N); Vec(x^2/(1-3*x-2*x^2+3*x^3-x^4))
(Python)
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A333758(n, k):
universe = tl.grid(n - 1, k - 1)
GraphSet.set_universe(universe)
cycles = GraphSet.cycles()
points = [i for i in range(1, k * n + 1) if i % k < 2 or ((i - 1) // k + 1) % n < 2]
for i in points:
cycles = cycles.including(i)
return cycles.len()
def A333760(n):
return A333758(4, n)
print([A333760(n) for n in range(2, 15)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Apr 04 2020
STATUS
approved