
    In a smart healthcare facility's fall prevention system, determine the total number of movement detection zones needed for the nth monitoring interval, where zones are arranged in an octagonal pattern around the patient's living space. The zones expand outward in octagonal layers, with each new layer adding 8 more zones than the previous layer, starting from a single central zone.
    

    
def is_octagonal(n):
    """
    In a smart healthcare facility's fall prevention system, determine the total number of movement detection zones needed for the nth monitoring interval, where zones are arranged in an octagonal pattern around the patient's living space. The zones expand outward in octagonal layers, with each new layer adding 8 more zones than the previous layer, starting from a single central zone.
    

    """
def is_octagonal(n):
    """
    In a smart healthcare facility's fall prevention system, determine the total number of movement detection zones needed for the nth monitoring interval, where zones are arranged in an octagonal pattern around the patient's living space. The zones expand outward in octagonal layers, with each new layer adding 8 more zones than the previous layer, starting from a single central zone.
    

    """
    return 3 * n * n - 2 * n