1. 

/**
* Angewandte Mathematik, SS11
* Problem: 10523 Very Easy !!!
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1464
* @author Brielbeck, Daniel
* @author Weber, Georg
* @version 1.0, 04/12/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 1.288
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main {

public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
String input;
while ((input = reader.readLine()) != null) {
if (input.equals("0")) break;

int n = Integer.parseInt(input.split(" ")[0]);
int a = Integer.parseInt(input.split(" ")[1]);
BigInteger sum= new BigInteger("0");
for (int i=1;i<=n;i++){
BigInteger temp = new BigInteger(String.valueOf(a));
temp = temp.pow(i);
temp = temp.multiply(new BigInteger(String.valueOf(i)));
sum = sum.add(temp);
}
System.out.println(sum);
}
}
}

2.
/**
* Angewandte Mathematik, SS11
* Problem: 10523 - Very Easy !!!
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1464
*
* @author Markus Schöllner
* @author Andreas Maier
* @version 1.0, 04/12/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 1.056
*/

import java.math.*;
import java.util.*;

public class Main {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);
BigInteger bigC;

while(input.hasNext()){
int n = input.nextInt();
BigInteger number1 = input.nextBigInteger();
BigInteger result = BigInteger.ZERO;

for(int c=1; c<=n;c++){
bigC=BigInteger.valueOf(c);
result = result.add((number1.pow(c)).multiply(bigC));
}
System.out.println(result);
}
}
}

3.

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.StringTokenizer;

/**
* Angewandte Mathematik, SS11
* Problem: 10523 - Very Easy !!!
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1464
*
* @author Unverzart Michael
* @author Wurth Manuel
* @version 1.0, 11/4/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.960
*/

public class Main {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String inputLine;
while((inputLine = reader.readLine())!=null)
{
StringTokenizer st = new StringTokenizer(inputLine);
int n = new Integer(st.nextToken());
int a = new Integer(st.nextToken());
BigInteger sum = BigInteger.ZERO;
for(int i = 1;i<=n;i++){
sum=sum.add(BigInteger.valueOf(i).multiply(BigInteger.valueOf(a).pow(i)));
}
System.out.println(sum);
}
}
}

4.

/**
* Angewandte Mathematik, SS11
* Problem: 10523 Very Easy
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=23&page=show_problem&problem=2113
*
* @author Peter Weismann
* @author Pirmin Schneider
* @version 1.0, 04/20/2011
*
* Method : Ad-Hoc
* Status : Runtime error
* Runtime: 1.080
*/

import java.math.BigInteger;
import java.util.Scanner;

public class Main {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int N ;
BigInteger A;
BigInteger sum;

// Solange es eine weiteren Wert gibt, wird die Summe berechnet
while (input.hasNext()) {
sum = BigInteger.ZERO;
N = input.nextInt();
A = input.nextBigInteger();
// Schleife, die die Summe von 1 bis N berechnet
for (int i = 1; i <= N; i++) {
sum = sum.add(A.pow(i).multiply(BigInteger.valueOf(i)));
}
System.out.println(sum);
}
}
}