fork download
  1. f = [0]
  2. g = [0]
  3. h = [0, 10] + [9 * (10**(n-1)) for n in range(2, 65)]
  4. s = 0
  5. for n in range(1, 65):
  6. x = 0
  7. if n >= 3:
  8. for i in range(1, n - 1):
  9. x += h[i] * f[n-i-1]
  10. g.append(x)
  11. f.append(x + h[n])
  12. s += x
  13. print(h)
  14. print(f)
  15. print(g)
  16. print(s)
  17.  
Success #stdin #stdout 0s 9992KB
stdin
Standard input is empty
stdout
[0, 10, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000, 90000000000, 900000000000, 9000000000000, 90000000000000, 900000000000000, 9000000000000000, 90000000000000000, 900000000000000000, 9000000000000000000, 90000000000000000000, 900000000000000000000, 9000000000000000000000, 90000000000000000000000, 900000000000000000000000, 9000000000000000000000000, 90000000000000000000000000, 900000000000000000000000000, 9000000000000000000000000000, 90000000000000000000000000000, 900000000000000000000000000000, 9000000000000000000000000000000, 90000000000000000000000000000000, 900000000000000000000000000000000, 9000000000000000000000000000000000, 90000000000000000000000000000000000, 900000000000000000000000000000000000, 9000000000000000000000000000000000000, 90000000000000000000000000000000000000, 900000000000000000000000000000000000000, 9000000000000000000000000000000000000000, 90000000000000000000000000000000000000000, 900000000000000000000000000000000000000000, 9000000000000000000000000000000000000000000, 90000000000000000000000000000000000000000000, 900000000000000000000000000000000000000000000, 9000000000000000000000000000000000000000000000, 90000000000000000000000000000000000000000000000, 900000000000000000000000000000000000000000000000, 9000000000000000000000000000000000000000000000000, 90000000000000000000000000000000000000000000000000, 900000000000000000000000000000000000000000000000000, 9000000000000000000000000000000000000000000000000000, 90000000000000000000000000000000000000000000000000000, 900000000000000000000000000000000000000000000000000000, 9000000000000000000000000000000000000000000000000000000, 90000000000000000000000000000000000000000000000000000000, 900000000000000000000000000000000000000000000000000000000, 9000000000000000000000000000000000000000000000000000000000, 90000000000000000000000000000000000000000000000000000000000, 900000000000000000000000000000000000000000000000000000000000, 9000000000000000000000000000000000000000000000000000000000000, 90000000000000000000000000000000000000000000000000000000000000, 900000000000000000000000000000000000000000000000000000000000000, 9000000000000000000000000000000000000000000000000000000000000000]
[0, 10, 90, 1000, 10800, 117100, 1269000, 13753000, 149049000, 1615330000, 17506260000, 189725410000, 2056163400000, 22283825500000, 241502634900000, 2617302970000000, 28365217794000000, 307410181291000000, 3331580961150000000, 36106259246470000000, 391304300263290000000, 4240789785486100000000, 45959878265029200000000, 498093637502520100000000, 5398127259820632000000000, 58502610190581229000000000, 634026438128993409000000000, 6871309210597540060000000000, 74468330385359522400000000000, 807056131578280690510000000000, 8746531527530426728500000000000, 94791193287233478966100000000000, 1027306686831856250040900000000000, 11133513485915593022785000000000000, 120660289794602157938598000000000000, 1307664965936858947113421000000000000, 14171917422455455120292340000000000000, 153589220985977119094671630000000000000, 1664534734424957152678505490000000000000, 18039520379884788166528847800000000000000, 195504658933237682001126816600000000000000, 2118796445786975130149771589100000000000000, 22962615843403280239843695579000000000000000, 248859076302570176879923403515000000000000000, 2697028957001864819896173275049000000000000000, 29229254174610317165362529829850000000000000000, 316774240553096118083787797013840000000000000000, 3433064657707045704292541535686410000000000000000, 37206096440855315052109668028704000000000000000000, 403223868580092646383184217673765700000000000000000, 4369969003632409157310013441667832900000000000000000, 47359867757716464886410879913128946000000000000000000, 513266128927687813973377091371230132000000000000000000, 5562560276817718697024779578426912451000000000000000000, 60284665379876900461117457898850136370000000000000000000, 653339595277669313441688603859058186890000000000000000000, 7080617003807284952057812821794814108090000000000000000000, 76736719337050773650383839677550221586100000000000000000000, 831639967455803892889999638954859775073000000000000000000000, 9012960697890473815883256658106151825510100000000000000000000, 97678639460092269351228724573834613789970000000000000000000000, 1058599601905269392742219815929859058404071000000000000000000000, 11472652806674711882775652838455875203685309000000000000000000000, 124335737691198890061666439298118996482994100000000000000000000000, 1347497908959683325516998723206450126282753380000000000000000000000]
[0, 0, 0, 100, 1800, 27100, 369000, 4753000, 59049000, 715330000, 8506260000, 99725410000, 1156163400000, 13283825500000, 151502634900000, 1717302970000000, 19365217794000000, 217410181291000000, 2431580961150000000, 27106259246470000000, 301304300263290000000, 3340789785486100000000, 36959878265029200000000, 408093637502520100000000, 4498127259820632000000000, 49502610190581229000000000, 544026438128993409000000000, 5971309210597540060000000000, 65468330385359522400000000000, 717056131578280690510000000000, 7846531527530426728500000000000, 85791193287233478966100000000000, 937306686831856250040900000000000, 10233513485915593022785000000000000, 111660289794602157938598000000000000, 1217664965936858947113421000000000000, 13271917422455455120292340000000000000, 144589220985977119094671630000000000000, 1574534734424957152678505490000000000000, 17139520379884788166528847800000000000000, 186504658933237682001126816600000000000000, 2028796445786975130149771589100000000000000, 22062615843403280239843695579000000000000000, 239859076302570176879923403515000000000000000, 2607028957001864819896173275049000000000000000, 28329254174610317165362529829850000000000000000, 307774240553096118083787797013840000000000000000, 3343064657707045704292541535686410000000000000000, 36306096440855315052109668028704000000000000000000, 394223868580092646383184217673765700000000000000000, 4279969003632409157310013441667832900000000000000000, 46459867757716464886410879913128946000000000000000000, 504266128927687813973377091371230132000000000000000000, 5472560276817718697024779578426912451000000000000000000, 59384665379876900461117457898850136370000000000000000000, 644339595277669313441688603859058186890000000000000000000, 6990617003807284952057812821794814108090000000000000000000, 75836719337050773650383839677550221586100000000000000000000, 822639967455803892889999638954859775073000000000000000000000, 8922960697890473815883256658106151825510100000000000000000000, 96778639460092269351228724573834613789970000000000000000000000, 1049599601905269392742219815929859058404071000000000000000000000, 11382652806674711882775652838455875203685309000000000000000000000, 123435737691198890061666439298118996482994100000000000000000000000, 1338497908959683325516998723206450126282753380000000000000000000000]
1474472506836676237371358967075549167865631190000000000000000000000