Jump to content

Matemātika piektdienai


vvv
 Share

Recommended Posts

5min excelī

723654189
723654189 2 36
723654189 3 241
723654189 4 1809
723654189 5 14473
723654189 6 120609
723654189 7 1033792
723654189 8 9045677
723654189 9 80406021
  • Patīk 1
Link to comment
Share on other sites

pirms 3 stundām , vvv teica:

Uzdevums. Sen, sen nav bijis.

Deviņciparu skaitlis.

Divi pirmie skaitļa cipari (no kreisās) veido skaitli, kurš dalās ar 2

Trīs pirmie skaitļa cipari (no kreisās) veido skaitli, kurš dalās ar 3

Četri pirmie skaitļa cipari (no kreisās) veido skaitli, kurš dalās ar 4

Pieci pirmie skaitļa cipari (no kreisās) veido skaitli, kurš dalās ar 5

Seši pirmie skaitļa cipari (no kreisās) veido skaitli, kurš dalās ar 6

Septiņi pirmie skaitļa cipari (no kreisās) veido skaitli, kurš dalās ar 7

Astoņi pirmie skaitļa cipari (no kreisās) veido skaitli, kurš dalās ar 8

Visi deviņi skaitļa cipari veido skaitli, kurš dalās ar 9, jeb pats dotais deviņciparu skaitlis dalās ar 9

Atrast skaitli.

Skaitlī nav nulles, neviens cipars skaitlī neatkārtojas.

 

381654729

  • Patīk 1
Link to comment
Share on other sites

Par cik atbildi jau kāds iemeta, tad varu pateikt, ka spēli sauc American Billions. Varat googlei paprasīt - izmetīs dažādus variantus kā risināt.

Godīgi atzīšos, ka pats neatrisināju - vienkārši zināju par spēli.

Edited by ruukjis
  • Patīk 1
Link to comment
Share on other sites

Pirms 54 minūtēm , ju teica:

5min excelī

Excelis noapaļoja

Vai ir šim uzdevumam kāds risinājums «uz papīra lapiņas»? Kad pie rezultāta nonāk pamazām izsecinot, kur katram ciparam jāatrodas?

Link to comment
Share on other sites

def find_multiples(numbers, divider):
    results = []
    print("--------------------------")
    print("div = " + str(divider))
    for num in numbers:
        for i in range (1, 10):
            test_num = (num * 10) + i
            if test_num % divider == 0:
                results.append(test_num)

    return results


numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]

for i in range(2, 10):
    numbers = find_multiples(numbers, i)
    print(numbers)

 

Spoiler

--------------------------
div = 2
[12, 14, 16, 18, 22, 24, 26, 28, 32, 34, 36, 38, 42, 44, 46, 48, 52, 54, 56, 58, 62, 64, 66, 68, 72, 74, 76, 78, 82, 84, 86, 88, 92, 94, 96, 98]
--------------------------
div = 3
[123, 126, 129, 141, 144, 147, 162, 165, 168, 183, 186, 189, 222, 225, 228, 243, 246, 249, 261, 264, 267, 282, 285, 288, 321, 324, 327, 342, 345, 348, 363, 366, 369, 381, 384, 387, 423, 426, 429, 441, 444, 447, 462, 465, 468, 483, 486, 489, 522, 525, 528, 543, 546, 549, 561, 564, 567, 582, 585, 588, 621, 624, 627, 642, 645, 648, 663, 666, 669, 681, 684, 687, 723, 726, 729, 741, 744, 747, 762, 765, 768, 783, 786, 789, 822, 825, 828, 843, 846, 849, 861, 864, 867, 882, 885, 888, 921, 924, 927, 942, 945, 948, 963, 966, 969, 981, 984, 987]
--------------------------
div = 4
[1232, 1236, 1264, 1268, 1292, 1296, 1412, 1416, 1444, 1448, 1472, 1476, 1624, 1628, 1652, 1656, 1684, 1688, 1832, 1836, 1864, 1868, 1892, 1896, 2224, 2228, 2252, 2256, 2284, 2288, 2432, 2436, 2464, 2468, 2492, 2496, 2612, 2616, 2644, 2648, 2672, 2676, 2824, 2828, 2852, 2856, 2884, 2888, 3212, 3216, 3244, 3248, 3272, 3276, 3424, 3428, 3452, 3456, 3484, 3488, 3632, 3636, 3664, 3668, 3692, 3696, 3812, 3816, 3844, 3848, 3872, 3876, 4232, 4236, 4264, 4268, 4292, 4296, 4412, 4416, 4444, 4448, 4472, 4476, 4624, 4628, 4652, 4656, 4684, 4688, 4832, 4836, 4864, 4868, 4892, 4896, 5224, 5228, 5252, 5256, 5284, 5288, 5432, 5436, 5464, 5468, 5492, 5496, 5612, 5616, 5644, 5648, 5672, 5676, 5824, 5828, 5852, 5856, 5884, 5888, 6212, 6216, 6244, 6248, 6272, 6276, 6424, 6428, 6452, 6456, 6484, 6488, 6632, 6636, 6664, 6668, 6692, 6696, 6812, 6816, 6844, 6848, 6872, 6876, 7232, 7236, 7264, 7268, 7292, 7296, 7412, 7416, 7444, 7448, 7472, 7476, 7624, 7628, 7652, 7656, 7684, 7688, 7832, 7836, 7864, 7868, 7892, 7896, 8224, 8228, 8252, 8256, 8284, 8288, 8432, 8436, 8464, 8468, 8492, 8496, 8612, 8616, 8644, 8648, 8672, 8676, 8824, 8828, 8852, 8856, 8884, 8888, 9212, 9216, 9244, 9248, 9272, 9276, 9424, 9428, 9452, 9456, 9484, 9488, 9632, 9636, 9664, 9668, 9692, 9696, 9812, 9816, 9844, 9848, 9872, 9876]
--------------------------
div = 5
[12325, 12365, 12645, 12685, 12925, 12965, 14125, 14165, 14445, 14485, 14725, 14765, 16245, 16285, 16525, 16565, 16845, 16885, 18325, 18365, 18645, 18685, 18925, 18965, 22245, 22285, 22525, 22565, 22845, 22885, 24325, 24365, 24645, 24685, 24925, 24965, 26125, 26165, 26445, 26485, 26725, 26765, 28245, 28285, 28525, 28565, 28845, 28885, 32125, 32165, 32445, 32485, 32725, 32765, 34245, 34285, 34525, 34565, 34845, 34885, 36325, 36365, 36645, 36685, 36925, 36965, 38125, 38165, 38445, 38485, 38725, 38765, 42325, 42365, 42645, 42685, 42925, 42965, 44125, 44165, 44445, 44485, 44725, 44765, 46245, 46285, 46525, 46565, 46845, 46885, 48325, 48365, 48645, 48685, 48925, 48965, 52245, 52285, 52525, 52565, 52845, 52885, 54325, 54365, 54645, 54685, 54925, 54965, 56125, 56165, 56445, 56485, 56725, 56765, 58245, 58285, 58525, 58565, 58845, 58885, 62125, 62165, 62445, 62485, 62725, 62765, 64245, 64285, 64525, 64565, 64845, 64885, 66325, 66365, 66645, 66685, 66925, 66965, 68125, 68165, 68445, 68485, 68725, 68765, 72325, 72365, 72645, 72685, 72925, 72965, 74125, 74165, 74445, 74485, 74725, 74765, 76245, 76285, 76525, 76565, 76845, 76885, 78325, 78365, 78645, 78685, 78925, 78965, 82245, 82285, 82525, 82565, 82845, 82885, 84325, 84365, 84645, 84685, 84925, 84965, 86125, 86165, 86445, 86485, 86725, 86765, 88245, 88285, 88525, 88565, 88845, 88885, 92125, 92165, 92445, 92485, 92725, 92765, 94245, 94285, 94525, 94565, 94845, 94885, 96325, 96365, 96645, 96685, 96925, 96965, 98125, 98165, 98445, 98485, 98725, 98765]
--------------------------
div = 6
[123252, 123258, 123654, 126456, 126852, 126858, 129252, 129258, 129654, 141252, 141258, 141654, 144456, 144852, 144858, 147252, 147258, 147654, 162456, 162852, 162858, 165252, 165258, 165654, 168456, 168852, 168858, 183252, 183258, 183654, 186456, 186852, 186858, 189252, 189258, 189654, 222456, 222852, 222858, 225252, 225258, 225654, 228456, 228852, 228858, 243252, 243258, 243654, 246456, 246852, 246858, 249252, 249258, 249654, 261252, 261258, 261654, 264456, 264852, 264858, 267252, 267258, 267654, 282456, 282852, 282858, 285252, 285258, 285654, 288456, 288852, 288858, 321252, 321258, 321654, 324456, 324852, 324858, 327252, 327258, 327654, 342456, 342852, 342858, 345252, 345258, 345654, 348456, 348852, 348858, 363252, 363258, 363654, 366456, 366852, 366858, 369252, 369258, 369654, 381252, 381258, 381654, 384456, 384852, 384858, 387252, 387258, 387654, 423252, 423258, 423654, 426456, 426852, 426858, 429252, 429258, 429654, 441252, 441258, 441654, 444456, 444852, 444858, 447252, 447258, 447654, 462456, 462852, 462858, 465252, 465258, 465654, 468456, 468852, 468858, 483252, 483258, 483654, 486456, 486852, 486858, 489252, 489258, 489654, 522456, 522852, 522858, 525252, 525258, 525654, 528456, 528852, 528858, 543252, 543258, 543654, 546456, 546852, 546858, 549252, 549258, 549654, 561252, 561258, 561654, 564456, 564852, 564858, 567252, 567258, 567654, 582456, 582852, 582858, 585252, 585258, 585654, 588456, 588852, 588858, 621252, 621258, 621654, 624456, 624852, 624858, 627252, 627258, 627654, 642456, 642852, 642858, 645252, 645258, 645654, 648456, 648852, 648858, 663252, 663258, 663654, 666456, 666852, 666858, 669252, 669258, 669654, 681252, 681258, 681654, 684456, 684852, 684858, 687252, 687258, 687654, 723252, 723258, 723654, 726456, 726852, 726858, 729252, 729258, 729654, 741252, 741258, 741654, 744456, 744852, 744858, 747252, 747258, 747654, 762456, 762852, 762858, 765252, 765258, 765654, 768456, 768852, 768858, 783252, 783258, 783654, 786456, 786852, 786858, 789252, 789258, 789654, 822456, 822852, 822858, 825252, 825258, 825654, 828456, 828852, 828858, 843252, 843258, 843654, 846456, 846852, 846858, 849252, 849258, 849654, 861252, 861258, 861654, 864456, 864852, 864858, 867252, 867258, 867654, 882456, 882852, 882858, 885252, 885258, 885654, 888456, 888852, 888858, 921252, 921258, 921654, 924456, 924852, 924858, 927252, 927258, 927654, 942456, 942852, 942858, 945252, 945258, 945654, 948456, 948852, 948858, 963252, 963258, 963654, 966456, 966852, 966858, 969252, 969258, 969654, 981252, 981258, 981654, 984456, 984852, 984858, 987252, 987258, 987654]
--------------------------
div = 7
[1232525, 1232581, 1232588, 1236543, 1264564, 1268526, 1268582, 1268589, 1292522, 1292529, 1292585, 1296547, 1412523, 1412586, 1416541, 1416548, 1444562, 1444569, 1448524, 1448587, 1472527, 1472583, 1476545, 1624567, 1628522, 1628529, 1628585, 1652525, 1652581, 1652588, 1656543, 1684564, 1688526, 1688582, 1688589, 1832523, 1832586, 1836541, 1836548, 1864562, 1864569, 1868524, 1868587, 1892527, 1892583, 1896545, 2224565, 2228527, 2228583, 2252523, 2252586, 2256541, 2256548, 2284562, 2284569, 2288524, 2288587, 2432521, 2432528, 2432584, 2436546, 2464567, 2468522, 2468529, 2468585, 2492525, 2492581, 2492588, 2496543, 2612526, 2612582, 2612589, 2616544, 2644565, 2648527, 2648583, 2672523, 2672586, 2676541, 2676548, 2824563, 2828525, 2828581, 2828588, 2852521, 2852528, 2852584, 2856546, 2884567, 2888522, 2888529, 2888585, 3212524, 3212587, 3216542, 3216549, 3244563, 3248525, 3248581, 3248588, 3272521, 3272528, 3272584, 3276546, 3424561, 3424568, 3428523, 3428586, 3452526, 3452582, 3452589, 3456544, 3484565, 3488527, 3488583, 3632524, 3632587, 3636542, 3636549, 3664563, 3668525, 3668581, 3668588, 3692521, 3692528, 3692584, 3696546, 3812522, 3812529, 3812585, 3816547, 3844561, 3844568, 3848523, 3848586, 3872526, 3872582, 3872589, 3876544, 4232522, 4232529, 4232585, 4236547, 4264561, 4264568, 4268523, 4268586, 4292526, 4292582, 4292589, 4296544, 4412527, 4412583, 4416545, 4444566, 4448521, 4448528, 4448584, 4472524, 4472587, 4476542, 4476549, 4624564, 4628526, 4628582, 4628589, 4652522, 4652529, 4652585, 4656547, 4684561, 4684568, 4688523, 4688586, 4832527, 4832583, 4836545, 4864566, 4868521, 4868528, 4868584, 4892524, 4892587, 4896542, 4896549, 5224562, 5224569, 5228524, 5228587, 5252527, 5252583, 5256545, 5284566, 5288521, 5288528, 5288584, 5432525, 5432581, 5432588, 5436543, 5464564, 5468526, 5468582, 5468589, 5492522, 5492529, 5492585, 5496547, 5612523, 5612586, 5616541, 5616548, 5644562, 5644569, 5648524, 5648587, 5672527, 5672583, 5676545, 5824567, 5828522, 5828529, 5828585, 5852525, 5852581, 5852588, 5856543, 5884564, 5888526, 5888582, 5888589, 6212521, 6212528, 6212584, 6216546, 6244567, 6248522, 6248529, 6248585, 6272525, 6272581, 6272588, 6276543, 6424565, 6428527, 6428583, 6452523, 6452586, 6456541, 6456548, 6484562, 6484569, 6488524, 6488587, 6632521, 6632528, 6632584, 6636546, 6664567, 6668522, 6668529, 6668585, 6692525, 6692581, 6692588, 6696543, 6812526, 6812582, 6812589, 6816544, 6844565, 6848527, 6848583, 6872523, 6872586, 6876541, 6876548, 7232526, 7232582, 7232589, 7236544, 7264565, 7268527, 7268583, 7292523, 7292586, 7296541, 7296548, 7412524, 7412587, 7416542, 7416549, 7444563, 7448525, 7448581, 7448588, 7472521, 7472528, 7472584, 7476546, 7624561, 7624568, 7628523, 7628586, 7652526, 7652582, 7652589, 7656544, 7684565, 7688527, 7688583, 7832524, 7832587, 7836542, 7836549, 7864563, 7868525, 7868581, 7868588, 7892521, 7892528, 7892584, 7896546, 8224566, 8228521, 8228528, 8228584, 8252524, 8252587, 8256542, 8256549, 8284563, 8288525, 8288581, 8288588, 8432522, 8432529, 8432585, 8436547, 8464561, 8464568, 8468523, 8468586, 8492526, 8492582, 8492589, 8496544, 8612527, 8612583, 8616545, 8644566, 8648521, 8648528, 8648584, 8672524, 8672587, 8676542, 8676549, 8824564, 8828526, 8828582, 8828589, 8852522, 8852529, 8852585, 8856547, 8884561, 8884568, 8888523, 8888586, 9212525, 9212581, 9212588, 9216543, 9244564, 9248526, 9248582, 9248589, 9272522, 9272529, 9272585, 9276547, 9424562, 9424569, 9428524, 9428587, 9452527, 9452583, 9456545, 9484566, 9488521, 9488528, 9488584, 9632525, 9632581, 9632588, 9636543, 9664564, 9668526, 9668582, 9668589, 9692522, 9692529, 9692585, 9696547, 9812523, 9812586, 9816541, 9816548, 9844562, 9844569, 9848524, 9848587, 9872527, 9872583, 9876545]
--------------------------
div = 8
[12325256, 12325816, 12325888, 12365432, 12645648, 12685264, 12685824, 12685896, 12925224, 12925296, 12925856, 12965472, 14125232, 14125864, 14165416, 14165488, 14445624, 14445696, 14485248, 14485872, 14725272, 14725832, 14765456, 16245672, 16285224, 16285296, 16285856, 16525256, 16525816, 16525888, 16565432, 16845648, 16885264, 16885824, 16885896, 18325232, 18325864, 18365416, 18365488, 18645624, 18645696, 18685248, 18685872, 18925272, 18925832, 18965456, 22245656, 22285272, 22285832, 22525232, 22525864, 22565416, 22565488, 22845624, 22845696, 22885248, 22885872, 24325216, 24325288, 24325848, 24365464, 24645672, 24685224, 24685296, 24685856, 24925256, 24925816, 24925888, 24965432, 26125264, 26125824, 26125896, 26165448, 26445656, 26485272, 26485832, 26725232, 26725864, 26765416, 26765488, 28245632, 28285256, 28285816, 28285888, 28525216, 28525288, 28525848, 28565464, 28845672, 28885224, 28885296, 28885856, 32125248, 32125872, 32165424, 32165496, 32445632, 32485256, 32485816, 32485888, 32725216, 32725288, 32725848, 32765464, 34245616, 34245688, 34285232, 34285864, 34525264, 34525824, 34525896, 34565448, 34845656, 34885272, 34885832, 36325248, 36325872, 36365424, 36365496, 36645632, 36685256, 36685816, 36685888, 36925216, 36925288, 36925848, 36965464, 38125224, 38125296, 38125856, 38165472, 38445616, 38445688, 38485232, 38485864, 38725264, 38725824, 38725896, 38765448, 42325224, 42325296, 42325856, 42365472, 42645616, 42645688, 42685232, 42685864, 42925264, 42925824, 42925896, 42965448, 44125272, 44125832, 44165456, 44445664, 44485216, 44485288, 44485848, 44725248, 44725872, 44765424, 44765496, 46245648, 46285264, 46285824, 46285896, 46525224, 46525296, 46525856, 46565472, 46845616, 46845688, 46885232, 46885864, 48325272, 48325832, 48365456, 48645664, 48685216, 48685288, 48685848, 48925248, 48925872, 48965424, 48965496, 52245624, 52245696, 52285248, 52285872, 52525272, 52525832, 52565456, 52845664, 52885216, 52885288, 52885848, 54325256, 54325816, 54325888, 54365432, 54645648, 54685264, 54685824, 54685896, 54925224, 54925296, 54925856, 54965472, 56125232, 56125864, 56165416, 56165488, 56445624, 56445696, 56485248, 56485872, 56725272, 56725832, 56765456, 58245672, 58285224, 58285296, 58285856, 58525256, 58525816, 58525888, 58565432, 58845648, 58885264, 58885824, 58885896, 62125216, 62125288, 62125848, 62165464, 62445672, 62485224, 62485296, 62485856, 62725256, 62725816, 62725888, 62765432, 64245656, 64285272, 64285832, 64525232, 64525864, 64565416, 64565488, 64845624, 64845696, 64885248, 64885872, 66325216, 66325288, 66325848, 66365464, 66645672, 66685224, 66685296, 66685856, 66925256, 66925816, 66925888, 66965432, 68125264, 68125824, 68125896, 68165448, 68445656, 68485272, 68485832, 68725232, 68725864, 68765416, 68765488, 72325264, 72325824, 72325896, 72365448, 72645656, 72685272, 72685832, 72925232, 72925864, 72965416, 72965488, 74125248, 74125872, 74165424, 74165496, 74445632, 74485256, 74485816, 74485888, 74725216, 74725288, 74725848, 74765464, 76245616, 76245688, 76285232, 76285864, 76525264, 76525824, 76525896, 76565448, 76845656, 76885272, 76885832, 78325248, 78325872, 78365424, 78365496, 78645632, 78685256, 78685816, 78685888, 78925216, 78925288, 78925848, 78965464, 82245664, 82285216, 82285288, 82285848, 82525248, 82525872, 82565424, 82565496, 82845632, 82885256, 82885816, 82885888, 84325224, 84325296, 84325856, 84365472, 84645616, 84645688, 84685232, 84685864, 84925264, 84925824, 84925896, 84965448, 86125272, 86125832, 86165456, 86445664, 86485216, 86485288, 86485848, 86725248, 86725872, 86765424, 86765496, 88245648, 88285264, 88285824, 88285896, 88525224, 88525296, 88525856, 88565472, 88845616, 88845688, 88885232, 88885864, 92125256, 92125816, 92125888, 92165432, 92445648, 92485264, 92485824, 92485896, 92725224, 92725296, 92725856, 92765472, 94245624, 94245696, 94285248, 94285872, 94525272, 94525832, 94565456, 94845664, 94885216, 94885288, 94885848, 96325256, 96325816, 96325888, 96365432, 96645648, 96685264, 96685824, 96685896, 96925224, 96925296, 96925856, 96965472, 98125232, 98125864, 98165416, 98165488, 98445624, 98445696, 98485248, 98485872, 98725272, 98725832, 98765456]
--------------------------
div = 9
[123252561, 123258168, 123258888, 123654321, 126456489, 126852642, 126858249, 126858969, 129252249, 129252969, 129258567, 129654729, 141252327, 141258645, 141654168, 141654888, 144456246, 144456966, 144852489, 144858726, 147252726, 147258324, 147654567, 162456723, 162852246, 162852966, 162858564, 165252564, 165258162, 165258882, 165654324, 168456483, 168852645, 168858243, 168858963, 183252321, 183258648, 183654162, 183654882, 186456249, 186456969, 186852483, 186858729, 189252729, 189258327, 189654561, 222456564, 222852726, 222858324, 225252324, 225258642, 225654165, 225654885, 228456243, 228456963, 228852486, 228858723, 243252162, 243252882, 243258489, 243654642, 246456729, 246852243, 246852963, 246858561, 249252561, 249258168, 249258888, 249654321, 261252648, 261258246, 261258966, 261654489, 264456567, 264852729, 264858327, 267252327, 267258645, 267654168, 267654888, 282456324, 282852567, 282858165, 282858885, 285252165, 285252885, 285258483, 285654645, 288456723, 288852246, 288852966, 288858564, 321252489, 321258726, 321654249, 321654969, 324456327, 324852561, 324858168, 324858888, 327252168, 327252888, 327258486, 327654648, 342456165, 342456885, 342852327, 342858645, 345252645, 345258243, 345258963, 345654486, 348456564, 348852726, 348858324, 363252483, 363258729, 363654243, 363654963, 366456321, 366852564, 366858162, 366858882, 369252162, 369252882, 369258489, 369654642, 381252249, 381252969, 381258567, 381654729, 384456168, 384456888, 384852321, 384858648, 387252648, 387258246, 387258966, 387654489, 423252243, 423252963, 423258561, 423654723, 426456162, 426456882, 426852324, 426858642, 429252642, 429258249, 429258969, 429654483, 441252729, 441258327, 441654561, 444456648, 444852162, 444852882, 444858489, 447252489, 447258726, 447654249, 447654969, 462456486, 462852648, 462858246, 462858966, 465252246, 465252966, 465258564, 465654726, 468456165, 468456885, 468852327, 468858645, 483252723, 483258321, 483654564, 486456642, 486852165, 486852885, 486858483, 489252483, 489258729, 489654243, 489654963, 522456246, 522456966, 522852489, 522858726, 525252726, 525258324, 525654567, 528456645, 528852168, 528852888, 528858486, 543252564, 543258162, 543258882, 543654324, 546456483, 546852645, 546858243, 546858963, 549252243, 549252963, 549258561, 549654723, 561252321, 561258648, 561654162, 561654882, 564456249, 564456969, 564852483, 564858729, 567252729, 567258327, 567654561, 582456726, 582852249, 582852969, 582858567, 585252567, 585258165, 585258885, 585654327, 588456486, 588852648, 588858246, 588858966, 621252162, 621252882, 621258489, 621654642, 624456729, 624852243, 624852963, 624858561, 627252561, 627258168, 627258888, 627654321, 642456567, 642852729, 642858327, 645252327, 645258645, 645654168, 645654888, 648456246, 648456966, 648852489, 648858726, 663252165, 663252885, 663258483, 663654645, 666456723, 666852246, 666852966, 666858564, 669252564, 669258162, 669258882, 669654324, 681252642, 681258249, 681258969, 681654483, 684456561, 684852723, 684858321, 687252321, 687258648, 687654162, 687654882, 723252645, 723258243, 723258963, 723654486, 726456564, 726852726, 726858324, 729252324, 729258642, 729654165, 729654885, 741252483, 741258729, 741654243, 741654963, 744456321, 744852564, 744858162, 744858882, 747252162, 747252882, 747258489, 747654642, 762456168, 762456888, 762852321, 762858648, 765252648, 765258246, 765258966, 765654489, 768456567, 768852729, 768858327, 783252486, 783258723, 783654246, 783654966, 786456324, 786852567, 786858165, 786858885, 789252165, 789252885, 789258483, 789654645, 822456648, 822852162, 822852882, 822858489, 825252489, 825258726, 825654249, 825654969, 828456327, 828852561, 828858168, 828858888, 843252246, 843252966, 843258564, 843654726, 846456165, 846456885, 846852327, 846858645, 849252645, 849258243, 849258963, 849654486, 861252723, 861258321, 861654564, 864456642, 864852165, 864852885, 864858483, 867252483, 867258729, 867654243, 867654963, 882456489, 882852642, 882858249, 882858969, 885252249, 885252969, 885258567, 885654729, 888456168, 888456888, 888852321, 888858648, 921252564, 921258162, 921258882, 921654324, 924456483, 924852645, 924858243, 924858963, 927252243, 927252963, 927258561, 927654723, 942456249, 942456969, 942852483, 942858729, 945252729, 945258327, 945654561, 948456648, 948852162, 948852882, 948858489, 963252567, 963258165, 963258885, 963654327, 966456486, 966852648, 966858246, 966858966, 969252246, 969252966, 969258564, 969654726, 981252324, 981258642, 981654165, 981654885, 984456243, 984456963, 984852486, 984858723, 987252723, 987258321, 987654564]

 

Link to comment
Share on other sites

Tur jau neko nevajag mergot, pēdējais masīvs ir atbilde

Var jau printu pārnest ārā

def find_multiples(numbers, divider):
    results = []
    for num in numbers:
        for i in range (1, 10):
            test_num = (num * 10) + i
            if test_num % divider == 0:
                results.append(test_num)

    return results


numbers = [0]
for i in range(1, 10):
    numbers = find_multiples(numbers, i)

print(numbers)

 

Spoiler

andris@andris-Precision-3520 ~/Documents/Projects $ python3 numbers.py 
[123252561, 123258168, 123258888, 123654321, 126456489, 126852642, 126858249, 126858969, 129252249, 129252969, 129258567, 129654729, 141252327, 141258645, 141654168, 141654888, 144456246, 144456966, 144852489, 144858726, 147252726, 147258324, 147654567, 162456723, 162852246, 162852966, 162858564, 165252564, 165258162, 165258882, 165654324, 168456483, 168852645, 168858243, 168858963, 183252321, 183258648, 183654162, 183654882, 186456249, 186456969, 186852483, 186858729, 189252729, 189258327, 189654561, 222456564, 222852726, 222858324, 225252324, 225258642, 225654165, 225654885, 228456243, 228456963, 228852486, 228858723, 243252162, 243252882, 243258489, 243654642, 246456729, 246852243, 246852963, 246858561, 249252561, 249258168, 249258888, 249654321, 261252648, 261258246, 261258966, 261654489, 264456567, 264852729, 264858327, 267252327, 267258645, 267654168, 267654888, 282456324, 282852567, 282858165, 282858885, 285252165, 285252885, 285258483, 285654645, 288456723, 288852246, 288852966, 288858564, 321252489, 321258726, 321654249, 321654969, 324456327, 324852561, 324858168, 324858888, 327252168, 327252888, 327258486, 327654648, 342456165, 342456885, 342852327, 342858645, 345252645, 345258243, 345258963, 345654486, 348456564, 348852726, 348858324, 363252483, 363258729, 363654243, 363654963, 366456321, 366852564, 366858162, 366858882, 369252162, 369252882, 369258489, 369654642, 381252249, 381252969, 381258567, 381654729, 384456168, 384456888, 384852321, 384858648, 387252648, 387258246, 387258966, 387654489, 423252243, 423252963, 423258561, 423654723, 426456162, 426456882, 426852324, 426858642, 429252642, 429258249, 429258969, 429654483, 441252729, 441258327, 441654561, 444456648, 444852162, 444852882, 444858489, 447252489, 447258726, 447654249, 447654969, 462456486, 462852648, 462858246, 462858966, 465252246, 465252966, 465258564, 465654726, 468456165, 468456885, 468852327, 468858645, 483252723, 483258321, 483654564, 486456642, 486852165, 486852885, 486858483, 489252483, 489258729, 489654243, 489654963, 522456246, 522456966, 522852489, 522858726, 525252726, 525258324, 525654567, 528456645, 528852168, 528852888, 528858486, 543252564, 543258162, 543258882, 543654324, 546456483, 546852645, 546858243, 546858963, 549252243, 549252963, 549258561, 549654723, 561252321, 561258648, 561654162, 561654882, 564456249, 564456969, 564852483, 564858729, 567252729, 567258327, 567654561, 582456726, 582852249, 582852969, 582858567, 585252567, 585258165, 585258885, 585654327, 588456486, 588852648, 588858246, 588858966, 621252162, 621252882, 621258489, 621654642, 624456729, 624852243, 624852963, 624858561, 627252561, 627258168, 627258888, 627654321, 642456567, 642852729, 642858327, 645252327, 645258645, 645654168, 645654888, 648456246, 648456966, 648852489, 648858726, 663252165, 663252885, 663258483, 663654645, 666456723, 666852246, 666852966, 666858564, 669252564, 669258162, 669258882, 669654324, 681252642, 681258249, 681258969, 681654483, 684456561, 684852723, 684858321, 687252321, 687258648, 687654162, 687654882, 723252645, 723258243, 723258963, 723654486, 726456564, 726852726, 726858324, 729252324, 729258642, 729654165, 729654885, 741252483, 741258729, 741654243, 741654963, 744456321, 744852564, 744858162, 744858882, 747252162, 747252882, 747258489, 747654642, 762456168, 762456888, 762852321, 762858648, 765252648, 765258246, 765258966, 765654489, 768456567, 768852729, 768858327, 783252486, 783258723, 783654246, 783654966, 786456324, 786852567, 786858165, 786858885, 789252165, 789252885, 789258483, 789654645, 822456648, 822852162, 822852882, 822858489, 825252489, 825258726, 825654249, 825654969, 828456327, 828852561, 828858168, 828858888, 843252246, 843252966, 843258564, 843654726, 846456165, 846456885, 846852327, 846858645, 849252645, 849258243, 849258963, 849654486, 861252723, 861258321, 861654564, 864456642, 864852165, 864852885, 864858483, 867252483, 867258729, 867654243, 867654963, 882456489, 882852642, 882858249, 882858969, 885252249, 885252969, 885258567, 885654729, 888456168, 888456888, 888852321, 888858648, 921252564, 921258162, 921258882, 921654324, 924456483, 924852645, 924858243, 924858963, 927252243, 927252963, 927258561, 927654723, 942456249, 942456969, 942852483, 942858729, 945252729, 945258327, 945654561, 948456648, 948852162, 948852882, 948858489, 963252567, 963258165, 963258885, 963654327, 966456486, 966852648, 966858246, 966858966, 969252246, 969252966, 969258564, 969654726, 981252324, 981258642, 981654165, 981654885, 984456243, 984456963, 984852486, 984858723, 987252723, 987258321, 987654564]

 

Link to comment
Share on other sites

Pirms 2 minūtēm , marrtins teica:

Cipari nedrīkst atkārtoties.

To nepamaniju prasībās, bet nu tas sīkums, viegli pielikt

Link to comment
Share on other sites

Pirms 55 minūtēm , vvv teica:

Vai ir šim uzdevumam kāds risinājums «uz papīra lapiņas»?

Ar dalāmības pazīmēm vajadzētu tikt jēgā. 5 - 5 bez variantiem, 2 - (2,4,6,8), tad kontekstā ar iepriekšējo var skatīt pirmos trīs, kuriem jāveido summa 6,9,12... tālāk 4, kam pēdējo 2 ciparu veidotajam skaitlim jādalās ar 4.
7 dalāmības pazīmē ir smadzeņlauzis pats par sevi :D

9 - šajā situācijā bezjēdzīga.
 

  • Patīk 1
Link to comment
Share on other sites

Nav laika domāt kā daudzmaz efektīvi pārbaidīt vai cipars jau ir skaitlī, bet nu ja jau tā vēlies, tad slinkais variants

def find_multiples(numbers, divider):
    results = []
    for num in numbers:
        for i in range (1, 10):
            if str(i) in str(num):
                continue

            test_num = (num * 10) + i
            if test_num % divider == 0:
                results.append(test_num)

    return results


numbers = [0]
for i in range(1, 10):
    numbers = find_multiples(numbers, i)

print(numbers)

 

Spoiler

[1, 2, 3, 4, 5, 6, 7, 8, 9]
[12, 14, 16, 18, 24, 26, 28, 32, 34, 36, 38, 42, 46, 48, 52, 54, 56, 58, 62, 64, 68, 72, 74, 76, 78, 82, 84, 86, 92, 94, 96, 98]
[123, 126, 129, 147, 162, 165, 168, 183, 186, 189, 243, 246, 249, 261, 264, 267, 285, 321, 324, 327, 342, 345, 348, 369, 381, 384, 387, 423, 426, 429, 462, 465, 468, 483, 486, 489, 528, 543, 546, 549, 561, 564, 567, 582, 621, 624, 627, 642, 645, 648, 681, 684, 687, 723, 726, 729, 741, 762, 765, 768, 783, 786, 789, 825, 843, 846, 849, 861, 864, 867, 921, 924, 927, 942, 945, 948, 963, 981, 984, 987]
[1236, 1264, 1268, 1296, 1472, 1476, 1624, 1628, 1652, 1684, 1832, 1836, 1864, 1892, 1896, 2436, 2468, 2496, 2648, 2856, 3216, 3248, 3276, 3428, 3452, 3456, 3692, 3812, 3816, 3872, 3876, 4236, 4268, 4296, 4628, 4652, 4832, 4836, 4892, 4896, 5284, 5432, 5436, 5468, 5492, 5496, 5612, 5648, 5672, 5824, 6248, 6428, 6452, 6812, 6872, 7236, 7264, 7268, 7296, 7412, 7416, 7624, 7628, 7652, 7684, 7832, 7836, 7864, 7892, 7896, 8256, 8432, 8436, 8492, 8496, 8612, 8672, 9216, 9248, 9276, 9428, 9452, 9456, 9632, 9812, 9816, 9872, 9876]
[12365, 12645, 12685, 12965, 14725, 14765, 16245, 16285, 16845, 18325, 18365, 18645, 18925, 18965, 24365, 24685, 24965, 26485, 32165, 32485, 32765, 34285, 36925, 38125, 38165, 38725, 38765, 42365, 42685, 42965, 46285, 48325, 48365, 48925, 48965, 62485, 64285, 68125, 68725, 72365, 72645, 72685, 72965, 74125, 74165, 76245, 76285, 76845, 78325, 78365, 78645, 78925, 78965, 84325, 84365, 84925, 84965, 86125, 86725, 92165, 92485, 92765, 94285, 96325, 98125, 98165, 98725, 98765]
[123654, 129654, 147258, 183654, 189654, 321654, 327654, 369258, 381654, 387654, 723654, 729654, 741258, 783654, 789654, 921654, 927654, 963258, 981654, 987654]
[1296547, 1472583, 3216549, 3692584, 3816547, 7296541, 7296548, 7836542, 7836549, 9216543, 9632581]
[38165472]
[381654729]
[381654729]

 

  • Patīk 2
Link to comment
Share on other sites

Pirmos trīs ciparus. Kādi varianti. Otrais noteikti pāra skaitlis, pirmais un trešais noteikti nepāra. Lai triju ciparu summa dalītos ar trīs. 5 netiek lietots, jo tam jābūt kā piektajam obligāti.

Otrais 2:

123

129

321

327

723

729

921

927

Vēl tas pats ar atlikušajiem pāra cipariem kā otro.

Otrais 4:

147

741

Tikai divi varianti derēja. Interesanti.

Otrais 6:

369

963

Otrais 8:

183

189

381

387

783

789

981

987

 

Link to comment
Share on other sites

Vēl jau droši vien tai Pitona skriptā būtu viegāk iedod funkcijai masīvu ar cipariem kas nav izmantoti (nevis taisīt loop'u no 1 - 10 un tad salīdzināt vai jau ir skaitlī), tad nevajadzētu salīdzināt stringus, būtu ātrāk

Link to comment
Share on other sites

Šie varianti, 5 vidū.

Ja ar 4 jādala, tur pazīme, ja desmiti nepāra, kā mūsu gadījumā, tad pēdējam ciparam jābūt vai nu 2 vai nu 6

Tātad divnieks vai sešinieks jāpietaupa priekš ceturtā skaitļa.

Link to comment
Share on other sites

Vēl tāda pazīme dalot ar 4. Priekšpēdējais cipars reiz divi plus pēdējais cipars, jādalās ar 4. Kādi varianti? Ja ceturtais 2, tad trešais derēs: 1, 3, 7 un 9. Ja ceturtais cipars 6, tad trešais derēs: 1, 3, 7, 9.

Šis neko nedod.

Link to comment
Share on other sites

Vēl 6iem varam apskatīt. Ja dalās ar 6, tad jādalās arī ar trīs, tātad ciparu summai jādalās ar 3.

No mūsu variantiem kas derēs?

Ciparu summa pirmajiem trim dalās ar trīs, tad pieliekam 2 un 5, kuri cipari derēs kā 6tais.

Tieši tāpat ar 6 un 5.

Varianti ceturtajam, piektajam un sestajam cipariem, atceramies, sestajam jābūt pāra skaitlim:

258

654

Lūk, jāsāk no šejienes.

  • Patīk 1
Link to comment
Share on other sites

Pirmie seši cipari, kas vispār iespējams?

Ja 4., 5. un 6. ir 258

Tad iespējamie varianti:

147258

741258

369258

963258

Ja 4., 5., un 6. ir 654

Tad iespējamie varianti:

Šo vairāk

123654

129654

321654

327654

723654

729654

921654

927654

183654

189654

381654

387654

783654

789654

981654

987654

Pēdējie 3 cipari pietrūkst tikai. :)

7. ir nepāra, 8. ir pāra, 9. kas paliek pāri

Būtu labi tagad šito pielietot:

Pirms 37 minūtēm , maize teica:

7 dalāmības pazīmē ir smadzeņlauzis pats par sevi

 

:D

  • Patīk 1
Link to comment
Share on other sites

Paņemam pirmo iespējamo variantu un pieliekam galā vienu no atlikušiem nepāra skaitļiem.

1472583

Pārbaudam dalāmību ar 7

583 - 472+1 = 112. Dalās ar 7.

1472589 nedalīsies, uzreiz redzams.

Tā visus pēc kārtas 6ciparu skaitļus varam uz lapiņas pārbaudīt, kuri derēs, kuri nederēs. Variantu paliks mazāk.

 

1472583 pagaidām der, pārējos sešciparu iekopēju:

741258

369258

963258

123654

129654

321654

327654

723654

729654

921654

927654

183654

189654

381654

387654

783654

789654

981654

987654

  • Patīk 1
Link to comment
Share on other sites

7412583 neder

7412589 neder

3692581 neder

3692587 neder

9632581 der

9632587 neder

1236547 neder

1236549 neder

1296543 der

1296547 neder

3216547 neder

3216549 der

3276541 neder

3276549 neder

7236541 neder

7236549 neder

7296541 neder

7296543 neder

9216543 der

9216547 neder

9276541 neder

9276543 neder

1836547 neder

1836549 neder

1896543 neder

1896547 neder

3816547 der

3816549 neder

3876541 neder

3876549 neder

7836541 neder

7836549 der

7896541 neder

7896543 neder

9816543 neder

9816547 neder

9876541 neder

9876543 neder

Godīgi atzīšos, skaitļu dalīšanai ar 7 ņēmu talkā kalkulatoru. Paši redzējāt, varēja arī uz lapiņas.

Link to comment
Share on other sites

8. cipars atlikušais pāra skaitlis. Tos saliekam un pārbaudam vai dalās ar 8

14725836

96325814

12965438

32165498

92165438

38165472

78365492

Pārbaudīt varam pēc šīs pazīmes:

The last three digits are divisible by 8 (vikipēdija). Tā lai galvā var.

Mums visiem skaitļiem simti dalās ar 8, tad viegli ieraudzīt, ka vienīgais derīgais ir:

38165472

Pieliekam atlikušo ciparu un dabūjam atbildi:

381654729

Redzējāt? Varēja uz lapiņas.

:dance3:

  • Atbalstu 2
Link to comment
Share on other sites

Kods der, ja ir tehnika, kurā to kodu palaist darbībā.

Padomāju, cik mēs esam izlaidušies rēķināšanas ziņā. Pirms 100 gadiem, kad nebija datoru, ļaudis vis kaut ko uz lapiņas dabūja rēķināt, daudzi... inženieri, grāmatveži, visi pēc kārtas...

Skatos, Andrim atbildē ar 7 dalās 10 varianti, es kaut kur 3 pa ceļam būšu pazaudējis.

Jā, tieši tad, kad ar kalkulatoru pārbaudīju 7 ciparu skaitļus. Vajadzēja uz lapiņas rēķināt.

:D

  • Patīk 1
Link to comment
Share on other sites

Pirms 3 minūtēm , vvv teica:

Kods der, ja ir tehnika, kurā to kodu palaist darbībā.

"Nav tehnika" - tas ir kā? :shok:

Pirms 100 gadiem mēs, iespējams, pa pastu apmainītos ar idejām :sarkasms:

Link to comment
Share on other sites

Pirms 8 minūtēm , marrtins teica:

Pirms 100 gadiem mēs, iespējams, pa pastu apmainītos ar idejām

Pa telefonu varētu sazvanīties. Telegrāfs arī bija. :sarkasms:

  • Patīk 1
Link to comment
Share on other sites

Jā - varētu aizsist visu tā laika pilsētiņas bandwidth. Nez cik tas izmaksātu tajā laikā :sarkasms:

 

Bet "pirms simts gadiem" man tas kaut kā joprojām asociējas ar 19. gs. beigām :D

 

Link to comment
Share on other sites

skaitlis := 381611111
smax := 987654321
dalitajs := 9

Loop 
{
	skaitlis++
	ToolTip, %skaitlis%, 100, 100, 1
	ir0 := instr(skaitlis, 0)
	if (ir0 <> 0)
	{
		pieskaitit := (9 - ir0) * 10
		if(pieskaitit >0)
			skaitlis := skaitlis + pieskaitit - 1
		;MsgBox,,, %skaitlis% pozicija %ir0% pieskaitit %pieskaitit%  pieskaitits %skaitlis%
		Continue
	}
	
	
	; meklesim vai skaitlis atkartojas
	pozicija := 9
	atkartojas := 0
	Loop
	{
		meklejamais := SubStr(skaitlis, pozicija , 1)
		atrasts := InStr(skaitlis, meklejamais)
		atrasts2 := InStr(skaitlis, meklejamais,, atrasts + 1)
		if (atrasts2 > 0)
		{
			atkartojas := 1
			;MsgBox,,, skaitlis %skaitlis% atrasts %atrasts% atrasts2 %atrasts2%
			Break
		}
		pozicija--
		if(pozicija = 0)
			Break
	}
	if(atkartojas = 1)
		Continue
	
	
	; tagad dalisim ar visiem pec kartas
	dalitajs := 9
	Loop
	{
		dalamais := SubStr(skaitlis, 1 , dalitajs)
		rez := dalamais / dalitajs
		if (rez != Round(rez,0))
		{
			;MsgBox,,, %dalamais% / %dalitajs% = %rez%
			izlaist := 1
			Break
		}
		else
			;MsgBox,,,  %dalamais% / %dalitajs% = %rez% IR
			dalitajs--
		if (dalitajs = 1)
			MsgBox,,, %skaitlis%
	}
	
	
	
	
}

arī strādā, bet vājprātā lēni, ka sāku nevis no 123... bet 38 lai vismaz pārliecinātos vai rezultāts būs pareizs. ir.

  • Patīk 2
Link to comment
Share on other sites

piektdiena sen pagājusi, es vēl cīnos.

pārrakstīju python un prātīgāk, tagad sāk no 1 uz augšu čekojot un starprezultātus glabājot array jeb listā. Ar listiem gan ne visai glīti sanāca. Bet nu strādā un uzreiz. 

#no tutorial ka uzgeneret 9 listus ar sublistiem
rows, cols = (9, 1)
arr=[]
for i in range(rows):
    col = []
    for j in range(cols):
        col.append(0)
    arr.append(col)

#sākuma saraksts
arr[0] = [1,2,3,4,5,6,7,8,9]

for k in range(0,8):
    for i in arr[k]:
        next_arr = k + 1
        for m in range(1,10):#liksim klāt iepriekšējiem derīgiem cipariņus no 1 līdz 9 un čekos vai der. kas der liks jaunā listā.
            skaitlis = (i*10) + m
            der = 1
            skaitlis_strings = str(skaitlis)
            gar = len(skaitlis_strings)
            d = skaitlis / gar
            d_apalots = round(d,0)
            for n in range(0,gar):
                cipars = skaitlis_strings[n]
                cipars_str = str(cipars)
                skaits = skaitlis_strings.count(cipars_str)
                #vai cipars == nečekošu, jo iepriekšējais *10 + 1 līdz 9 tāpat nekad...  beigās nē, bet vidū kāpēc nav? 
                if(cipars_str == "0"):
                    print(skaitlis)#reāli nav neviena ar 0
                if(skaits > 1):
                    der = 0
            if(der == 0):
                continue
            if(d==d_apalots):
               arr[next_arr].append(skaitlis)
    arr[next_arr].pop(0)#savādāk tur tā dummy 0 pirmais ieraksts paliek, stulbi, protams
print(arr)

 

  • Patīk 2
  • Atbalstu 1
Link to comment
Share on other sites

Neapvainojies, bet baigais neglītenis :D

 

Pluss par centību - labā griba arī nav peļama :)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...