#include <iostream>
#include <cmath>
#include <limits>

int findK(int k)
{
        double x = 0;
        for(double i=2;i<k;i++)
        {
                x = (1/pow(i, 2)+3);
                if(std::fmod(x, 1.0) <= std::numeric_limits<double>::epsilon())
                {
                        std::cout << "Sequence terminated at, " << i << "th term.\n";               
                        exit(0);
                }
                else
                {
                        std::cout << x << "; " << std::fmod(x, 1.0) << ", ";
                }
                if(i != k-1) std::cout << ", ";
        }
        std::cout << std::endl;
}

int main()
{
        int n = 453;
        findK(n);

        return 0;
}