Monday 9 August 2021

Compositions of 365 and 366

Once the number of days that have elapsed during a calendar year and the number of days that remain are compared, we can look at this as a composition or ordered partition of either 365 during a non-leap year or 366 during a leap year. This composition or ordered partition contains only two elements. Let's consider the compositions of 365 and 366 separately.

Compositions of 365

Because the two elements must add to an odd number, one must be odd and the other even. So there can be no two elements that are both prime. The same applies to lucky numbers that are all odd. Having established that, let's look at some other possibilities.

  • Both elements are semiprimes: there are 32 such compositions e.g. (355, 10) or (10, 355) where 10 = 2 x 5 and 355 = 5 x 73. The full list is:

    [(355, 10), (339, 26), (327, 38), (326, 39), (319, 46), (314, 51), (303, 62), (291, 74), (278, 87), (274, 91), (259, 106), (254, 111), (247, 118), (219, 146), (206, 159), (187, 178), (178, 187), (159, 206), (146, 219), (118, 247), (111, 254), (106, 259), (91, 274), (87, 278), (74, 291), (62, 303), (51, 314), (46, 319), (39, 326), (38, 327), (26, 339), (10, 355)]

    • Both elements are semiprimes with no factors in common: there are 28 such compositions e.g. (339, 26) or (26, 339) where 26 = 2 x 13 and 339 = 3 x 113. The full list is:

    [(339, 26), (327, 38), (326, 39), (319, 46), (314, 51), (303, 62), (291, 74), (278, 87), (274, 91), (259, 106), (254, 111), (247, 118), (206, 159), (187, 178), (178, 187), (159, 206), (118, 247), (111, 254), (106, 259), (91, 274), (87, 278), (74, 291), (62, 303), (51, 314), (46, 319), (39, 326), (38, 327), (26, 339)] 

    • Both elements are semiprimes with one factor in common: there are 4 such compositions e.g. (219, 146) or (146, 219) where 146 = 2 x 73 and 219 = 3 x 73. The full list is:

    [(355, 10), (219, 146), (146, 219), (10, 355)]

    • Both elements are sphenic numbers, meaning that they have three distinct prime factors: there are 4 such compositions e.g. (255, 110) or (110, 255) where 110 = 2 x 5 x 11 and 255 = 3 x 5 x 17. There are none in the gcd or greatest common divisor is 1. The full list is:

    [(255, 110), (195, 170), (170, 195), (110, 255)] 

    • Both elements are NOT square free: there are 44 such compositions e.g. (361, 4) or (4, 361) where 4 = 2 x 2 and 361 = 19 x 19. The full list is:

    [(361, 4), (356, 9), (340, 25), (338, 27), (333, 32), (325, 40), (320, 45), (316, 49), (315, 50), (297, 68), (289, 76), (284, 81), (275, 90), (261, 104), (248, 117), (245, 120), (244, 121), (240, 125), (225, 140), (212, 153), (196, 169), (189, 176), (176, 189), (169, 196), (153, 212), (140, 225), (125, 240), (121, 244), (120, 245), (117, 248), (104, 261), (90, 275), (81, 284), (76, 289), (68, 297), (50, 315), (49, 316), (45, 320), (40, 325), (32, 333), (27, 338), (25, 340), (9, 356), (4, 361)]

    Compositions of 366

    • Both elements are prime: there are 36 such compositions e.g. (359, 7) and (7, 359). The full list is:

    [(359, 7), (353, 13), (349, 17), (347, 19), (337, 29), (313, 53), (307, 59), (293, 73), (283, 83), (277, 89), (269, 97), (263, 103), (257, 109), (239, 127), (229, 137), (227, 139), (199, 167), (193, 173), (173, 193), (167, 199), (139, 227), (137, 229), (127, 239), (109, 257), (103, 263), (97, 269), (89, 277), (83, 283), (73, 293), (59, 307), (53, 313), (29, 337), (19, 347), (17, 349), (13, 353), (7, 359)]

    • Both elements are lucky numbers: the lucky numbers in the range between 1 and 366 are:

    [1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, 69, 73, 75, 79, 87, 93, 99, 105, 111, 115, 127, 129, 133, 135, 141, 151, 159, 163, 169, 171, 189, 193, 195, 201, 205, 211, 219, 223, 231, 235, 237, 241, 259, 261, 267, 273, 283, 285, 289, 297, 303, 307, 319, 321, 327, 331, 339, 349, 357, 361, 363] 

    There are 20 compositions in which both elements are lucky numbers. These are:

    [(363, 3), (357, 9), (303, 63), (297, 69), (273, 93), (267, 99), (261, 105), (237, 129), (231, 135), (195, 171), (171, 195), (135, 231), (129, 237), (105, 261), (99, 267), (93, 273), (69, 297), (63, 303), (9, 357), (3, 363)] 

    A More General Strategy

    Possibly the most useful strategy in this sort of analysis is to list all the numbers between 1 and 366 that have a certain property, such as being lucky (like I just did). A completely general algorithm can then be applied that relies only on the list. Let's consider some happy numbers as an example:

    Happy numbers: there are 57 such numbers in the range between 1 and 366. These are:

    [1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100, 103, 109, 129, 130, 133, 139, 167, 176, 188, 190, 192, 193, 203, 208, 219, 226, 230, 236, 239, 262, 263, 280, 291, 293, 301, 302, 310, 313, 319, 320, 326, 329, 331, 338, 356, 362, 365]

    Here is the general algorithm in SageMath:


    Figure 1: permalink

    Thus we see that there are 6 such pairs in a non-leap year:

    [(262, 103), (236, 129), (226, 139), (139, 226), (129, 236), (103, 262)]

    The algorithm is easily modified to accommodate leap years and in this case we find that there are 14 such pairs:

    [(365, 1), (356, 10), (338, 28), (280, 86), (263, 103), (236, 130), (190, 176), (176, 190), (130, 236), (103, 263), (86, 280), (28, 338), (10, 356), (1, 365)] 

    The list in the algorithm above could be replaced with the list of lucky numbers or any other list and the appropriate pairings could be found. I'll collect these lists together in my online Sage documentation accessible via this link and listed under 365 and 366.

    No comments:

    Post a Comment