You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @brief Receives initial term via argv[1] and iterates until desired term argv[2], mathematically optimized.
* @author Pedro Henrique Pinto de Oliveira
* @date 2024-05-18
*/
/* Inclusions */
#include "headers/errors.h"
#include <iostream>
#include <string>
using namespace std;
/* Constants */
/* Types */
/* Functions */
void squareDigitSum(int init, int target)
{
for(int i = init; i < target; i++)
{
int squares_sum = 0;
int temp = target;
while(temp > 0)
{
int digit = temp % 10;
squares_sum += digit * digit;
temp /= 10;
}
// Implement a stack buffer which, if (i-init) % 8 == 0, will check if the last element belongs in the sequence, given that this sequence is continuous.