function AZSequence($n){
$obj = ["A","B","C","D","E","F","G","H","I","J","k","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
$len = count($obj);
$array = [];
for($i = 0;$i < $n;$i++){
$subArray = [];
$max = pow($len,$i + 1);
for($j = 0;$j < $max;$j++){
$sub_sub = [];
for($k = 0;$k <= $i;$k++){
if($k == 0){
$sub_sub[] = $obj[$j % $len];
}else{
$num = floor($j / pow($len,$k));
$sub_sub[] = $obj[$num >= 26 ? $num % 26 : $num];
}
}
$subArray[] = implode('',array_reverse($sub_sub));
}
$array[] = $subArray;
}
return call_user_func_array("array_merge",$array);
}