I agree one shouldn't force mathematical/comp-science forms onto problems which strictly speaking don't require it.
It's not an issue of `requiring' for me.
It's not that the term `cat' is REQUIRED for me get the deep structural meaning of the creature addressed by that surface-structural symbol; when the French say `chat' it's all the same to me.
I'm trying to help others express THE SAME semantics as you may have learned in metaphorical `English' class via alternate languages.
None of this is qua IS `required'; its preferential for/to me.
The problem with completely rejecting those forms, however, is that they prove to be very powerful tools for solving complex problems.
To my mind there's a palpable difference between `completely rejecting' and expressing THE SAME SEMANTICS via a wide variety of alternate notations ... of which programming languages offer such an assortment.
I responded to your use of capital sigma notation not by `completely rejecting'.
To my mind there's a palpable difference between `completely rejecting' and by providing a few clues to how the deep structural MEANING can be exploited via programming languages exploiting various paradigms ... functional as an excellent choice for the decidedly mathy examples you've thus far presented.
Rather than narrowing the universe of discourse as per what's implied by your rhetorical term `completely rejecting' I did -- and presently do -- attempt to broaden said universe of discourse and the assortment of programming languages whose `code' may be presented to all of us in the viewing audience.
I take a lot of pleasure from reducing 400 lines of code to 10 lines by finding some clever mathematical representation of a problem, and it allows me to write concise, robust and efficient solutions.
Sure! Start with a Java program which does math and re-implement it in APL

Aside: In college my APL classmates and I all created a descriptive statistics package in a single line of APL code.
I'll bet a java program implementing the same functionality would take that 400 lines of code you mentioned.
When one at some point faces huge, complex problems, that method becomes the only way to do things.
Response 1:
As I haven't done an exhaustive survey of all possible ways of `doing things', though have an eclectic assortment of familiar ways at my disposal, you'll probably find me sporting an eclectic mix rather than a `one right way' orthodoxical preference.
If you learned `math' either BEFORE or as a co-requisite to your programming/coding activities I can understand that FOR YOU there may be an ONLY WAY with which you are either familiar, comfortable, or both.
Many CS programs in the US of A were either spawned-from or glommed-onto extant math departments ... with predictable results.
MIT did things a bit differently; they glommed their CS department onto the EE department ... with un-head-binding results vis-a-vis the way math weenies do programming.
Math weenies didn't produce
Scheme on a chip; math savvy engineers capable of both electrical engineering AND coding did.
Not that you'd value this as a math-centered or math-favoring coder, but I do.
I also value the pedagogical aspects of programming in that logical thinking can be promoted as a form of personal development by
constructionism.
Math expressions don't function as machines as well as computer-implemented algorithms do; many can LEARN precepts and concepts either BETTER or AT ALL by crafting algorithms via `code' whereas math symbolism leaves them cold, disenchanted, and without a works-for-them means of UNDERSTANDING.
Though I have NO intention to remove math notation from YOUR toolbox, I do intend to present programming tools which others can ADD to their tool boxes.
Thus my goading of you to start with your domain of comfort and confidence and re-express the precepts and concepts you regard as `math' as `algorithms' expressed in `code' as the title of this/your thread suggests.
I presented evidence that I understand the precepts and concepts as expressed in BOTH domains; I was hoping that you might do something similar.
Though we may both obviously wax philosophical -- rather than expressing via `code' -- as the spirit moves us.
Response 2:
Have you heard of
Metalinguistic abstaction?
How about Genetic Algorithms?
There are more than ONE wayS of dealing/coping with complexity and developing/generating complex systems,
If somebody simply loves math I see no reason why they can't present
Maxima code, Octave, gnuplot, or such.
I'd still like to see you demonstrate mathematical induction via `code' in the programming language of your choice.
Or ... how about using recursion in a programming language to demonstrate a recursive proof in mathematics?
By way of a parting code snippet, here's how a generate a sequence of integers in my `text editor' of all things:
Here's how I'd map an arbitrary function onto a thusly obtained sequence:
(mapcar (lambda (x)(list x (log x) (log10 x) (* x x)(* x x x) (expt 2 x))) (number-sequence 1 10))
Oh! Here's Capital Sigma done via my `text editor':
(defun Capital-Sigma (data-points)
"Add up the data points as if a math weenie using Capital Sigma"
(apply '+ data-points)
)
; here's a test case which results in 55
(Capital-Sigma (number-sequence 1 10))
Would you care to morph Capital-Sigma into Capital-Pi by editing a single character, aside from the name, of course ... although without producing a proper factorial function?
To return to induction ...
I'm not sure I could demonstrate mathematical induction through programming though; I'd like to see it done.
Can you humor me?
Cheers!