Non trivial powers Revisted

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

In this task you would be given an integer N you have to output all non-trivial power representation of the integer.

Non-trivial power means the base and exponent are > 1

The input N is given in a single line,the inputs are terminated by EOF.--Deb

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

4
8
9
16
25
27
32
49
64
81
121
125
128
169
243
256
289
343
361
512
529
625
729
841
961
1024
1331
1369
1681
1849
2048
2187
2197
2209
2401
2809
3125
3481
3721
4096
4489
4913
5041
5329
6241
6561
6859
6889
7921
8192
9409
10201
10609
11449
11881
12167
12769
14641
15625
16129
16384
16807
17161
18769
19321
19683
22201
22801
24389
24649
26569
27889
28561
29791
29929
32041
32761
32768
36481
37249
38809
39601
44521
49729
50653
51529
52441
54289
57121
58081
59049
63001
65536
66049
68921
69169
72361
73441
76729
78125
78961
79507
80089
83521
85849
94249
96721
97969
100489
103823
109561
113569
117649
120409
121801
124609
128881
130321
131072
134689
139129
143641
146689
148877
151321
157609
160801
161051
167281
175561
177147
177241
185761
187489
192721
196249
201601
205379
208849
212521
214369
218089
226981
229441
237169
241081
249001
253009
259081
262144
271441
273529
279841
292681
299209
300763
310249
316969
323761
326041
332929
344569
351649
357911
358801
361201
368449
371293
375769
380689
383161
389017
390625
398161
410881
413449
418609
426409
434281
436921
452929
458329
466489
477481
491401
493039
502681
516961
524288
528529
531441
537289
546121
552049
564001
571787
573049
579121
591361
597529
619369
635209
654481
657721
674041
677329
683929
687241
703921
704969
707281
727609
734449
737881
744769
769129
776161
779689
786769
822649
823543
829921
844561
863041
877969
885481
896809
908209
912673
923521
935089
942841
954529
966289
982081
994009
1018081
1026169
1030301
1038361
1042441
1048576
1062961
1067089
1079521
1092727
1100401
1104601
1125721
1129969
1142761
1181569
1190281
1194649
1203409
1216609
1225043
1229881
1247689
1261129
1274641
1295029
1324801
1329409
1352569
1371241
1394761
1408969
1419857
1423249
1442401
1442897
1471369
1481089
1495729
1510441
1515361
1530169
1560001
1585081
1594323
1630729
1635841
1646089
1661521
1666681
1682209
1692601
1697809
1708249
1739761
1745041
1760929
1771561
1852321
1868689
1874161
1885129
1907161
1953125
1957201
1985281
2024929
2036329
2042041
2048383
2053489
2070721
2093809
2097152
2105401
2111209
2128681
2163841
2193361
2199289
2211169
2217121
2229049
2247001
2248091
2283121
2319529
2343961
2380849
2399401
2411809
2430481
2455489
2468041
2476099
2493241
2505889
2550409
2563201
2571353
2582449
2588881
2601769
2621161
2627641
2647129
2679769
2685619
2745649
2765569
2778889
2785561
2825761
2866249
2879809
2886601
2920681
2961841
2968729
3003289
3031081
3052009
3073009
3094081
3157729
3179089
3193369
3200521
3243601
3279721
3307949
3323329
3352561

Sample output:

4 = 2^2
8 = 2^3
9 = 3^2
16 = 4^2 2^4
25 = 5^2
27 = 3^3
32 = 2^5
49 = 7^2
64 = 8^2 4^3 2^6
81 = 9^2 3^4
121 = 11^2
125 = 5^3
128 = 2^7
169 = 13^2
243 = 3^5
256 = 16^2 4^4 2^8
289 = 17^2
343 = 7^3
361 = 19^2
512 = 8^3 2^9
529 = 23^2
625 = 25^2 5^4
729 = 27^2 9^3 3^6
841 = 29^2
961 = 31^2
1024 = 32^2 4^5 2^10
1331 = 11^3
1369 = 37^2
1681 = 41^2
1849 = 43^2
2048 = 2^11
2187 = 3^7
2197 = 13^3
2209 = 47^2
2401 = 49^2 7^4
2809 = 53^2
3125 = 5^5
3481 = 59^2
3721 = 61^2
4096 = 64^2 16^3 8^4 4^6 2^12
4489 = 67^2
4913 = 17^3
5041 = 71^2
5329 = 73^2
6241 = 79^2
6561 = 81^2 9^4 3^8
6859 = 19^3
6889 = 83^2
7921 = 89^2
8192 = 2^13
9409 = 97^2
10201 = 101^2
10609 = 103^2
11449 = 107^2
11881 = 109^2
12167 = 23^3
12769 = 113^2
14641 = 121^2 11^4
15625 = 125^2 25^3 5^6
16129 = 127^2
16384 = 128^2 4^7 2^14
16807 = 7^5
17161 = 131^2
18769 = 137^2
19321 = 139^2
19683 = 27^3 3^9
22201 = 149^2
22801 = 151^2
24389 = 29^3
24649 = 157^2
26569 = 163^2
27889 = 167^2
28561 = 169^2 13^4
29791 = 31^3
29929 = 173^2
32041 = 179^2
32761 = 181^2
32768 = 32^3 8^5 2^15
36481 = 191^2
37249 = 193^2
38809 = 197^2
39601 = 199^2
44521 = 211^2
49729 = 223^2
50653 = 37^3
51529 = 227^2
52441 = 229^2
54289 = 233^2
57121 = 239^2
58081 = 241^2
59049 = 243^2 9^5 3^10
63001 = 251^2
65536 = 256^2 16^4 4^8 2^16
66049 = 257^2
68921 = 41^3
69169 = 263^2
72361 = 269^2
73441 = 271^2
76729 = 277^2
78125 = 5^7
78961 = 281^2
79507 = 43^3
80089 = 283^2
83521 = 289^2 17^4
85849 = 293^2
94249 = 307^2
96721 = 311^2
97969 = 313^2
100489 = 317^2
103823 = 47^3
109561 = 331^2
113569 = 337^2
117649 = 343^2 49^3 7^6
120409 = 347^2
121801 = 349^2
124609 = 353^2
128881 = 359^2
130321 = 361^2 19^4
131072 = 2^17
134689 = 367^2
139129 = 373^2
143641 = 379^2
146689 = 383^2
148877 = 53^3
151321 = 389^2
157609 = 397^2
160801 = 401^2
161051 = 11^5
167281 = 409^2
175561 = 419^2
177147 = 3^11
177241 = 421^2
185761 = 431^2
187489 = 433^2
192721 = 439^2
196249 = 443^2
201601 = 449^2
205379 = 59^3
208849 = 457^2
212521 = 461^2
214369 = 463^2
218089 = 467^2
226981 = 61^3
229441 = 479^2
237169 = 487^2
241081 = 491^2
249001 = 499^2
253009 = 503^2
259081 = 509^2
262144 = 512^2 64^3 8^6 4^9 2^18
271441 = 521^2
273529 = 523^2
279841 = 529^2 23^4
292681 = 541^2
299209 = 547^2
300763 = 67^3
310249 = 557^2
316969 = 563^2
323761 = 569^2
326041 = 571^2
332929 = 577^2
344569 = 587^2
351649 = 593^2
357911 = 71^3
358801 = 599^2
361201 = 601^2
368449 = 607^2
371293 = 13^5
375769 = 613^2
380689 = 617^2
383161 = 619^2
389017 = 73^3
390625 = 625^2 25^4 5^8
398161 = 631^2
410881 = 641^2
413449 = 643^2
418609 = 647^2
426409 = 653^2
434281 = 659^2
436921 = 661^2
452929 = 673^2
458329 = 677^2
466489 = 683^2
477481 = 691^2
491401 = 701^2
493039 = 79^3
502681 = 709^2
516961 = 719^2
524288 = 2^19
528529 = 727^2
531441 = 729^2 81^3 27^4 9^6 3^12
537289 = 733^2
546121 = 739^2
552049 = 743^2
564001 = 751^2
571787 = 83^3
573049 = 757^2
579121 = 761^2
591361 = 769^2
597529 = 773^2
619369 = 787^2
635209 = 797^2
654481 = 809^2
657721 = 811^2
674041 = 821^2
677329 = 823^2
683929 = 827^2
687241 = 829^2
703921 = 839^2
704969 = 89^3
707281 = 841^2 29^4
727609 = 853^2
734449 = 857^2
737881 = 859^2
744769 = 863^2
769129 = 877^2
776161 = 881^2
779689 = 883^2
786769 = 887^2
822649 = 907^2
823543 = 7^7
829921 = 911^2
844561 = 919^2
863041 = 929^2
877969 = 937^2
885481 = 941^2
896809 = 947^2
908209 = 953^2
912673 = 97^3
923521 = 961^2 31^4
935089 = 967^2
942841 = 971^2
954529 = 977^2
966289 = 983^2
982081 = 991^2
994009 = 997^2
1018081 = 1009^2
1026169 = 1013^2
1030301 = 101^3
1038361 = 1019^2
1042441 = 1021^2
1048576 = 1024^2 32^4 16^5 4^10 2^20
1062961 = 1031^2
1067089 = 1033^2
1079521 = 1039^2
1092727 = 103^3
1100401 = 1049^2
1104601 = 1051^2
1125721 = 1061^2
1129969 = 1063^2
1142761 = 1069^2
1181569 = 1087^2
1190281 = 1091^2
1194649 = 1093^2
1203409 = 1097^2
1216609 = 1103^2
1225043 = 107^3
1229881 = 1109^2
1247689 = 1117^2
1261129 = 1123^2
1274641 = 1129^2
1295029 = 109^3
1324801 = 1151^2
1329409 = 1153^2
1352569 = 1163^2
1371241 = 1171^2
1394761 = 1181^2
1408969 = 1187^2
1419857 = 17^5
1423249 = 1193^2
1442401 = 1201^2
1442897 = 113^3
1471369 = 1213^2
1481089 = 1217^2
1495729 = 1223^2
1510441 = 1229^2
1515361 = 1231^2
1530169 = 1237^2
1560001 = 1249^2
1585081 = 1259^2
1594323 = 3^13
1630729 = 1277^2
1635841 = 1279^2
1646089 = 1283^2
1661521 = 1289^2
1666681 = 1291^2
1682209 = 1297^2
1692601 = 1301^2
1697809 = 1303^2
1708249 = 1307^2
1739761 = 1319^2
1745041 = 1321^2
1760929 = 1327^2
1771561 = 1331^2 121^3 11^6
1852321 = 1361^2
1868689 = 1367^2
1874161 = 1369^2 37^4
1885129 = 1373^2
1907161 = 1381^2
1953125 = 125^3 5^9
1957201 = 1399^2
1985281 = 1409^2
2024929 = 1423^2
2036329 = 1427^2
2042041 = 1429^2
2048383 = 127^3
2053489 = 1433^2
2070721 = 1439^2
2093809 = 1447^2
2097152 = 128^3 8^7 2^21
2105401 = 1451^2
2111209 = 1453^2
2128681 = 1459^2
2163841 = 1471^2
2193361 = 1481^2
2199289 = 1483^2
2211169 = 1487^2
2217121 = 1489^2
2229049 = 1493^2
2247001 = 1499^2
2248091 = 131^3
2283121 = 1511^2
2319529 = 1523^2
2343961 = 1531^2
2380849 = 1543^2
2399401 = 1549^2
2411809 = 1553^2
2430481 = 1559^2
2455489 = 1567^2
2468041 = 1571^2
2476099 = 19^5
2493241 = 1579^2
2505889 = 1583^2
2550409 = 1597^2
2563201 = 1601^2
2571353 = 137^3
2582449 = 1607^2
2588881 = 1609^2
2601769 = 1613^2
2621161 = 1619^2
2627641 = 1621^2
2647129 = 1627^2
2679769 = 1637^2
2685619 = 139^3
2745649 = 1657^2
2765569 = 1663^2
2778889 = 1667^2
2785561 = 1669^2
2825761 = 1681^2 41^4
2866249 = 1693^2
2879809 = 1697^2
2886601 = 1699^2
2920681 = 1709^2
2961841 = 1721^2
2968729 = 1723^2
3003289 = 1733^2
3031081 = 1741^2
3052009 = 1747^2
3073009 = 1753^2
3094081 = 1759^2
3157729 = 1777^2
3179089 = 1783^2
3193369 = 1787^2
3200521 = 1789^2
3243601 = 1801^2
3279721 = 1811^2
3307949 = 149^3
3323329 = 1823^2
3352561 = 1831^2

Sample input:_

113795717542678488615120001
113795717546049421004105281

Sample output:

113795717542678488615120001 = 10667507560001^2
113795717546049421004105281 = 10667507560159^2

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1kaki910.11652011/04/10 08:40:100B / 37B / 49B

Perl _

RankUserSizeTimeDateStatistics
1tybalt89720.02482011/04/05 13:34:510B / ?B / ?B
2teebee630.37152012/12/23 02:01:070B / 15B / 44B
3teebee(tybalt89)660.03852012/12/22 21:04:570B / 19B / 43B

Python _

RankUserSizeTimeDateStatistics
1hallvabo1411.41612011/04/09 02:47:230B / 80B / 51B
2recursive1070.86732011/04/12 04:52:210B / 57B / 47B

Scheme _

RankUserSizeTimeDateStatistics
1youz1290.24652011/04/10 12:28:310B / 61B / 59B
2kaki1310.18072011/04/09 16:31:060B / 66B / 53B
3dico_leque1390.17722011/04/09 20:49:040B / 64B / 63B
4kaki(youz)1270.14512013/03/25 06:55:050B / 57B / 63B

Common LISP _

RankUserSizeTimeDateStatistics
1youz1081.34812011/04/04 12:42:460B / 57B / 45B
2kozima1090.73382011/04/04 08:55:480B / 52B / 48B

JavaScript _

RankUserSizeTimeDateStatistics
1nn1400.78322011/04/10 21:10:350B / 67B / 71B

J _

RankUserSizeTimeDateStatistics
1I., S.820.10132011/05/10 22:40:060B / 23B / 59B

C _

RankUserSizeTimeDateStatistics
1nn2100.02282011/04/10 21:31:410B / 106B / 100B

OCaml _

RankUserSizeTimeDateStatistics
1m.ukai1840.11072011/04/05 11:18:130B / 103B / 70B

Haskell _

RankUserSizeTimeDateStatistics
1sjoerd_visscher1250.15452011/04/10 20:10:320B / 65B / 49B
2notogawa1250.05352011/04/10 20:14:510B / 68B / 51B
3sjoerd_visscher1220.15642011/04/11 03:39:530B / 65B / 45B

Pascal _

RankUserSizeTimeDateStatistics
1*yuko*2540.00952011/04/08 00:15:491B / 174B / 55B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*1980.02322011/04/07 22:59:420B / 116B / 76B
2*yuko*1970.02592011/12/03 00:48:000B / 112B / 77B

goruby _

RankUserSizeTimeDateStatistics
1kaki770.21632011/04/10 08:55:390B / 23B / 51B
2murky-satyr720.21042011/04/11 18:15:490B / 25B / 44B

Language Ranking_

RankLangUserSizeScore
1Perlteebee6310000
2gorubymurky-satyr728750
3JI., S.827682
4Rubykaki916923
5Pythonrecursive1075887
6Common LISPyouz1085833
7Haskellsjoerd_visscher1225163
8Schemekaki(youz)1274960
9JavaScriptnn1404500
10OCamlm.ukai1843423
11Fortran*yuko*1973197
12Cnn2103000
13Pascal*yuko*2542480

return top