#!/bin/bash
# your code goes here

function leyland() {
# Presented here as a function body so multiple tests can be run within
# Ideone.  But the following line also works as a standalone program:
	printf %s\\n x={2..32}\;y={2..32}\;x^y+y^x|bc|sort -nu|sed $1!d
}

for testcase in 1 2 3 4 5 10 20 30; do
	echo "leyland[$testcase] = $(leyland $testcase)"
done