gt: 			return gFunctionS(x) - gFunctionA(x);
context: package math_experimentations.factorfunctions;
  
  import java.util.ArrayList;
  
  import jlib.advmath.MathAdv;
  
  public class FactorFunctions {
  
  	public static long PFunctionS(long x){
  		Long[] primes = MathAdv.primeFactorArraySet(x);
  		Long[] revPrimes = new Long[primes.length];
  		for(int i = 0; i < primes.length; i++){
  			revPrimes[revPrimes.length-1-i] = primes[i];
  		}
  		long sum = 0;
  		for(long l : revPrimes){
  			sum += l;
  		}
  		return sum;
  	}
  	
  	public static long PFunctionA(long x){
  		Long[] primes = MathAdv.primeFactorArraySet(x);
  		Long[] revPrimes = new Long[primes.length];
  		for(int i = 0; i < primes.length; i++){
  			revPrimes[revPrimes.length-1-i] = primes[i];
  		}
  		long sum = 0;
  		for(int i = 0; i < revPrimes.length; i++){
  			if(i%2 == 0){
  				sum += revPrimes[i];
  			}else{
  				sum -= revPrimes[i];
  			}
  		}
  		return sum;
  	}
  	
  	public static long PFunctionD(long x, int sign){
  		if(sign >= 0){
  			return PFunctionS(x) + PFunctionA(x);
  		}else{
  			return PFunctionS(x) - PFunctionA(x);
  		}
  	}
  	
  	public static long pFunctionS(long x){
  		Long[] primes = MathAdv.primeFactorArray(x);
  		Long[] revPrimes = new Long[primes.length];
  		for(int i = 0; i < primes.length; i++){
  			revPrimes[revPrimes.length-1-i] = primes[i];
  		}
  		long sum = 0;
  		for(long l : revPrimes){
  			sum += l;
  		}
  		return sum;
  	}
  	
  	public static long pFunctionA(long x){
  		Long[] primes = MathAdv.primeFactorArray(x);
  		Long[] revPrimes = new Long[primes.length];
  		for(int i = 0; i < primes.length; i++){
  			revPrimes[revPrimes.length-1-i] = primes[i];
  		}
  		long sum = 0;
  		for(int i = 0; i < revPrimes.length; i++){
  			if(i%2 == 0){
  				sum += revPrimes[i];
  			}else{
  				sum -= revPrimes[i];
  			}
  		}
  		return sum;
  	}
  	
  	public static long pFunctionD(long x, int sign){
  		if(sign >= 0){
  			return pFunctionS(x) + pFunctionA(x);
  		}else{
  			return pFunctionS(x) - pFunctionA(x);
  		}
  	}
  	
  	public static long fFunctionS(long x){
  		Long[] phis = MathAdv.phi(x);
  		Long[] revPhis = new Long[phis.length];
  		for(int i = 0; i < phis.length; i++){
  			revPhis[revPhis.length-1-i] = phis[i];
  		}
  		long sum = 0;
  		for(long l : revPhis){
  			sum += l;
  		}
  		return sum;
  	}
  	
  	public static long fFunctionA(long x){
  		Long[] phis = MathAdv.phi(x);
  		Long[] revPhis = new Long[phis.length];
  		for(int i = 0; i < phis.length; i++){
  			revPhis[revPhis.length-1-i] = phis[i];
  		}
  		long sum = 0;
  		for(int i = 0; i < revPhis.length; i++){
  			if(i%2 == 0){
  				sum += revPhis[i];
  			}else{
  				sum -= revPhis[i];
  			}
  		}
  		return sum;
  	}
  	
  	public static long fFunctionD(long x, int sign){
  		if(sign >= 0){
  			return fFunctionS(x) + fFunctionA(x);
  		}else{
  			return fFunctionS(x) - fFunctionA(x);
  		}
  	}
  	
  	public static long lFunctionS(long x){
  		Long[] phis = MathAdv.phi(x);
  		Long[] revPhis = new Long[phis.length];
  		for(int i = 0; i < phis.length; i++){
  			revPhis[revPhis.length-1-i] = phis[i];
  		}
  		
  		Long[] distinctPs = MathAdv.primeFactorArraySet(x);
  		Long[] revDistinctPs = new Long[distinctPs.length];
  		for(int i = 0; i < revDistinctPs.length; i++){
  			revDistinctPs[revDistinctPs.length-1-i] = distinctPs[i];
  		}
  		
  		long sum = 0;
  		for(int i = 0; i < revDistinctPs.length; i++){
  			sum += Math.floor(Math.log(revPhis[i])/Math.log(revDistinctPs[i]));
  		}
  		
  		return sum;
  	}
  	
  	public static long lFunctionA(long x){
  		Long[] phis = MathAdv.phi(x);
  		Long[] revPhis = new Long[phis.length];
  		for(int i = 0; i < phis.length; i++){
  			revPhis[revPhis.length-1-i] = phis[i];
  		}
  		
  		Long[] distinctPs = MathAdv.primeFactorArraySet(x);
  		Long[] revDistinctPs = new Long[distinctPs.length];
  		for(int i = 0; i < revDistinctPs.length; i++){
  			revDistinctPs[revDistinctPs.length-1-i] = distinctPs[i];
  		}
  		
  		long sum = 0;
  		for(int i = 0; i < revDistinctPs.length; i++){
  			if(sum%2 == 0){
  				sum += Math.floor(Math.log(revPhis[i])/Math.log(revDistinctPs[i]));
  			}else{
  				sum -= Math.floor(Math.log(revPhis[i])/Math.log(revDistinctPs[i]));
  			}
  		}
  		
  		return sum;
  	}
  	
  	public static long lFunctionD(long x, int sign){
  		if(sign >= 0){
  			return lFunctionS(x) + lFunctionA(x);
  		}else{
  			return lFunctionS(x) - lFunctionA(x);
  		}
  	}
  	
  	public static long gFunctionS(long x){
  		ArrayList<Long> factors = new ArrayList<Long>();
  		for(long i = 1; i <= x; i++){
  			if(x%i == 0){
  				factors.add(i);
  			}
  		}
  		long sum = 0;
  		for(long l : factors){
  			sum += l;
  		}
  		return sum;
  	}
  	
  	public static long gFunctionA(long x){
  		ArrayList<Long> factors = new ArrayList<Long>();
  		for(long i = 1; i <= x; i++){
  			if(x%i == 0){
  				factors.add(i);
  			}
  		}
  		long sum = 0;
  		for(int i = 0; i < factors.size(); i++){
  			if(i%2 == 0){
  				sum += factors.get(i);
  			}else{
  				sum -= factors.get(i);
  			}
  		}
  		return sum;
  	}
  	
  	public static long gFunctionD(long x, int sign){
  		if(sign >= 0){
  			return gFunctionS(x) + gFunctionA(x);
  		}else{
  