OFFSET
1,3
LINKS
Ed Wynn, Table of n, a(n) for n = 1..17
Eric Weisstein's World of Mathematics, Graph Cycle
Eric Weisstein's World of Mathematics, Triangular Grid Graph
EXAMPLE
Of the 11 cycles in the triangular grid with 3 vertices per side, 4 have length 3, 3 have length 4, 3 have length 5 and 1 has length 6.
4 basic cycle shapes on a(3):
o
/ \
o o---o o---o o o
/ \ / / / \ / \
o---o o---o o---o---o o---o---o
PROG
(Python)
# Using graphillion
from graphillion import GraphSet
def make_n_triangular_grid_graph(n):
s = 1
grids = []
for i in range(n + 1, 1, -1):
for j in range(i - 1):
a, b, c = s + j, s + j + 1, s + i + j
grids.extend([(a, b), (a, c), (b, c)])
s += i
return grids
def A266513(n):
if n == 1: return 0
universe = make_n_triangular_grid_graph(n - 1)
GraphSet.set_universe(universe)
cycles = GraphSet.cycles()
return cycles.len()
print([A266513(n) for n in range(1, 12)]) # Seiichi Manyama, Nov 30 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Howroyd, Apr 06 2016
STATUS
approved