dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static bool isTidy ( int num ) { int prev = 10 ; while ( num != 0 ) { int rem = num % 10 ; num /= 10 ; if ( rem > prev ) return false ; prev = rem ; } return true ; } public static void Main ( ) { int num = 1556 ; Console . WriteLine ( isTidy ( num ) ? " Yes " : " No " ) ; } }

Accumulator variables: num
Class/struct names: GFG
C# program:
using System ; class GFG { public static int squareFree ( int n ) { int cnt = 0 ; for ( int i = 1 ; ; i ++ ) { bool isSqFree = true ; for ( int j = 2 ; j * j <= i ; j ++ ) { if ( i % ( j * j ) == 0 ) { isSqFree = false ; break ; } } if ( isSqFree == true ) { cnt ++ ; if ( cnt == n ) return i ; } } } public static void Main ( ) { int n = 10 ; Console . Write ( " " + squareFree ( n ) ) ; } }

Accumulator variables: cnt, i, j
Iterator variables: i, j
Boolean variables: isSqFree
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int MAX_PRIME = 100000 ; static int MAX_RES = 2000000000 ; static void SieveOfEratosthenes ( List < long > a ) { bool [ ] prime = new bool [ MAX_PRIME + 1 ] ; for ( int i = 0 ; i < MAX_PRIME + 1 ; i ++ ) prime [ i ] = true ; for ( int p = 2 ; p * p <= MAX_PRIME ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= MAX_PRIME ; i += p ) prime [ i ] = false ; } } for ( int p = 2 ; p <= MAX_PRIME ; p ++ ) if ( prime [ p ] ) a . Add ( ( long ) p ) ; } static long countSquares ( long i , long cur , long k , List < long > a ) { long square = a [ ( int ) i ] * a [ ( int ) ( i ) ] ; long newCur = square * cur ; if ( newCur > k ) return 0 ; long cnt = k / ( newCur ) ; cnt += countSquares ( i + 1 , cur , k , a ) ; cnt -= countSquares ( i + 1 , newCur , k , a ) ; return cnt ; } static long squareFree ( long n ) { List < long > a = new List < long > ( ) ; SieveOfEratosthenes ( a ) ; long low = 1 ; long high = MAX_RES ; while ( low < high ) { long mid = low + ( high - low ) / 2 ; long c = mid - countSquares ( 0 , 1 , mid , a ) ; if ( c < n ) low = mid + 1 ; else high = mid ; } return low ; } public static void Main ( ) { int n = 10 ; Console . WriteLine ( squareFree ( n ) ) ; } }

Index/key variables: i, p
Accumulator variables: cnt, i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static void kFactors ( int n , int k ) { ArrayList P = new ArrayList ( ) ; while ( n % 2 == 0 ) { P . Add ( 2 ) ; n /= 2 ; } for ( int i = 3 ; i * i <= n ; i = i + 2 ) { while ( n % i == 0 ) { n = n / i ; P . Add ( i ) ; } } if ( n > 2 ) P . Add ( n ) ; if ( P . Count < k ) { Console . WriteLine ( " - 1" ) ; return ; } for ( int i = 0 ; i < k - 1 ; i ++ ) Console . Write ( P [ i ] + " , ▁ " ) ; int product = 1 ; for ( int i = k - 1 ; i < P . Count ; i ++ ) product = product * ( int ) P [ i ] ; Console . WriteLine ( product ) ; } static void Main ( ) { int n = 54 , k = 3 ; kFactors ( n , k ) ; } }

Index/key variables: i
Accumulator variables: i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int nondecdigits ( int n ) { int x = 0 ; for ( x = n ; x >= 1 ; x -- ) { int no = x ; int prev_dig = 11 ; bool flag = true ; while ( no != 0 ) { if ( prev_dig < no % 10 ) { flag = false ; break ; } prev_dig = no % 10 ; no /= 10 ; } if ( flag == true ) break ; } return x ; } static public void Main ( ) { int n = 200 ; Console . WriteLine ( nondecdigits ( n ) ) ; } }

Accumulator variables: no, x
Iterator variables: x
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; class GFG { static void nondecdigits ( string s ) { int m = s . Length ; int [ ] a = new int [ m + 1 ] ; for ( int i = 0 ; i < m ; i ++ ) a [ i ] = ( int ) s [ i ] - ( int ) '0' ; int level = m - 1 ; for ( int i = m - 1 ; i > 0 ; i -- ) { if ( a [ i ] < a [ i - 1 ] ) { a [ i - 1 ] -- ; level = i - 1 ; } } if ( a [ 0 ] != 0 ) { for ( int i = 0 ; i <= level ; i ++ ) Console . Write ( a [ i ] ) ; for ( int i = level + 1 ; i < m ; i ++ ) Console . Write ( "9" ) ; } else { for ( int i = 1 ; i < level ; i ++ ) Console . Write ( a [ i ] ) ; for ( int i = level + 1 ; i < m ; i ++ ) Console . Write ( "9" ) ; } } static void Main ( ) { string n = "200" ; nondecdigits ( n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countDivisors ( int n ) { int cnt = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( n / i == i ) cnt ++ ; else cnt = cnt + 2 ; } } return cnt ; } public static void Main ( ) { Console . WriteLine ( " Total ▁ distinct " + " ▁ divisors ▁ of ▁ 100 ▁ are ▁ : ▁ " + countDivisors ( 100 ) ) ; } }

Accumulator variables: cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool hasEvenNumberOfFactors ( int n ) { double root_n = Math . Sqrt ( n ) ; if ( ( root_n * root_n ) == n ) return false ; return true ; } static void printStatusOfDoors ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) { if ( hasEvenNumberOfFactors ( i ) ) Console . Write ( " closed " + " ▁ " ) ; else Console . Write ( " open " + " ▁ " ) ; } } static public void Main ( ) { int n = 5 ; printStatusOfDoors ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool validate ( long n ) { for ( int i = 0 ; i < 10 ; i ++ ) { long temp = n ; int count = 0 ; while ( temp > 0 ) { if ( temp % 10 == i ) count ++ ; if ( count > i ) return false ; temp /= 10 ; } } return true ; } static public void Main ( String [ ] args ) { long n = 1552793 ; if ( validate ( n ) ) Console . WriteLine ( " True " ) ; else Console . WriteLine ( " False " ) ; } }

Accumulator variables: count, i, temp
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool divisibleBy36 ( String num ) { int l = num . Length ; if ( l == 0 ) return false ; if ( l == 1 && num [ 0 ] != '0' ) return false ; int two_digit_num = ( num [ l - 2 ] - '0' ) * 10 + ( num [ l - 1 ] - '0' ) ; if ( two_digit_num % 4 != 0 ) return false ; int sum = 0 ; for ( int i = 0 ; i < l ; i ++ ) sum += ( num [ i ] - '0' ) ; if ( sum % 9 != 0 ) return false ; return true ; } public static void Main ( ) { String num = "92567812197966231384" ; if ( divisibleBy36 ( num ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class IsDivisible { static bool check ( String str ) { int n = str . Length ; if ( n == 0 ) return false ; if ( n == 1 ) return ( ( str [ 0 ] - '0' ) % 8 == 0 ) ; if ( n == 2 ) return ( ( ( str [ n - 2 ] - '0' ) * 10 + ( str [ n - 1 ] - '0' ) ) % 8 == 0 ) ; int last = str [ n - 1 ] - '0' ; int second_last = str [ n - 2 ] - '0' ; int third_last = str [ n - 3 ] - '0' ; return ( ( third_last * 100 + second_last * 10 + last ) % 8 == 0 ) ; } public static void Main ( ) { String str = "76952" ; if ( check ( str ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: IsDivisible
C# program:
using System ; class GFG { static int countDigits ( int n ) { int count = 0 ; while ( n > 0 ) { count ++ ; n = n / 10 ; } return count ; } static int checkPrime ( int n ) { if ( n <= 1 ) return - 1 ; if ( n <= 3 ) return 0 ; if ( n % 2 == 0 n % 3 == 0 ) return - 1 ; for ( int i = 5 ; i * i <= n ; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return - 1 ; return 0 ; } static void printPrimePoints ( int n ) { int count = countDigits ( n ) ; if ( count == 1 count == 2 ) { Console . Write ( " - 1" ) ; return ; } bool found = false ; for ( int i = 1 ; i < ( count - 1 ) ; i ++ ) { int left = n / ( ( int ) Math . Pow ( 10 , count - i ) ) ; int right = n % ( ( int ) Math . Pow ( 10 , count - i - 1 ) ) ; if ( checkPrime ( left ) == 0 && checkPrime ( right ) == 0 ) { Console . Write ( i + " ▁ " ) ; found = true ; } } if ( found == false ) Console . Write ( " - 1" ) ; } static public void Main ( ) { int n = 2317 ; printPrimePoints ( n ) ; } }

Accumulator variables: count, i
Iterator variables: i
Boolean variables: found
Class/struct names: GFG
C# program:
using System ; class GFG { static int power ( int num , int n ) { if ( n == 0 ) return 1 ; else if ( n % 2 == 0 ) return power ( num , n / 2 ) * power ( num , n / 2 ) ; else return num * power ( num , n / 2 ) * power ( num , n / 2 ) ; } static int checkRecursive ( int x , int n , int curr_num , int curr_sum ) { int results = 0 ; int p = power ( curr_num , n ) ; while ( p + curr_sum < x ) { results += checkRecursive ( x , n , curr_num + 1 , p + curr_sum ) ; curr_num ++ ; p = power ( curr_num , n ) ; } if ( p + curr_sum == x ) results ++ ; return results ; } public static void Main ( ) { int x = 10 , n = 2 ; System . Console . WriteLine ( checkRecursive ( x , n , 1 , 0 ) ) ; } }

Accumulator variables: curr_num, results
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static void printGenerators ( int n ) { Console . Write ( "1 ▁ " ) ; for ( int i = 2 ; i < n ; i ++ ) if ( gcd ( i , n ) == 1 ) Console . Write ( i + " ▁ " ) ; } public static void Main ( String [ ] args ) { int n = 10 ; printGenerators ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool check ( string str ) { int n = str . Length ; int digitSum = 0 ; for ( int i = 0 ; i < n ; i ++ ) digitSum += ( str [ i ] - '0' ) ; return ( digitSum % 3 == 0 ) ; } public static void Main ( ) { string str = "1332" ; if ( check ( str ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Accumulator variables: digitSum, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 100001 ; static int [ ] perfectDiv = new int [ MAX ] ; static void precomputeCounts ( ) { for ( int i = 1 ; i * i < MAX ; ++ i ) { for ( int j = i * i ; j < MAX ; j += i * i ) ++ perfectDiv [ j ] ; } } static int countPerfectDivisors ( int n ) { return perfectDiv [ n ] ; } public static void Main ( ) { precomputeCounts ( ) ; int n = 16 ; Console . WriteLine ( " Total ▁ perfect ▁ divisors ▁ of ▁ " + n + " ▁ = ▁ " + countPerfectDivisors ( n ) ) ; n = 12 ; Console . WriteLine ( " Total ▁ perfect ▁ divisors ▁ of ▁ " + n + " ▁ = ▁ " + countPerfectDivisors ( n ) ) ; } }

Index/key variables: MAX, j, n
Accumulator variables: j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static int MAXN = 100001 ; static int [ ] spf = new int [ MAXN ] ; static void sieve ( ) { spf [ 1 ] = 1 ; for ( int i = 2 ; i < MAXN ; i ++ ) spf [ i ] = i ; for ( int i = 4 ; i < MAXN ; i += 2 ) spf [ i ] = 2 ; for ( int i = 3 ; i * i < MAXN ; i ++ ) { if ( spf [ i ] == i ) { for ( int j = i * i ; j < MAXN ; j += i ) if ( spf [ j ] == j ) spf [ j ] = i ; } } } static ArrayList getFactorization ( int x ) { ArrayList ret = new ArrayList ( ) ; while ( x != 1 ) { ret . Add ( spf [ x ] ) ; x = x / spf [ x ] ; } return ret ; } public static void Main ( ) { sieve ( ) ; int x = 12246 ; Console . Write ( " prime ▁ factorization ▁ for ▁ " + x + " ▁ : ▁ " ) ; ArrayList p = getFactorization ( x ) ; for ( int i = 0 ; i < p . Count ; i ++ ) Console . Write ( p [ i ] + " ▁ " ) ; Console . WriteLine ( " " ) ; } }

Index/key variables: MAXN, i, j, x
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { static int MAX = 100001 ; static int INF = Int32 . MaxValue ; static int [ ] primedivisor = new int [ MAX ] ; static int [ ] dist = new int [ MAX ] ; static int [ ] pos = new int [ MAX ] ; static int [ ] divInd = new int [ MAX ] ; static List < List < int > > divisors = new List < List < int > > ( ) ; static void sieveOfEratosthenes ( ) { for ( int i = 2 ; i * i < MAX ; ++ i ) { if ( primedivisor [ i ] == 0 ) { for ( int j = i * i ; j < MAX ; j += i ) { primedivisor [ j ] = i ; } } } for ( int i = 1 ; i < MAX ; ++ i ) { if ( primedivisor [ i ] == 0 ) { primedivisor [ i ] = i ; } } } static void findDivisors ( int [ ] arr , int n ) { for ( int i = 0 ; i < MAX ; ++ i ) { pos [ i ] = divInd [ i ] = - 1 ; dist [ i ] = INF ; } for ( int i = 0 ; i < n ; ++ i ) { int num = arr [ i ] ; while ( num > 1 ) { int div = primedivisor [ num ] ; divisors [ i ] . Add ( div ) ; while ( num % div == 0 ) { num /= div ; } } } } static void nearestGCD ( int [ ] arr , int n ) { findDivisors ( arr , n ) ; for ( int i = 0 ; i < n ; ++ i ) { foreach ( int div in divisors [ i ] ) { if ( divInd [ div ] == - 1 ) { divInd [ div ] = i ; } else { int ind = divInd [ div ] ; divInd [ div ] = i ; if ( dist [ i ] > Math . Abs ( ind - i ) ) { dist [ i ] = Math . Abs ( ind - i ) ; pos [ i ] = ind + 1 ; } if ( dist [ ind ] > Math . Abs ( ind - i ) ) { dist [ ind ] = Math . Abs ( ind - i ) ; pos [ ind ] = i + 1 ; } } } } } static public void Main ( ) { for ( int i = 0 ; i < MAX ; i ++ ) { divisors . Add ( new List < int > ( ) ) ; } sieveOfEratosthenes ( ) ; int [ ] arr = { 2 , 9 , 4 , 3 , 13 } ; int n = arr . Length ; nearestGCD ( arr , n ) ; for ( int i = 0 ; i < n ; ++ i ) { Console . Write ( pos [ i ] + " ▁ " ) ; } } }

Index/key variables: MAX, div, i, ind, j, num
Accumulator variables: i, j, num
Iterator variables: div, i, j
Class/struct names: GFG
C# program:
using System ; using System . Linq ; public class GFG { static int largestGCDSubsequence ( int [ ] arr , int n ) { int ans = 0 ; int maxele = arr . Max ( ) ; for ( int i = 2 ; i <= maxele ; ++ i ) { int count = 0 ; for ( int j = 0 ; j < n ; ++ j ) { if ( arr [ j ] % i == 0 ) ++ count ; } ans = Math . Max ( ans , count ) ; } return ans ; } public static void Main ( ) { int [ ] arr = { 3 , 6 , 2 , 5 , 4 } ; int size = arr . Length ; Console . Write ( largestGCDSubsequence ( arr , size ) ) ; } }

Index/key variables: j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { class data { public int val ; public int steps ; public data ( int val , int steps ) { this . val = val ; this . steps = steps ; } } ; static int minStepToReachOne ( int N ) { Queue < data > q = new Queue < data > ( ) ; q . Enqueue ( new data ( N , 0 ) ) ; HashSet < int > st = new HashSet < int > ( ) ; while ( q . Count != 0 ) { data t = q . Peek ( ) ; q . Dequeue ( ) ; if ( t . val == 1 ) return t . steps ; if ( ! st . Contains ( t . val - 1 ) ) { q . Enqueue ( new data ( t . val - 1 , t . steps + 1 ) ) ; st . Add ( t . val - 1 ) ; } for ( int i = 2 ; i * i <= t . val ; i ++ ) { if ( t . val % i == 0 && ! st . Contains ( t . val / i ) ) { q . Enqueue ( new data ( t . val / i , t . steps + 1 ) ) ; st . Add ( t . val / i ) ; } } } return - 1 ; } public static void Main ( String [ ] args ) { int N = 17 ; Console . Write ( minStepToReachOne ( N ) + " STRNEWLINE " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, data
C# program:
using System ; class GFG { static int MAX = 1000006 ; static void sieve ( int [ ] count ) { for ( int i = 2 ; i * i <= MAX ; i ++ ) { if ( count [ i ] == 0 ) { for ( int j = 2 * i ; j < MAX ; j += i ) count [ j ] ++ ; count [ i ] = 1 ; } } } static int query ( int [ ] count , int l , int r ) { int sum = 0 ; for ( int i = l ; i <= r ; i ++ ) sum += count [ i ] ; return sum ; } public static void Main ( ) { int [ ] count = new int [ MAX ] ; sieve ( count ) ; Console . Write ( query ( count , 6 , 10 ) + " ▁ " + query ( count , 1 , 5 ) ) ; } }

Index/key variables: MAX, i, j
Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void generateNumbers ( int [ ] factor , int n , int k ) { int [ ] next = new int [ k ] ; for ( int i = 0 ; i < n ; ) { int toincrement = 0 ; for ( int j = 0 ; j < k ; j ++ ) if ( next [ j ] < next [ toincrement ] ) toincrement = j ; if ( output != next [ toincrement ] ) { output = next [ toincrement ] ; Console . Write ( next [ toincrement ] + " ▁ " ) ; i ++ ; } next [ toincrement ] += factor [ toincrement ] ; } } static public void Main ( ) { int [ ] factor = { 3 , 5 , 7 } ; int n = 10 ; int k = factor . Length ; generateNumbers ( factor , n , k ) ; } }

Index/key variables: j, k, toincrement
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void checkReversible ( int n ) { int rev = 0 , rem = 0 ; int flag = n ; while ( flag > 0 ) { rem = flag % 10 ; rev *= 10 ; rev += rem ; flag /= 10 ; } int sum = rev + n ; while ( sum > 0 && ( rem % 2 != 0 ) ) { rem = sum % 10 ; sum /= 10 ; } if ( sum == 0 ) Console . WriteLine ( " Reversible ▁ Number " ) ; else Console . WriteLine ( " Non - Reversible ▁ Number " ) ; } public static void Main ( ) { int n = 36 ; checkReversible ( n ) ; } }

Accumulator variables: flag, rev, sum
Class/struct names: GFG
C# program:
using System ; class GFG { static void countReversible ( int n ) { int count = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { switch ( i % 4 ) { case 0 : case 2 : count += 20 * ( int ) Math . Pow ( 30 , ( i / 2 - 1 ) ) ; break ; case 3 : count += 100 * ( int ) Math . Pow ( 500 , i / 4 ) ; break ; case 1 : break ; } } Console . WriteLine ( count ) ; } public static void Main ( ) { int n = 9 ; countReversible ( n ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int GCD ( int a , int b ) { if ( b == 0 ) return a ; return GCD ( b , a % b ) ; } static int multiplicativeOrder ( int A , int N ) { if ( GCD ( A , N ) != 1 ) return - 1 ; int result = 1 ; int K = 1 ; while ( K < N ) { result = ( result * A ) % N ; if ( result == 1 ) return K ; K ++ ; } return - 1 ; } public static void Main ( ) { int A = 4 , N = 7 ; Console . Write ( multiplicativeOrder ( A , N ) ) ; } }

Accumulator variables: K
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumOfRange ( int a , int b ) { int i = ( a * ( a + 1 ) ) >> 1 ; int j = ( b * ( b + 1 ) ) >> 1 ; return ( i - j ) ; } static int sumofproduct ( int n ) { int sum = 0 ; int root = ( int ) Math . Sqrt ( n ) ; for ( int i = 1 ; i <= root ; i ++ ) { int up = n / i ; int low = Math . Max ( n / ( i + 1 ) , root ) ; sum += ( i * sumOfRange ( up , low ) ) ; sum += ( i * ( n / i ) ) ; } return sum ; } static public void Main ( String [ ] args ) { int n = 10 ; Console . WriteLine ( sumofproduct ( n ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool isPrime ( int n ) { if ( n <= 1 ) { return false ; } if ( n <= 3 ) { return true ; } if ( n % 2 == 0 n % 3 == 0 ) { return false ; } for ( int i = 5 ; i * i <= n ; i = i + 6 ) { if ( n % i == 0 || n % ( i + 2 ) == 0 ) { return false ; } } return true ; } static int power ( int x , int y , int p ) { while ( y > 0 ) { if ( y % 2 == 1 ) { res = ( res * x ) % p ; } x = ( x * x ) % p ; } return res ; } static void findPrimefactors ( HashSet < int > s , int n ) { while ( n % 2 == 0 ) { s . Add ( 2 ) ; n = n / 2 ; } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i = i + 2 ) { while ( n % i == 0 ) { s . Add ( i ) ; n = n / i ; } } if ( n > 2 ) { s . Add ( n ) ; } } static int findPrimitive ( int n ) { HashSet < int > s = new HashSet < int > ( ) ; if ( isPrime ( n ) == false ) { return - 1 ; } int phi = n - 1 ; findPrimefactors ( s , phi ) ; for ( int r = 2 ; r <= phi ; r ++ ) { bool flag = false ; foreach ( int a in s ) { if ( power ( r , phi / ( a ) , n ) == 1 ) { flag = true ; break ; } } if ( flag == false ) { return r ; } } return - 1 ; } public static void Main ( String [ ] args ) { int n = 761 ; Console . WriteLine ( " ▁ Smallest ▁ primitive ▁ root ▁ of ▁ " + n + " ▁ is ▁ " + findPrimitive ( n ) ) ; } }

Accumulator variables: r
Iterator variables: a, i, r
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; class GFG { static int minPower ( int n , int x ) { if ( x == 1 ) return n ; int ans = 0 ; while ( n > 0 ) { ans += ( n % x ) ; n /= x ; } return ans ; } public static void Main ( ) { int n = 5 , x = 3 ; Console . WriteLine ( minPower ( n , x ) ) ; } }

Accumulator variables: ans, n
Class/struct names: GFG
C# program:
using System ; class GFG { static int calSum ( int n ) { int a = 3 , b = 0 , c = 2 ; return 3 ; return 3 ; return 5 ; int sum = 5 ; while ( n > 2 ) { int d = a + b ; sum += d ; a = b ; b = c ; c = d ; n -- ; } return sum ; } public static void Main ( ) { int n = 9 ; Console . WriteLine ( calSum ( n ) ) ; } }

Accumulator variables: n, sum
Class/struct names: GFG
C# program:
using System ; class GFG { static int findKHCF ( int x , int y , int k ) { int small = Math . Min ( x , y ) ; int count = 1 ; for ( int i = 2 ; i <= small ; i ++ ) { if ( x % i == 0 && y % i == 0 ) count ++ ; if ( count == k ) return i ; } return - 1 ; } public static void Main ( ) { int x = 4 , y = 24 , k = 3 ; Console . Write ( findKHCF ( x , y , k ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findMinNumber ( int n ) { int count = 0 , ans = 1 ; while ( n % 2 == 0 ) { count ++ ; n /= 2 ; } if ( count % 2 == 1 ) ans *= 2 ; for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i += 2 ) { count = 0 ; while ( n % i == 0 ) { count ++ ; n /= i ; } if ( count % 2 == 1 ) ans *= i ; } if ( n > 2 ) ans *= n ; return ans ; } public static void Main ( ) { int n = 72 ; Console . WriteLine ( findMinNumber ( n ) ) ; } }

Accumulator variables: ans, count, i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static Boolean isToOneRec ( int n , HashSet < int > s ) { if ( n == 1 ) { return true ; } if ( s . Contains ( n ) ) { return false ; } return ( n % 2 == 1 ) ? isToOneRec ( 3 * n + 1 , s ) : isToOneRec ( n / 2 , s ) ; } static Boolean isToOne ( int n ) { HashSet < int > s = new HashSet < int > ( ) ; return isToOneRec ( n , s ) ; } public static void Main ( String [ ] args ) { int n = 5 ; if ( isToOne ( n ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isToOne ( int n ) { return ( n > 0 ) ; } public static void Main ( ) { int n = 5 ; if ( isToOne ( n ) == true ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static void findgcd ( int n , int x , int y ) { int g = gcd ( x , y ) ; for ( int i = 0 ; i < g ; i ++ ) Console . Write ( n ) ; } public static void Main ( ) { int n = 123 , x = 5 , y = 2 ; findgcd ( n , x , y ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( ( a % b ) == 0 ) return b ; return gcd ( b , a % b ) ; } static int firstFactorialDivisibleNumber ( int x ) { int new_x = x ; for ( i = 1 ; i < x ; i ++ ) { new_x /= gcd ( i , new_x ) ; if ( new_x == 1 ) break ; } return i ; } static int countFactorialXNotY ( int x , int y ) { return ( firstFactorialDivisibleNumber ( y ) - firstFactorialDivisibleNumber ( x ) ) ; } public static void Main ( ) { int x = 15 , y = 25 ; Console . Write ( countFactorialXNotY ( x , y ) ) ; } }

Accumulator variables: i, new_x
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int firstFactorialDivisibleNumber ( int x ) { int fact = 1 ; for ( i = 1 ; i < x ; i ++ ) { fact = fact * i ; if ( fact % x == 0 ) break ; } return i ; } public static void Main ( ) { int x = 16 ; Console . Write ( firstFactorialDivisibleNumber ( x ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG