13
If we assign each letter a respective integer, starting from 1, then a is 1, b is 2, c is 3, and so on. After z, the letters loop back around, but with a in front (aa, ab, ac). It then goes to ba, bb, bc... After this is completed, as you may have figured, another letter is added (aaa, aab, aac). "Prime letters" would be letters that are associated with a prime number. b would be the first prime letter, followed by c, e, g, et cetera.
The Challenge
Given an input n, find the nth "prime letter."
Examples
Input:
1
Output:
b
Input:
4
Output:
g
Input:
123
Output:
za
Scoring Criteria
This is code golf, so the shortest answer in bytes wins!
Basically, yes. – floof – 2019-10-17T12:42:23.230
5
Welcome to the site! This is a nice first question, but given the task, I believe it is a duplicate (although I can't find it just now). I'd recommend that for your next challenge you post it in the Sandbox first to receive feedback.
– caird coinheringaahing – 2019-10-17T12:50:46.8439Perhaps include test cases beyond Z? – HyperNeutrino – 2019-10-17T13:38:38.120
6related; this is the inverse (letters->numbers). I think the numbers->letters exists somewhere (even if it's just in a bijective base-n question), and prime-related challenges have been done to death. Not saying this is a bad challenge, just that it's a composite of existing ones. – Giuseppe – 2019-10-17T14:43:24.450
1Suggested test cases of big numbers so you can verify the letter wrapping works correctly. – Veskah – 2019-10-17T17:13:22.373
9Add the test case
123
->za
. Several current answers get it wrong. – benrg – 2019-10-17T21:40:17.2601How large can n be? – dan04 – 2019-10-18T02:58:06.947
Also related – Sara J – 2019-10-18T16:02:49.883