login
A385697
Number of unlabeled simple graphs on n vertices with no induced subgraphs isomorphic to a P5 or complement of a P5, where P5 = path on 5 vertices.
3
1, 2, 4, 11, 32, 120, 498, 2425, 13107, 79002, 526502, 3918731, 33238798, 334851298, 4273597722
OFFSET
1,2
COMMENTS
These numbers include both connected and disconnected graphs.
PROG
(SageMath)
def has_induced_P5(g):
n = g.order()
if n < 5:
return False
from itertools import combinations
for vertices in combinations(range(n), 5):
subgraph = g.subgraph(vertices)
if subgraph.is_isomorphic(graphs.PathGraph(5)):
return True
return False
for n in range(3, 11):
count = 0
max_edges = n * (n - 1) // 2
for g in graphs.nauty_geng(f"{n}"):
edge_count = g.size()
if edge_count < max_edges / 2:
if not has_induced_P5(g) and not has_induced_P5(g.complement()):
count += 2
elif edge_count == max_edges / 2:
if not has_induced_P5(g) and not has_induced_P5(g.complement()):
count += 1
print(f"n = {n}: {count} graphs with no P5 in G or co-G")
CROSSREFS
Cf. A000088.
Euler transform of A079564.
Sequence in context: A056325 A345207 A103293 * A123418 A123412 A074408
KEYWORD
nonn,more
AUTHOR
Jim Nastos, Jul 07 2025
EXTENSIONS
a(9)-a(15) from Sean A. Irvine, Jul 22 2025
STATUS
approved