# Prime Factorizations of [OEIS A019520](https://oeis.org/A019520)

# Original file is located at
#    https://colab.research.google.com/drive/1DID8Lef5jb4UW5mtP9c4abmf_XQV2Sgl


# **Apurva Rai and Michael S. Branicky, 2020-08-15**

# Below are the prime factorizations of [OEIS A019520](https://oeis.org/A019520)
# necessary for the computation of [OEIS A108728](https://oeis.org/A108728).

prime_factors = {
     1: [2],
     2: [2, 2, 2, 3],
     3: [2, 3, 41],
     4: [2, 2, 617],
     5: [2, 3, 5, 19, 433],
     6: [2, 2, 3, 2056751],
     7: [2, 1234050607],
     8: [2, 2, 2, 3, 3, 3, 3, 3, 126959939],
     9: [2, 3, 3, 7, 227, 3803, 226903],
    10: [2, 2, 5, 17, 2474861, 2933143],
    11: [2, 3, 41135020236030337],
    12: [2, 2, 2, 2, 3, 1039, 494887153946467],
    13: [2, 7, 383, 48679, 566557, 16689791],
    14: [2, 2, 3, 7, 2938215731145024074317],
    15: [2, 3, 5, 17, 48394141454153337694633],
    16: [2, 2, 2, 44029, 6971542679, 1005090727769],
    17: [2, 3, 3, 13711673412010112346812683513],
    18: [2, 2, 3, 3, 3, 211, 1665581, 650265925024988402887],
    19: [2, 467, 184995821, 14284142414645031952717],
    20: [2, 2, 2, 2, 2, 2, 3, 5, 203213, 2185949, 9191671, 62965948366327],
    21: [2, 3, 29, 9241, 484971588768649, 31650345135231187],
    22: [2, 2, 13, 2017, 1283322769, 18336558322268121052388489],
    23: [2, 3, 113, 229, 6395743, 74115799, 132439777, 25320807387097],
    24: [2, 2, 2, 3, 1028375505900758426010951263476516001768527],
    25: [2, 5, 5, 131, 401, 9511, 14470038907, 6827809767308778708556231],
    26: [2, 2, 3, 3, 43, 159438062930350143567589343174653643685042949],
    27: [2, 3, 3, 330389669, 4150151986746931952891264137263388025887],
    28: [2, 2, 2, 2, 103, 439, 971, 1049, 1164253, 8726357, 329659942129451044185206347],
    29: [2, 3, 389437, 227608967262503610541, 464071754426231677533489079],
    30: [2, 2, 3, 5, 7, 139, 47333759250140768579, 8931571463994896046389460802993],
    31: [2, 3091607, 748108122049, 533561295359386628817517158521160304817],
    32: [2, 2, 2, 3, 3019, 3406344835709699986786854135397535613675147469533864119],
    33: [2, 3, 37, 2297, 6761, 33113, 16193602573, 13350454606780485525429563632359873491],
    34: [2, 2, 7, 7, 47, 1095120885328338552384247, 244650988475087476420999196012408587],
    35: [2, 3, 3, 3, 5, 7, 6779587, 696802095071975393642417, 27643210155604890385875838979977],
    36: [2, 2, 2, 2, 2, 3, 3, 691, 2743526957773332427, 31337214622000050151, 1442523200045779492444717],
    37: [2, 40277, 1668319517, 18365240692893858649403090768937303700766985836896541893],
    38: [2, 2, 3, 13, 829, 41491, 176897839, 20784228229, 12510466501756498981097762636732565929352119],
    39: [2, 3, 13, 101, 14591, 42677, 54832708338566621, 91754706728308613045921109938276626832109083],
    40: [2, 2, 2, 5, 281, 877, 55217, 642140377984397, 7061456278262350528177682543876904441734533751869],
    41: [2, 3, 1019221488778870445059, 35176871606857759997, 1147323608390023969728727870757662789],
    42: [2, 2, 3, 2056751011801516852021902526953032003537054042104547155052205557256062306567357],
    43: [2, 463, 57719, 2354497, 2583241, 328647112608896294292605401, 23101506033017122786485815715763547],
    44: [2, 2, 2, 2, 3, 3, 150044639317360191712013, 11422995078658292718230397044677429017135144725263574570479],
    45: [2, 3, 3, 3, 3, 5, 34802819279261814470267, 72899446123891843830961, 12009897248857905290150046059315978987],
    46: [2, 2, 181, 457, 1997, 6084319, 29123317, 129602839, 1268613839, 145950132853354759, 878473907873616330132087727541],
    47: [2, 3, 41, 97, 167, 547, 1277, 57881, 1293604799, 2288212596639464507, 517520328382577062091683378027826822099038393],
    48: [2, 2, 2, 3, 1667, 360410359571919257581972730905502467, 1711665346935517789543485234873966097540567873802161],
    49: [2, 388970761807, 5761322917001, 550673014801254399580287521976914967158042776402057551047359015075607],
    50: [2, 2, 3, 5, 5, 101, 15269, 14612050169, 4763433787477, 13129514346071993, 2518451989502532570001, 2317907583860370838981933987],
    51: [2, 3, 7, 254927, 32657957, 7058441622732085577903747508882695212017009918673796131967401565926918023432621662629],
    52: [2, 2, 2, 11, 137, 72797, 2812200260757549135927292655638621804652801045935913990434579912096953560236746749538702931997],
    53: [2, 3, 3, 10099, 35412084105363239, 10033794252869183, 38211616459071852548827339317921237935633964640136878190856061375159],
    54: [2, 2, 3, 3, 19, 1720723523, 2096987145344972293655929742939059282184119270506102768733054458560057609024202654066459532529119],
    55: [2, 5, 8107824316558841841152505742169, 2293002201631598932308921222796303, 13275600178871158523791564330652977645792286173],
    56: [2, 2, 2, 2, 2, 3, 10104367610808686596000929847295789301951495888821431183010334949411661, 2544383640596915268509219339662771224233327],
    57: [2, 3, 11, 546349, 652117, 5199748987, 86005477824479, 149877698791342575163319804505259, 1565949841957047165524224073850417348639259011359],
    58: [2, 2, 5087933, 7807628027, 15532539841002321733229701694053396009246942197264269372443633022862930376325090143342355285466523801919],
    59: [2, 3, 13, 7607, 21977, 53111184097, 368492627133133, 9671008204400247096902978939701610166393425982153887342645833841981279442258723457964879],
    60: [2, 2, 2, 3, 5, 7, 7, 199, 3049, 2178262601, 267937088814158682711704955448961, 1185310330251275042366421587623902221863908252133727393999509966072596513509],
    61: [2, 43, 88807, 152377, 287686082237, 7371893359705224454601100719815536511475197998294586692028666318389561640177977801184378551037861186019789], 
    62: [2, 2, 3, 3, 61, 2256342666405362606143497344992777, 498110359501673777604065721050611895327543403301329041781781585015395117709569047992396609767247],
    63: [2, 3, 3, 3, 3, 3, 19, 59, 24547, 19408661, 69488758416047, 136839832733407196463255052204255371454126657732111640366225669150731332953948981613519984214156651226629],
    64: [2, 2, 2, 2, 421, 2909393, 125938494575660218383222622387345315276638058773372509940914111853422533128147741183554573202936509536049040887049791484292691311],
    65: [2, 3, 5, 7, 29, 617, 95737, 401861, 165580670595683003835023, 65027533506601157, 4591429985404970071057, 345342436831303659815178305079114464898479952378047255650240939],
    66: [2, 2, 3, 2263470489551, 4012060641338747788857561961, 22648497399321607759541970581655207356410031020068966616239809817221257683995474984706411635938270828001],
    67: [2, 34702777066591261, 179935669606470928216571, 197629365041712726682812557729178516005996457235787040922190805249844223013757120789604403315037409269163357],
    68: [2, 2, 2, 3, 37, 3449, 651152244719, 106415912246653677581, 4214443310286203460015472480971747033775220872500472045160251611662086843079, 2759481423146094922817643382747529813],
    69: [2, 3, 29, 15733, 4822423, 13566058439, 7496520255181, 827525949957397, 803883008573381467005327713393724413, 2763433383479035161354681234338316851918544054945891280488020766707]
}

# CODE TO VERIFY RESULTS

A108728 = [	1, 2, 3, 2, 5, 3, 2, 3, 6, 5, 3, 4, 6, 4, 5, 4, 3, 5, 4, 7, 6, 5, 8, 3, 7, 4, 4, 8, 5, 7, 4, 4, 8, 5, 7, 6, 4, 8, 8, 7, 5, 3, 7, 4, 6, 10, 11, 5, 4, 10, 6, 5, 6, 5]

# a(55)-a(69) added by _Apurva Rai_ and _Michael S. Branicky_, Aug 16 2020
#           55 56 57 58 59 60 61 62 63 64  65 66 67 68  69
A108728 += [ 5, 4, 9, 4, 8, 9, 6, 5, 8, 4, 12, 5, 4, 8, 10]


import sympy

def concatevens(i):
    return int("".join(map(str,range(2,2*i+1,2))))

def multiply(numbers):
    result = 1
    for n in numbers:
        result *= n
    return result

print(" i  a(i)  ==A108728?  allprime?  product==A019520(i)?  A019520(i)")
for i in sorted(prime_factors):
    facts = prime_factors[i]
    bign = multiply(facts)
    allprimes = all(sympy.ntheory.primetest.isprime(p) for p in facts)
    distinct = len(set(facts))
    print("%2s  %4s  %10s  %9s  %20s  %d" % (i, distinct, distinct==A108728[i-1], allprimes, bign==concatevens(i), bign))

# RESULTING EDITS TO OEIS A108728: https://oeis.org/A108728

# DATA
# , 5, 4, 9, 4, 8, 9, 6, 5, 8, 4, 12, 5, 4, 8, 10

# LINKS
# Apurva Rai and Michael S. Branicky, <a href="https://colab.research.google.com/drive/1DID8Lef5jb4UW5mtP9c4abmf_XQV2Sgl">Prime Factorizations of OEIS A019520</a>

# EXTENSIONS
# a(55)-a(69) added by _Apurva Rai_ and _Michael S. Branicky_, Aug 16 2020