2023年5月1日月曜日

230501

Ruby


(n+1)^k written in base n

n>1の時、出力してみた。

def A(n, k)
  ((n + 1) ** k).to_s(n)
end

(1..15).each{|i|
  p (2..36).map{|j| A(j, i)}
}

出力結果
["11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11", "11"]
["1001", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121", "121"]
["11011", "2101", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331", "1331"]
["1010001", "100111", "21301", "20141", "15041", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641", "14641"]
["11110011", "1101221", "300311", "222101", "205451", "164351", "163251", "162151", "161051", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51", "15aa51"]
["1011011001", "12121201", "3310021", "2443111", "2304401", "2141161", "2015761", "1783661", "1771561", "175a461", "1749361", "1738261", "1727161", "1716061", "1704f61", "16g3f61", "16g2f61", "16g1f61", "16g0f61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61", "16fkf61"]
["100010001011", "211110211", "103010231", "32424221", "25352411", "23553101", "22175571", "20731371", "19487171", "19253a71", "19020971", "18aba871", "18998771", "18876671", "18754571", "18632471", "18510371", "183hh271", "182gg171", "181ff071", "180edl71", "17mdcl71", "17mcbl71", "17mbal71", "17ma9l71", "17m98l71", "17m87l71", "17m76l71", "17m65l71", "17m54l71", "17m43l71", "17m32l71", "17m21l71", "17m10l71", "17lzzl71"]
["1100110100001", "10022220021", "1133113201", "412221431", "323320521", "262414111", "244153501", "228145181", "214358881", "200793681", "1a922a481", "1a6996281", "1a4542081", "1a20dcd81", "19fc99c81", "19e956b81", "19d613a81", "19c2g0981", "19ajch881", "199h9f781", "198f6d681", "197d3b581", "196b09481", "1958m7381", "1946k5281", "1934i3181", "1922g1081", "1910drs81", "18tsbqs81", "18tr9ps81", "18tq7os81", "18tp5ns81", "18to3ms81", "18tn1ls81", "18tlzks81"]
["100110011100011", "111022121001", "13130311211", "10034441241", "4000530131", "3216555221", "2705710511", "2520607101", "2357947691", "220861a391", "207b513091", "1c43628a91", "1c09962891", "1bc2ebb691", "1b9c636491", "1b76ec1291", "1b5174e091", "1b2eig9h91", "1b0aca5g91", "1aj6641f91", "1ai1ljje91", "1agkgegd91", "1afhb9dc91", "1aee64ab91", "1adb0p7a91", "1ac7ml4991", "1ab4ih1891", "1aa1ecr791", "1a8sa8p691", "1a7q64n591", "1a6o20l491", "1a5lutj391", "1a4jrqh291", "1a3honf191", "1a2flkd091"]
["1110011010101001", "1222021101011", "211100023321", "110434404201", "44010231441", "35415440431", "31765015621", "27726678111", "25937424601", "242938131a1", "228746439a1", "213798b66a1", "1dca518b3a1", "1d902b830a1", "1d56299ada1", "1d1e49d3ba1", "1cg68c0e9a1", "1cdheg787a1", "1cbb32g25a1", "1c94ca5h3a1", "1c6k1jhc1a1", "1c4ee886ma1", "1c294kn1la1", "1c03kaelka1", "1bnoc06hja1", "1bmk3gpdia1", "1blfn7i9ha1", "1bkbfrb5ga1", "1bj78j41fa1", "1bi31arsea1", "1bguq2lpda1", "1bfrjrfmca1", "1beodk9jba1", "1bdl7d3gaa1", "1bci15xd9a1"]
["101011001111111011", "21220002111121", "2322100323131", "1220334001211", "524112550251", "422603145041", "351635174031", "316104570221", "285311670611", "267120945101", "24b3baa817b1", "234b457503b1", "21c916a60db1", "20792e4b3ab1", "1f2b8c3487b1", "1eeg1e5gf4b1", "1eb4f2cf61b1", "1e7cdc4ffhb1", "1e42e5ii7fb1", "1e0dh1g1kdb1", "1dj4llf7dbb1", "1dgj5mgf69b1", "1debe1k0n7b1", "1dc3o60bh5b1", "1d9mac6ob3b1", "1d7fnkfc51b1", "1d59b2prqrb1", "1d32re9glqb1", "1d0qfrn5gpb1", "1ctl4c7pbob1", "1csfosof6nb1", "1craeea51mb1", "1cq53xtsulb1", "1coyskgjqkb1", "1cnuj73amjb1"]
["10000001101111110001", "1011120101000101", "32203110221101", "13424224013321", "10205242453201", "4651634625451", "4070207134341", "3477151372431", "3138428376721", "292832a296111", "27433a9699701", "258329cc541c1", "2407a83270ac1", "2281c240ee6c1", "211e44f7d02c1", "1gce0g35f2fc1", "1g7g1hfa37cc1", "1g3176h1ce9c1", "1fi6h04h636c1", "1fee9ihi1d3c1", "1fb24lf0l30c1", "1f7d25g8lfkc1", "1f421fll06ic1", "1f0g356c3mgc1", "1en66mj59eec1", "1eknch90h6cc1", "1eieke0pqqac1", "1eg61cnq9j8c1", "1edrcdksmc6c1", "1ebjpgk2654c1", "1e9c8ll7lu2c1", "1e74osof6o0c1", "1e4v93tophwc1", "1e2ose21bbvc1", "1e0idqadx5uc1"]
["110000101001111010011", "11200021111001111", "1020300213032111", "203222014202031", "112302111425211", "54501314213261", "44772300477751", "38358665206741", "34522712143931", "31100622147221", "29b77284474711", "280b5c9c496101", "264844b597b8d1", "24a9de650e63d1", "233029474d2ed1", "21c9f029411ad1", "206601f7db26d1", "1i048e4ie852d1", "1he53h52399id1", "1h9837fejegfd1", "1h4d74eg023cd1", "1gmkf7m27ed9d1", "1gj63hdil716d1", "1gfgj8big1e3d1", "1gc3d3foeo30d1", "1g8h92q9hniod1", "1g5576eqop8md1", "1g1m7e7l6srkd1", "1fsb9q4jl4iid1", "1fq0eb5m8b9gd1", "1fnlkuastk0ed1", "1flbtkk6luocd1", "1fj26cxkg9gad1", "1fgri7g3cn88d1", "1feiw40ob306d1"]
["10010001111101101111001", "200201002221012221", "11223303010013221", "2240442211222341", "1235323230121321", "632514456346201", "514715305477461", "433056427275251", "379749833583241", "342106843609431", "309729b08bbb821", "2a8c45994127111", "28acc9231356801", "27058d5b605a1e1", "25632bdbc201be1", "23e57f2bd52c6e1", "226c61h536d91e1", "20i4d404e3d7fe1", "1jbj91275cj8be1", "1j5hbb29ddab7e1", "1ilhkbj8g25g3e1", "1igkd0719m4mme1", "1ic19l78g487je1", "1i77b2k59hfhge1", "1i2fggjedd13de1", "1hopqc290efgae1", "1hlacdldnm637e1", "1hho0llss6rj4e1", "1he9l60oapn71e1", "1haqepgrujkpte1", "1h7daj97qhkere1", "1h408h7qsjm3pe1", "1h0l8jck2ppqne1", "1gw9apnjg0vgle1", "1gtxf04oze36je1"]
["110110101111001001101011", "2202211102201212201", "130122333110212031", "30200414324001301", "14032555531334531", "10260662353141211", "5664070362474271", "4763631711137761", "4177248169415651", "37631741796a2741", "33a4a08b98bb7a31", "30683a2605398221", "2b59b7b5448c0811", "2975e7422660c101", "27b95e997e21d9f1", "2612d60e817f23f1", "249108148a24aff1", "2303hh44ihh24af1", "21bb8a39cic805f1", "204281dc2630j0f1", "1kihga962i7ljhf1", "1kcead78b944mdf1", "1k6db74g0kcg39f1", "1k0eidn0f28895f1", "1jki67a820e4h1f1", "1jfnpbeb9f34qof1", "1jb3mq779i09alf1", "1j6comels65hnif1", "1j1o0r6p56j08ff1", "1is6a9bdrj9focf1", "1iokntsh2c63a9f1", "1il48pp1mf8pt6f1", "1ihltrvwmshig3f1", "1ie6k1e80gwd30f1", "1iarcf4todh9pxf1"]

0 件のコメント:

コメントを投稿

注: コメントを投稿できるのは、このブログのメンバーだけです。