I don't think "ko is informal" is entirely true. Based on my few years in Japan, plus just now looking up "ko" dictionary to look for any nuance I've missed, it seems like "ko" is fine even in formal contexts, especially if it's used for (semi) mathematical purposes.
If I search Google for "リンゴ1つ" (one apple) it automatically matches it with pages that use "リンゴ1個". Also, the latter is much more common than the former looking at the first 10 results, and the latter appears in otherwise formal-sounding phrases like "りんご1個は、中くらいのサイズで300g前後なので、1個あたりのカロリーは、約183kcalとなります。"
If I search Google for "リンゴ1つ" (one apple) it automatically matches it with pages that use "リンゴ1個". Also, the latter is much more common than the former looking at the first 10 results, and the latter appears in otherwise formal-sounding phrases like "りんご1個は、中くらいのサイズで300g前後なので、1個あたりのカロリーは、約183kcalとなります。"