Попробуйте следующим образом:
HashMap<String, Integer> hashMap = new HashMap(); for (int i=1; i<=3; i++) { hashMap.put("n" + i, 5); }