# variable K cannot be deleted

If a value is assigned to a variable that is named by capital K it cannot be deleted. This effect can be observed directly after start of the program.

Is this a bug?

• This is why new users should avoid using variable names that start with capital letters. In this case, K is a built-in symbol used by internal functions as a dummy variable for integrals/products/sums, e.g. DSolve[{y'[x] == Sin[Sin[x]]}, y, x]. Of course, you can't delete it! Jan 25, 2020 at 22:16
• Additionally: please do not use the bugs tag in the future for new questions, until other people have confirmed that what you have encountered is a bug. Jan 25, 2020 at 22:17
• @granularbastard Capital letters at the beginning of variables aren't forbidden, they're just a bad idea because you might try to use a built-in symbol (which are all capitalized). Jan 25, 2020 at 22:25
• A related thread. Jan 26, 2020 at 11:36
• A hint is that it's black, not blue. @CATrevillian C is used as a dummy variable and it is Protected. Jan 26, 2020 at 16:06

The Wolfram Language currently uses seven single letter capital letters for various core system functions: C, D, E, I, K, N, and O. Mnemonically: OINCKED

The other 19 capital letters are available to use, at least in current versions:

data = {#, Symbol[#], ToExpression[# <> "::usage"]} & /@ CharacterRange["A", "Z"];
Grid[data, Alignment -> Left, Frame -> All, BaseStyle -> "Text"]


Of these seven symbols, K is the only undocumented symbol (in the sense that it does not have a reference page). I would consider that a bug or shortcoming in the documentation.

• Also CODE INK - two small meaningful words. Or maybe KODE INC an imaginary company. May 4, 2020 at 15:42
• Peltio was about to give a... saucy mnemonic here, but thankfully he restrained himself. :) May 5, 2020 at 1:25

K is part of the System context. You were removing symbols from the Global context only, so K wasn't affected. It could be unset with K=..

That said, when doing interactive work, avoid using any symbols whose name starts with a capital letter, as these may conflict with System symbols or package symbols.

Do not set any value for K and do not attempt to Remove it as this will break things. K is used as the summation index when a generic Sum is returned. An example from the documentation of RSolve:

RSolve[a[n + 1] == a[n] + f[n], a[n], n]

(* {{a[n] -> C[1] + Sum[f[K[1]], {K[1], 0, -1 + n}]}} *)


I do not know why K is not Protected. It seems like it would make sense to protect it as people regularly assign to it by accident.

If K is evaluated then click on "description of K" and you get information:

K is a default generic name for a summation index in a symbolic sum.

The bug is that this information is missing in the help.

• To clear K of an assigned value, use K =. Jan 26, 2020 at 1:14