what's the point of "n" in "vout"? getrawtransaction It seems like "n" is the index, is that true? If that is the case, why is the "n" key necessary?

Example:

bitcoin-cli getrawtransaction b13b4765e46228f3239858c9f18e766b72bed24a56c52b9692e7f021c376e7ce 1


One of the resulting vouts:

  "vout": [
    {
      "value": 0.40000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_HASH160 a88433dd5e9fcee779efdea952e397cf3bfe8aac OP_EQUAL",
        "hex": "a914a88433dd5e9fcee779efdea952e397cf3bfe8aac87",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "3H43pNLbFEU1tWNwZeWxmrLwrLzAxwiC4b"
        ]
      }
    },
...


Since it's an array, couldn't you just use the array index? Seems redundant, but i'm sure there's a reason. Thanks
The vout index (n) that you see after calling decoderawtransaction is added by bitcoind. It is not present in the raw transaction data.

If you manually decode the serialized tx for your example, you get this for the output section:

02  # Number of outputs
# value lockscript_length lockscript
005a620200000000 17 a914a88433dd5e9fcee779efdea952e397cf3bfe8aac87 
# value lockscript_length lockscript
c587841500000000 19 76a91402952d768c840f30a49e20af5bd4219210a14d2488ac


Notice how there is no index field. It is simply calculated by the node when deserializing the transaction.