Split first N natural numbers into two subsequences with non | C ++ program for the above approach ; Function to split 1 to N into two subsequences with non - coprime sums ; Driver Code
#include <iostream> NEW_LINE using namespace std ; void printSubsequence ( int N ) { cout << " { ▁ " ; for ( int i = 1 ; i < N - 1 ; i ++ ) { cout << i << " , ▁ " ; } cout << N - 1 << " ▁ } STRNEWLINE " ; cout << " { ▁ " << N << " ▁ } " ; } int main ( ) { int N = 8 ; printSubsequence ( N ) ; return 0 ; }