<?php

$elements = [
    5 => 7,
    4 => 5
];

# n -
for ($index = 3; $index >= -5; $index--)
{
    $elements[$index] = $elements[$index + 2] - $elements[$index + 1];
}

# n +
for ($index = 6; $index <= 100; $index++)
{
    $elements[$index] = $elements[$index - 1] - $elements[$index - 2];
}

print_r($elements);

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: