French License Plates
French license plates come in a sequential order, following a specific pattern of numbers and letters : AB-012-CD
Challenge
Write a program or function that, for a given number, outputs the corresponding french license plate number. Your program should not handle any special case as specified in the linked page. It should be able to generate the full 26*26*1000*26*26 => 456 976 000
possible plates, or as far as your language can support.
The numbering system goes as follows:
- AA-000-AA to AA-999-AA (numbers evolve first);
- AA-000-AB to AA-999-AZ (then the last letter on the right);
- AA-000-BA to AA-999-ZZ (then the first letter on the right);
- AB-000-AA to AZ-999-ZZ (then the last letter on the left);
- BA-000-AA to ZZ-999-ZZ (then the first letter on the left).
Input
- The plate number's index as an integer
Output
- The corresponding french license plate number
Additional information
- Letters have to be uppercase
- You can use both 0-based and 1-based indexing to generate the plates (meaning AA-000-AA can correspond to
0
or1
, assuming all the other test cases use the same indexing.
This is code-golf, shortest answer in every language wins!
Test cases (0-based indexing)
0 -> AA-000-AA
1 -> AA-001-AA
999 -> AA-999-AA
1000 -> AA-000-AB
675 999 -> AA-999-ZZ
676 000 -> AB-000-AA
456 975 999 -> ZZ-999-ZZ