Is it acceptable to have the following sentences in formal writing?
2.5 years have already been completed.
n shows the number of something.
Contrary to the other answers, I see no reason not to use the forms shown.
If Abraham Lincoln could say:
... and I can say ...
then you can say:
Some publications use the convention that single digit numbers are written in full ("One") while larger numbers are written as numberals ("100","15,234").
Likewise, a variable is effectively a noun, and can be used to begin a sentence.
There is a problem here with capitalisation. Do you capitalise the i to comply with normal English writing conventions? Do you leave the i lower case, because the upper case version would not work in your case-sensitive programming language?
That's a matter of house style. I would personally not capitalise it. Avoiding the issue by always phrasing the sentence differently is a valid strategy.
It is generally not recommended in formal prose, because it makes it harder to see where a new sentence begins, as dots are also used for abbreviations. In a technical manual or academic article, I would try to avoid it as well. A new line may provide extenuating circumstances for numbers, though probably not for variables.
No it is not.
In 4th grade I was taking exam to be accepted in Math High School (one of top 3 in our country). I had to solve some sort of a puzzle problem - deduce what numbers correspond to letters in an equation. It was some sort of a rebus.
My proof was immaculate, but they deducted half of the marks for something like:
They had read it as 7 times 6.
The alignments and the formats of different types of formal texts have its own rules with the general purpose of allowing the people concerned to read it and to understand it better. So it is not a good idea.