For those who have a particular interest or motivation (symbolic computation, logic programming, statistics, numerical analysis, data exploration, structure representation, conjecture mining), there are people who have worked with or developed systems to address items related to that interest or motivation. Many other answers to this question refer to python, SAGE, Ocaml, Haskell, R, and other languages, and there are references and tutorials for these to help one learn how to program in these languages.
Lacking such a specific interest or motivation, what should one do? I say, learn AWK!
Programming professionally is a discipline which requires a lot of specialized knowledge and training. Much of the time, mathematicians who are not also professional programmers "program as needed": they write the code and do the amount of testing and execution needed for a specific result, and the code written often does not get reused or extended on more than a very small scale. Those who develop libraries and systems for use by others operate with code reuse on a larger scale, but for many of these systems, the domain of application and the user base number at greatest in the thousands , if that. As a result, a lot of specialization occurs because of the specific needs of the user base. Many languages evolve toward meeting these specific needs with constructs and methods that take time and energy to learn.
What if you don't know what specifics to learn? Start with AWK, I say!
AWK is a system that is used for string processing. It is also capable of numeric processing. Its control constructs are a simplified version of constructs in C, and it has almost no typing. Everything is a string, or an integer or an associative array, with facilities for converting easily between these types, and with nice defaults for initialization.
AWK is very good for rapid prototyping and high level design. The development environment is not much larger than the size of the text editor and is easy to install. One can ignore a lot of the file processing features and just use a BEGIN{} block to encapsulate a program without learning about regular expressions and patterns.
Why do I suggest AWK? It has a simple subset of quickly learned constructs that make it easier to use than many general purpose languages, including the ones I've listed above. It allows you to consider problems from a general perspective without confronting you with many language-specific implementation details: if you can store your data as a number or a string, even in a file, AWK can process it for you. The associative array implemented by AWK is also easy to use and aids in high level development. Most importantly, the time and energy needed to make a working prototype are low. Once you have an AWK prototype, you can then choose to go to another language for performance or other implementation specific concerns, for the prototyping process will make those concerns explicit.
In summary, start with AWK. That will help you understand how to do basic programming, and will give you a start on deciding what more specialized programming you want to do.
Gerhard "Everything Is A String, Right?" Paseman, 2018.08.21.