#Python or SageMath solved_states = dict() def steps(path, position, repeats, legal_steps, endpoint): possibs = 0 for choice in legal_steps: next = position + choice if (0 <= next <= endpoint) and not (path[-1] & 1< 0: return paths_from((path[0]>>1, path[1]>>1), position-1, repeats, legal_steps, endpoint-1) if not (path, position, endpoint) in solved_states: calc_paths(endpoint, legal_steps, path, position, possible_steps, repeats) return solved_states[(path, position, endpoint)] def bitf(repeats, step_size, endpoint): legal_steps = tuple([i for i in range(-step_size, step_size+1) if i != 0]) return paths_from((1, 0), 0, repeats, legal_steps, endpoint) def A375092(n): return(bitf(2, 2, n))