Use Google Apps Script
I recommend using Google Apps Script because it has a time-dependent installable trigger feature. You may use the following script:
function randomNumber() {
var min = 10000; //Set minimum value
var max = 99999; //Set maximum value
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var num = Math.floor(Math.random() * (max - min + 1) ) + min; // The formula
ss.getRange("B2").setValue(Math.round(num)); //Assigns the random value to B2.
}
Afterwards, you can set an installable trigger with this setup:

Please take note of the important settings for this trigger setup:
- Choose which function to run - the name of the function used
- Select event source - set to Time-driven
- Select type of time based trigger - set to Week timer
- Select day of week - set to Monday (based on your example)
- Select time of day - anytime you want the script to run(default value is Midnight to 1am)
If you do not know how to create an installable trigger, you may follow this tutorial video on YouTube: Google Apps Script Triggers Explained. You may skip to 9:42 (How to add installable triggers part).
Output
After saving/running the script and adding the installable triggers, the spreadsheet is expected to update cell B2 every Monday (Midnight to 1AM based on the current installable trigger setup).

References:
- Math.random
- Installable Triggers