In Japanese, the number 4 and, to a lesser extent, 7, is generally associated with death and considered unlucky because of the pronunciation of the word. 4 is 「四」 which can be pronounced 「し」 "shi", and 7 is 「七」 which can be pronounced 「しち」 "shichi". Death is 「死」 which is pronounced "shi". 9 is 「九」 which can be pronounced 「く」 "ku", meaning suffering or hardship 「苦」. For this reason, it is impolite to give any gift in an increment of 4 or 9 (for example, a set of cups should be given and bought in sets of 5, not 4), and my Japanese grandmother told me not to give in the increment of 7 either since it has the sound of "shi" inside the word.
On the other hand, various things considered positive in Japanese religion and mythology are in a set of 7, such as the Seven Lucky Gods 「七福神」（しちふくじん, "shichifukujin"） and the Seven-Branched Sword 「七支刀」（しちしとう, ななつさやのたち、pronounced as either "shichitou" or "nanatsusayanotachi"）.