
    Develop an algorithm to calculate the nth number in a specialized hospital capacity sequence, where each number helps determine optimal bed allocation patterns across units. This sequence follows the Newman-Shanks-Williams prime pattern, which has been found to correlate with cyclical admission trends, and the hospital needs this calculation to optimize their predictive bed management system.
    

    
def newman_prime(n):
    """
    Develop an algorithm to calculate the nth number in a specialized hospital capacity sequence, where each number helps determine optimal bed allocation patterns across units. This sequence follows the Newman-Shanks-Williams prime pattern, which has been found to correlate with cyclical admission trends, and the hospital needs this calculation to optimize their predictive bed management system.
    

    """
def newman_prime(n):
    """
    Develop an algorithm to calculate the nth number in a specialized hospital capacity sequence, where each number helps determine optimal bed allocation patterns across units. This sequence follows the Newman-Shanks-Williams prime pattern, which has been found to correlate with cyclical admission trends, and the hospital needs this calculation to optimize their predictive bed management system.
    

    """
    if n == 0 or n == 1:
        return 1
    return 2 * newman_prime(n - 1) + newman_prime(n - 2)