My original answer addressed how to pull out an indexed item from a sequence. Despite the comments, it only allowed you to pull out a single item at a time. However, it allowed more complex items to be included in the sequence.
In fact, however, you don't want arbitrary items in sequences. You just want to convert an integer into some format in the same way counters are formatted in many other places in LaTeX. That is, this is basically like choosing whether you want your sections labelled with letters or your enumerated items labelled with roman numerals. The only real complication is that Greek letters are not among the default format options. For that case, therefore, we need to add \sudhir_int_to_greek:n using the method explained on page 184 of interface3.pdf.
\myindex[<positive integer>]
displays the integer in the current format. By default, this is a small letter from the Latin alphabet. If no argument is given, 1 is used.
\setmyindex{<format>}
sets the current format. <format> should be one of alph, Alph, arabic or greek. This can be easily extended following the patterns shown: a simple copy for a standard counter format such as Alph or setup from scratch for a case such as greek.
I've only provided the first five Greek letters, but you can extend it easily and copy the definition if you'd like to add uppercase Greek or whatever.
Then
$\myindex \myindex[1] \myindex[2] \myindex[3]$
\setmyindex{Alph}
$\myindex \myindex[1] \myindex[2] \myindex[3]$
\setmyindex{arabic}
$\myindex \myindex[1] \myindex[2] \myindex[3]$
\setmyindex{greek}
$\myindex \myindex[1] \myindex[2] \myindex[3]$
\setmyindex{alph}
$\myindex \myindex[1] \myindex[2] \myindex[3]$
will produce

Code:
\documentclass{article}
% ateb: https://tex.stackexchange.com/a/700165/
\ExplSyntaxOn
\cs_new_protected_nopar:Nn \sudhir_myindex:n
{
\sudhir_int_to_alph:n { #1 }
}
\cs_new_protected_nopar:Nn \sudhir_setmyindex:n
{
\cs_set_eq:Nc \sudhir_myindex:n { sudhir_int_to_#1:n }
}
\cs_new:Npn \sudhir_int_to_greek:n #1
{% interface3.pdf page 184
\int_to_symbols:nnn { #1 } { 5 }
{
{ 1 } { \ensuremath{\alpha} }
{ 2 } { \ensuremath{\beta} }
{ 3 } { \ensuremath{\gamma} }
{ 4 } { \ensuremath{\delta} }
{ 5 } { \ensuremath{\epsilon} }
}
}
\cs_new_eq:NN \sudhir_int_to_arabic:n \int_to_arabic:n
\cs_new_eq:NN \sudhir_int_to_alph:n \int_to_alph:n
\cs_new_eq:NN \sudhir_int_to_Alphc:n \int_to_Alph:n
\NewDocumentCommand \myindex { O {1} }
{%
\sudhir_myindex:n { #1 }
}
\NewDocumentCommand \setmyindex { m }
{
\sudhir_setmyindex:n { #1 }
}
\ExplSyntaxOff
\begin{document}
$\myindex \myindex[1] \myindex[2] \myindex[3]$
\setmyindex{Alph}
$\myindex \myindex[1] \myindex[2] \myindex[3]$
\setmyindex{arabic}
$\myindex \myindex[1] \myindex[2] \myindex[3]$
\setmyindex{greek}
$\myindex \myindex[1] \myindex[2] \myindex[3]$
\setmyindex{alph}
$\myindex \myindex[1] \myindex[2] \myindex[3]$
\end{document}
\indexhere. The result will certainly not be the same if somebody also tries to use standard\index. The problem might be obvious to you, but it will not be so for everybody. – cfr Nov 01 '23 at 18:33\indexis used in another meaning in the document then the same control sequence cannot be used in different meaning too. And OP asked for creating\indexmacro. I supposed, that OP doesn't use\indexin standard meaning, otherwise he would not want to redefine it. And your comment is enough warning. – wipet Nov 01 '23 at 19:27