dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . util . * ; import java . lang . * ; public class GFG { public static int findNth ( int n ) { int count = 0 ; for ( int curr = 19 ; ; curr += 9 ) { int sum = 0 ; for ( int x = curr ; x > 0 ; x = x / 10 ) sum = sum + x % 10 ; if ( sum == 10 ) count ++ ; if ( count == n ) return curr ; } } public static void main ( String [ ] args ) { System . out . print ( findNth ( 5 ) ) ; } }

Accumulator variables: count, curr
Iterator variables: curr, x
Class/struct names: GFG
Java program:
class GFG { static int findSum ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) for ( int j = i ; j <= n ; j ++ ) sum = sum + i * j ; return sum ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( findSum ( n ) ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static int findSum ( int n ) { int multiTerms = n * ( n + 1 ) / 2 ; int sum = multiTerms ; for ( int i = 2 ; i <= n ; i ++ ) { multiTerms = multiTerms - ( i - 1 ) ; sum = sum + multiTerms * i ; } return sum ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( findSum ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static class pair { int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static boolean isPrime ( int n ) { if ( n < 2 ) return false ; for ( int i = 2 ; i <= Math . sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) return false ; } return true ; } static void lemoine ( int n ) { HashMap < Integer , pair > pr = new HashMap < > ( ) ; int i = 0 ; for ( int q = 1 ; q <= n / 2 ; q ++ ) { int p = n - 2 * q ; if ( isPrime ( p ) && isPrime ( q ) ) pr . put ( i , new pair ( p , q ) ) ; i ++ ; } for ( Map . Entry < Integer , pair > it : pr . entrySet ( ) ) System . out . print ( n + " ▁ = ▁ " + it . getValue ( ) . first + " ▁ + ▁ ( 2 ▁ * ▁ " + it . getValue ( ) . second + ")NEW_LINE"); } public static void main ( String [ ] args ) { int n = 39 ; System . out . print ( n + " ▁ can ▁ be ▁ expressed ▁ as ▁ " + "NEW_LINE"); lemoine ( n ) ; } }

Accumulator variables: i, q
Iterator variables: i, q
Class/struct names: GFG, pair
Java program:
import java . io . * ; class GFG { static int totalSumDivisibleByNum ( int digit , int number ) { int firstnum = ( int ) Math . pow ( 10 , digit - 1 ) ; int lastnum = ( int ) Math . pow ( 10 , digit ) ; firstnum = ( firstnum - firstnum % number ) + number ; lastnum = ( lastnum - lastnum % number ) ; int count = ( ( lastnum - firstnum ) / number + 1 ) ; return ( ( lastnum + firstnum ) * count ) / 2 ; } public static void main ( String [ ] args ) { int n = 3 , number = 7 ; System . out . println ( totalSumDivisibleByNum ( n , number ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; import java . lang . * ; class GFG { public static int Nth_of_AP ( int a , int d , int N ) { return ( a + ( N - 1 ) * d ) ; } public static void main ( String [ ] args ) { int a = 2 ; int d = 1 ; int N = 5 ; System . out . print ( " The ▁ " + N + " th ▁ term ▁ of ▁ the ▁ series ▁ is ▁ : ▁ " + Nth_of_AP ( a , d , N ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static boolean checkFibinnary ( int n ) { int prev_last = 0 ; while ( n != 0 ) { if ( ( n & 1 ) != 0 && prev_last != 0 ) return false ; prev_last = n & 1 ; n >>= 1 ; } return true ; } public static void main ( String [ ] args ) { int n = 10 ; if ( checkFibinnary ( n ) == true ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int sumOfSeries ( int n ) { return ( int ) ( 0.6172 * ( Math . pow ( 10 , n ) - 1 ) - 0.55 * n ) ; } public static void main ( String [ ] args ) { int n = 2 ; System . out . println ( sumOfSeries ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int Nonagonal ( int n ) { return n * ( 7 * n - 5 ) / 2 ; } public static void main ( String args [ ] ) { int n = 10 ; System . out . println ( Nonagonal ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static Boolean divisibleBy20 ( String num ) { int lastTwoDigits = Integer . parseInt ( num . substring ( num . length ( ) - 2 , num . length ( ) ) ) ; return ( ( lastTwoDigits % 5 == 0 ) && ( lastTwoDigits % 4 == 0 ) ) ; } public static void main ( String [ ] args ) { String num = "63284689320" ; if ( divisibleBy20 ( num ) == true ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static boolean isDvisibleBy12 ( String num ) { if ( num . length ( ) >= 3 ) { int d1 = ( int ) num . charAt ( num . length ( ) - 1 ) ; if ( d1 % 2 != 0 ) return false ; int d2 = ( int ) num . charAt ( num . length ( ) - 2 ) ; int sum = 0 ; for ( int i = 0 ; i < num . length ( ) ; i ++ ) sum += num . charAt ( i ) ; return ( sum % 3 == 0 && ( d2 * 10 + d1 ) % 4 == 0 ) ; } else { int number = Integer . parseInt ( num ) ; return ( number % 12 == 0 ) ; } } public static void main ( String [ ] args ) { String num = "12244824607284961224" ; if ( isDvisibleBy12 ( num ) ) System . out . print ( " Yes " ) ; else System . out . print ( " No " ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GfG { static Boolean check ( int n ) { int d = ( int ) Math . sqrt ( n ) ; if ( d * d == n ) return true ; return false ; } static int largestNonPerfectSquareNumber ( int a [ ] , int n ) { int maxi = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! check ( a [ i ] ) ) maxi = Math . max ( a [ i ] , maxi ) ; } return maxi ; } public static void main ( String [ ] args ) { int a [ ] = { 16 , 20 , 25 , 2 , 3 , 10 } ; int n = a . length ; System . out . println ( largestNonPerfectSquareNumber ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
Java program:
class GFG { static void printAP ( int a , int d , int n ) { int curr_term ; curr_term = a ; for ( int i = 1 ; i <= n ; i ++ ) { System . out . print ( curr_term + " ▁ " ) ; curr_term = curr_term + d ; } } public static void main ( String [ ] args ) { int a = 2 ; int d = 1 ; int n = 5 ; printAP ( a , d , n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; import java . math . * ; class GFG { static void printNonSquare ( int n ) { int curr_count = 2 , num = 2 , count = 0 ; while ( count < n ) { for ( int i = 0 ; i < curr_count && count < n ; i ++ ) { System . out . print ( num + " ▁ " ) ; count ++ ; num ++ ; } num ++ ; curr_count += 2 ; } } public static void main ( String args [ ] ) { int n = 10 ; printNonSquare ( n ) ; } }

Accumulator variables: count, curr_count, i, num
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { public static int countZeroso ( int [ ] a , int n ) { int count2 = 0 , count5 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { while ( a [ i ] % 2 == 0 ) { a [ i ] = a [ i ] / 2 ; count2 ++ ; } while ( a [ i ] % 5 == 0 ) { a [ i ] = a [ i ] / 5 ; count5 ++ ; } } return ( count2 < count5 ) ? count2 : count5 ; } public static void main ( String argc [ ] ) { int [ ] a = new int [ ] { 10 , 100 , 20 , 30 , 50 , 91 , 12 , 80 } ; int n = 8 ; System . out . println ( countZeroso ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: count2, count5, i
Iterator variables: i
Class/struct names: GfG
Java program:
import java . io . * ; class GFG { static int squareSum ( int n ) { return 2 * n * ( n + 1 ) * ( 2 * n + 1 ) / 3 ; } public static void main ( String args [ ] ) throws IOException { System . out . println ( squareSum ( 8 ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; class GFG { static long [ ] pwr ; static Boolean isMunchhausen ( int n ) { long sum = 0l ; int temp = n ; while ( temp > 0 ) { int index = temp % 10 ; sum = sum + pwr [ index ] ; temp /= 10 ; } return ( sum == n ) ; } static void printMunchhausenNumbers ( int n ) { pwr = new long [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) pwr [ i ] = ( long ) Math . pow ( ( float ) i , ( float ) i ) ; for ( int i = 1 ; i <= n ; i ++ ) if ( isMunchhausen ( i ) == true ) System . out . println ( i ) ; } public static void main ( String [ ] args ) { int n = 10000 ; printMunchhausenNumbers ( n ) ; } }

Index/key variables: i, index
Accumulator variables: i, temp
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { public static int kthdigit ( int a , int b , int k ) { int p = ( int ) Math . pow ( a , b ) ; int count = 0 ; while ( p > 0 && count < k ) { int rem = p % 10 ; count ++ ; if ( count == k ) return rem ; p = p / 10 ; } return 0 ; } public static void main ( String argc [ ] ) { int a = 5 , b = 2 ; int k = 1 ; System . out . println ( kthdigit ( a , b , k ) ) ; } }

Accumulator variables: count
Class/struct names: GfG
Java program:
import java . util . * ; class GFG { static long digSum ( long n ) { if ( n == 0 ) return 0 ; return ( n % 9 == 0 ) ? 9 : ( n % 9 ) ; } static long PowDigSum ( long n , long x ) { long sum = digSum ( n ) ; long rem = x % 6 ; if ( ( sum == 3 sum == 6 ) && x > 1 ) return 9 ; else if ( x == 1 ) return sum ; else if ( x == 0 ) return 1 ; else if ( rem == 0 ) return digSum ( ( long ) Math . pow ( sum , 6 ) ) ; else return digSum ( ( long ) Math . pow ( sum , rem ) ) ; } public static void main ( String [ ] args ) { int n = 33333 ; int x = 332654 ; System . out . println ( PowDigSum ( n , x ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class Area { public static int maxArea ( int A [ ] , int len ) { int l = 0 ; int r = len - 1 ; int area = 0 ; while ( l < r ) { area = Math . max ( area , Math . min ( A [ l ] , A [ r ] ) * ( r - l ) ) ; if ( A [ l ] < A [ r ] ) l += 1 ; else r -= 1 ; } return area ; } public static void main ( String [ ] args ) { int a [ ] = { 1 , 5 , 4 , 3 } ; int b [ ] = { 3 , 1 , 2 , 4 , 5 } ; int len1 = 4 ; System . out . print ( maxArea ( a , len1 ) + "NEW_LINE" ); int len2 = 5 ; System . out . print ( maxArea ( b , len2 ) ) ; } }

Index/key variables: l, r
Accumulator variables: l, r
Class/struct names: Area
Java program:
import java . io . * ; class GFG { static int mobius ( int n ) { int p = 0 ; if ( n % 2 == 0 ) { n = n / 2 ; p ++ ; if ( n % 2 == 0 ) return 0 ; } for ( int i = 3 ; i <= Math . sqrt ( n ) ; i = i + 2 ) { if ( n % i == 0 ) { n = n / i ; p ++ ; if ( n % i == 0 ) return 0 ; } } return ( p % 2 == 0 ) ? - 1 : 1 ; } public static void main ( String [ ] args ) { int N = 17 ; System . out . println ( " Mobius ▁ Functions " + " ▁ M ( N ) ▁ at ▁ N ▁ = ▁ " + N + " ▁ is : ▁ " + mobius ( N ) ) ; System . out . println ( " Mobius ▁ Functions " + " M ( N ) ▁ at ▁ N ▁ = ▁ " + 25 + " ▁ is : ▁ " + mobius ( 25 ) ) ; System . out . println ( " Mobius ▁ Functions " + " M ( N ) ▁ at ▁ N ▁ = ▁ " + 6 + " ▁ is : ▁ " + mobius ( 6 ) ) ; } }

Accumulator variables: p
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int factorial ( int start , int end ) { int res = 1 ; for ( int i = start ; i <= end ; i ++ ) res *= i ; return res ; } static int sumofsquare ( int n ) { return factorial ( n + 1 , 2 * n ) / factorial ( 1 , n ) ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( sumofsquare ( n ) ) ; } }

Accumulator variables: i, res
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static double PHI = 1.6180339 ; static int f [ ] = { 0 , 1 , 1 , 2 , 3 , 5 } ; static int fib ( int n ) { if ( n < 6 ) return f [ n ] ; int t = 5 ; int fn = 5 ; while ( t < n ) { fn = ( int ) Math . round ( fn * PHI ) ; t ++ ; } return fn ; } public static void main ( String [ ] args ) { int n = 9 ; System . out . println ( n + " th ▁ Fibonacci ▁ Number ▁ = ▁ " + fib ( n ) ) ; } }

Index/key variables: n
Accumulator variables: t
Class/struct names: GFG
Java program:
import java . io . * ; class Euler { float func ( float x , float y ) { return ( x + y + x * y ) ; } void euler ( float x0 , float y , float h , float x ) { float temp = - 0 ; while ( x0 < x ) { temp = y ; y = y + h * func ( x0 , y ) ; x0 = x0 + h ; } System . out . println ( " Approximate ▁ solution ▁ at ▁ x ▁ = ▁ " + x + " ▁ is ▁ " + y ) ; } public static void main ( String args [ ] ) throws IOException { Euler obj = new Euler ( ) ; float x0 = 0 ; float y0 = 1 ; float h = 0.025f ; float x = 0.1f ; obj . euler ( x0 , y0 , h , x ) ; } }

Class/struct names: Euler
Java program:
import java . io . * ; class GfG { static void solution ( int a , int b , int n ) { for ( int i = 0 ; i * a <= n ; i ++ ) { if ( ( n - ( i * a ) ) % b == 0 ) { System . out . println ( " x ▁ = ▁ " + i + " , ▁ y ▁ = ▁ " + ( n - ( i * a ) ) / b ) ; return ; } } System . out . println ( " No ▁ solution " ) ; } public static void main ( String [ ] args ) { int a = 2 , b = 3 , n = 7 ; solution ( a , b , n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
Java program:
import java . io . * ; class GFG { static int binomialCoeffSum ( int n ) { return ( 1 << n ) ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( binomialCoeffSum ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class Eulerian { public static void precisionCompute ( int x , int y , int n ) { if ( y == 0 ) { System . out . print ( " Infinite " ) ; return ; } if ( x == 0 ) { System . out . print ( "0" ) ; return ; } if ( n <= 0 ) { System . out . print ( x / y ) ; return ; } if ( ( ( x > 0 ) && ( y < 0 ) ) || ( ( x < 0 ) && ( y > 0 ) ) ) { System . out . print ( " - " ) ; x = x > 0 ? x : - x ; y = y > 0 ? y : - y ; } int d = x / y ; for ( int i = 0 ; i <= n ; i ++ ) { System . out . print ( d ) ; x = x - ( y * d ) ; if ( x == 0 ) break ; x = x * 10 ; d = x / y ; if ( i == 0 ) System . out . print ( " . " ) ; } } public static void main ( String [ ] args ) { int x = 22 , y = 7 , n = 15 ; precisionCompute ( x , y , n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: Eulerian
Java program:
import java . io . * ; class GFG { static void quadrant ( int x , int y ) { if ( x > 0 && y > 0 ) System . out . println ( " lies ▁ in ▁ First ▁ quadrant " ) ; else if ( x < 0 && y > 0 ) System . out . println ( " lies ▁ in ▁ Second ▁ quadrant " ) ; else if ( x < 0 && y < 0 ) System . out . println ( " lies ▁ in ▁ Third ▁ quadrant " ) ; else if ( x > 0 && y < 0 ) System . out . println ( " lies ▁ in ▁ Fourth ▁ quadrant " ) ; else if ( x == 0 && y > 0 ) System . out . println ( " lies ▁ at ▁ positive ▁ y ▁ axis " ) ; else if ( x == 0 && y < 0 ) System . out . println ( " lies ▁ at ▁ negative ▁ y ▁ axis " ) ; else if ( y == 0 && x < 0 ) System . out . println ( " lies ▁ at ▁ negative ▁ x ▁ axis " ) ; else if ( y == 0 && x > 0 ) System . out . println ( " lies ▁ at ▁ positive ▁ x ▁ axis " ) ; else System . out . println ( " lies ▁ at ▁ origin " ) ; } public static void main ( String [ ] args ) { int x = 1 , y = 1 ; quadrant ( x , y ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class Prime { public static boolean checkDigits ( int n ) { while ( n > 0 ) { int dig = n % 10 ; if ( dig != 2 && dig != 3 && dig != 5 && dig != 7 ) return false ; n /= 10 ; } return true ; } public static boolean prime ( int n ) { if ( n == 1 ) return false ; for ( int i = 2 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) return false ; } return true ; } public static boolean isFullPrime ( int n ) { return ( checkDigits ( n ) && prime ( n ) ) ; } public static void main ( String [ ] args ) { int n = 53 ; if ( isFullPrime ( n ) ) System . out . print ( " Yes " ) ; else System . out . print ( " No " ) ; } }

Accumulator variables: i, n
Iterator variables: i
Class/struct names: Prime
Java program:
class GFG { static String getResult ( String st ) { int sum = 0 ; int length = st . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { sum = sum + ( int ) Math . pow ( st . charAt ( i ) - '0' , length ) ; } int number = Integer . parseInt ( st ) ; if ( number == sum ) return " yes " ; else return " no " ; } public static void main ( String [ ] args ) { String st = "153" ; System . out . print ( getResult ( st ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . Arrays ; class GFG { static final int MAX = 500 ; static int nthSHN ( int n , int dp [ ] ) { if ( n == 1 n == 2 ) return dp [ n ] = 1 ; if ( dp [ n ] != - 1 ) return dp [ n ] ; return dp [ n ] = ( ( 6 * n - 9 ) * nthSHN ( n - 1 , dp ) - ( n - 3 ) * nthSHN ( n - 2 , dp ) ) / n ; } public static void main ( String [ ] args ) { int n = 6 ; int dp [ ] = new int [ MAX ] ; Arrays . fill ( dp , - 1 ) ; System . out . println ( nthSHN ( n , dp ) ) ; } }

Index/key variables: MAX, n
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { static int evenSum ( int n ) { int curr = 2 , sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { sum += curr ; curr += 2 ; } return sum ; } public static void main ( String argc [ ] ) { int n = 20 ; System . out . println ( " Sum ▁ of ▁ first ▁ " + n + " ▁ Even ▁ numbers ▁ is : ▁ " + evenSum ( n ) ) ; } }

Accumulator variables: curr, i, sum
Iterator variables: i
Class/struct names: GfG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { static int evenSum ( int n ) { return ( n * ( n + 1 ) ) ; } public static void main ( String argc [ ] ) { int n = 20 ; System . out . println ( " Sum ▁ of ▁ first ▁ " + n + " ▁ Even ▁ numbers ▁ is : ▁ " + evenSum ( n ) ) ; } }

Class/struct names: GfG
Java program:
import java . io . * ; class GFG { static double kmphTOmph ( double kmph ) { return 0.6214 * kmph ; } static double mphTOkmph ( double mph ) { return mph * 1.60934 ; } public static void main ( String [ ] args ) { double kmph = 150 ; double mph = 100 ; System . out . println ( " speed ▁ in ▁ miles / hr ▁ is ▁ " + kmphTOmph ( kmph ) ) ; System . out . println ( " speed ▁ in ▁ km / hr ▁ is ▁ " + mphTOkmph ( mph ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; class GFG { static long subsequences ( int a [ ] , int n , int r ) { Map < Integer , Integer > left = new HashMap < > ( ) , right = new HashMap < > ( ) ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) right . put ( a [ i ] , right . getOrDefault ( a [ i ] , 0 ) + 1 ) ; for ( int i = 0 ; i < n ; i ++ ) { long c1 = 0 , c2 = 0 ; if ( a [ i ] % r == 0 ) c1 = left . getOrDefault ( a [ i ] / r , 0 ) ; right . put ( a [ i ] , right . getOrDefault ( a [ i ] , 0 ) - 1 ) ; c2 = right . getOrDefault ( a [ i ] * r , 0 ) ; ans += c1 * c2 ; left . put ( a [ i ] , left . getOrDefault ( a [ i ] , 0 ) + 1 ) ; } return ans ; } public static void main ( String [ ] args ) { int a [ ] = { 1 , 2 , 6 , 2 , 3 , 6 , 9 , 18 , 3 , 9 } ; int n = a . length ; int r = 3 ; System . out . println ( subsequences ( a , n , r ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static int findNumber ( int arr [ ] , int n ) { int ans = arr [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) ans = gcd ( ans , arr [ i ] ) ; for ( int i = 0 ; i < n ; i ++ ) if ( arr [ i ] == ans ) return ans ; return - 1 ; } public static void main ( String args [ ] ) { int arr [ ] = { 2 , 2 , 4 } ; int n = arr . length ; System . out . println ( findNumber ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static ArrayList < Integer > primes = new ArrayList < Integer > ( ) ; static void SieveofEratosthenes ( int n ) { boolean [ ] visited = new boolean [ n * n + 2 ] ; for ( int i = 2 ; i <= n + 1 ; i ++ ) if ( ! visited [ i ] ) { for ( int j = i * i ; j <= n + 1 ; j += i ) visited [ j ] = true ; primes . add ( i ) ; } } static boolean specialPrimeNumbers ( int n , int k ) { SieveofEratosthenes ( n ) ; int count = 0 ; for ( int i = 0 ; i < primes . size ( ) ; i ++ ) { for ( int j = 0 ; j < i - 1 ; j ++ ) { if ( primes . get ( j ) + primes . get ( j + 1 ) + 1 == primes . get ( i ) ) { count ++ ; break ; } } if ( count == k ) return true ; } return false ; } public static void main ( String [ ] args ) { int n = 27 , k = 2 ; if ( specialPrimeNumbers ( n , k ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static void factorize ( long n ) { int count = 0 ; while ( ! ( n % 2 > 0 ) ) { n >>= 1 ; count ++ ; } if ( count > 0 ) { System . out . println ( "2" + " ▁ " + count ) ; } for ( long i = 3 ; i <= ( long ) Math . sqrt ( n ) ; i += 2 ) { count = 0 ; while ( n % i == 0 ) { count ++ ; n = n / i ; } if ( count > 0 ) { System . out . println ( i + " ▁ " + count ) ; } } if ( n > 2 ) { System . out . println ( n + " ▁ " + "1" ) ; } } public static void main ( String [ ] args ) { long n = 1000000000000000000L ; factorize ( n ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int __gcd ( int a , int b ) { if ( a == 0 ) return b ; return __gcd ( b % a , a ) ; } static int minimumMoves ( int A [ ] , int N ) { int one = 0 ; for ( int i = 0 ; i < N ; i ++ ) if ( A [ i ] == 1 ) one ++ ; if ( one != 0 ) return N - one ; int minimum = Integer . MAX_VALUE ; for ( int i = 0 ; i < N ; i ++ ) { int g = A [ i ] ; for ( int j = i + 1 ; j < N ; j ++ ) { g = __gcd ( A [ j ] , g ) ; if ( g == 1 ) { minimum = Math . min ( minimum , j - i ) ; break ; } } } if ( minimum == Integer . MAX_VALUE ) return - 1 ; else return N + minimum - 1 ; } public static void main ( String [ ] args ) { int A [ ] = { 2 , 4 , 3 , 9 } ; int N = A . length ; System . out . print ( minimumMoves ( A , N ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, one
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { public static void series ( int n , int d ) { if ( d == 0 ) { for ( int i = 0 ; i < n ; i ++ ) System . out . print ( "0 ▁ " ) ; System . out . println ( ) ; return ; } if ( n % 2 == 0 ) { for ( int i = 1 ; i <= n ; i ++ ) { System . out . print ( Math . pow ( - 1 , i ) * d + " ▁ " ) ; } System . out . println ( ) ; } else { float m = n ; float r = ( m / ( m - 1 ) ) ; float g = ( float ) ( d * ( float ) ( Math . sqrt ( r ) ) ) ; System . out . print ( "0 ▁ " ) ; for ( int i = 1 ; i < n ; i ++ ) { System . out . print ( Math . pow ( - 1 , i ) * g + " ▁ " ) ; } System . out . println ( ) ; } } public static void main ( String args [ ] ) { int n = 3 , d = 3 ; series ( n , d ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
Java program:
class GFG { static int countDigitOne ( int n ) { int countr = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String str = String . valueOf ( i ) ; countr += str . split ( "1" , - 1 ) . length - 1 ; } return countr ; } public static void main ( String [ ] args ) { int n = 13 ; System . out . println ( countDigitOne ( n ) ) ; n = 131 ; System . out . println ( countDigitOne ( n ) ) ; n = 159 ; System . out . println ( countDigitOne ( n ) ) ; } }

Accumulator variables: countr, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class exp_sq { static long exponentiation ( long base , long exp ) { long t = 1L ; while ( exp > 0 ) { if ( exp % 2 != 0 ) t = ( t * base ) % N ; base = ( base * base ) % N ; exp /= 2 ; } return t % N ; } } public static void main ( String [ ] args ) { long base = 5 ; long exp = 100000 ; long modulo = exponentiation ( base , exp ) ; System . out . println ( modulo ) ; }

Accumulator variables: exp
Class/struct names: exp_sq