Earlier I tried uploading this sequence suggestion, but since I'm new to this and it's my first time, I'm not sure if I did it correctly. When I saved the changes, nothing appeared; it just refreshed the page.Can anyone tell me if I did this correctly?
%ID: A37XXXX (Reservado para o OEIS)
%N: Number of genuine directed cycles (length >= 3) in the semiprime transition graph G for semiprimes up to N.
%K nonn, walk, more, gpn
%O: 1,1
%A: Bruno Paiva Viana, Sep 30 2026
%F:
A integer sequence where a(n) represents the total count of unique genuine cycles (cycles with length greater than or equal to 2 nodes, excluding bidirectional mirror pairs) formed by valid modular transitions (w, x, y, z) between decomposed semiprimes N.
%D:
In number theory and graph models constructed via 2N49R1M3 transition dynamics, each node represents a decomposed semiprime N = p \cdot q. Directed edges (N_1, N_2) exist if N_2 satisfies valid modular tuple conditions derived from N_1. Mirror cycles are defined as reciprocal transitions N_1 \leftrightarrow N_2 (length 2), while genuine cycles correspond to directed paths N_1 \to N_2 \to \dots \to N_k \to N_1 with k \ge 3.
%E:
1, 0, 2, 5, 12, 29, 74
%C:
The graph G is built as a networkx.DiGraph() using valid next semiprime transitions.
The search algorithm uses Depth-First Search (DFS) to detect recursion stack intersections and classify cycles by topological length.
Mirror cycles are filtered out using bidirectional edge validation has_edge(u,v) and has_edge(v,u).
import networkx as nx
def generate_oeis_cycle_sequence(df_full_analysis, df_full_analysis_indexed):
G_multi_edge = nx.DiGraph()
for N_val in df_full_analysis['N'].unique():
if N_val in df_full_analysis_indexed.index:
next_N_candidates = get_all_valid_next_N_primes(N_val)
for next_N in next_N_candidates:
G_multi_edge.add_edge(N_val, next_N)
def find_cycles_dfs(graph):
all_cycles = []
path = []
visited = set()
recursion_stack = set()
def dfs(u):
visited.add(u)
recursion_stack.add(u)
path.append(u)
for v in graph.neighbors(u):
if v not in visited:
dfs(v)
elif v in recursion_stack:
cycle_start_index = path.index(v)
cycle = path[cycle_start_index:]
all_cycles.append(tuple(cycle))
path.pop()
recursion_stack.remove(u)
for node in graph.nodes():
if node not in visited:
dfs(node)
return all_cycles
cycles_multi_edge = find_cycles_dfs(G_multi_edge)
ciclos_espelho_multi = []
ciclos_genuinos_multi = []
for cycle in cycles_multi_edge:
if len(cycle) == 2:
n1, n2 = cycle[0], cycle[1]
if G_multi_edge.has_edge(n1, n2) and G_multi_edge.has_edge(n2, n1):
if tuple(sorted(cycle)) not in [tuple(sorted(c)) for c in ciclos_espelho_multi]:
ciclos_espelho_multi.append(cycle)
elif len(cycle) >= 3:
if tuple(cycle) not in ciclos_genuinos_multi:
ciclos_genuinos_multi.append(cycle)
return len(ciclos_genuinos_multi)