Matrix power limit - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Matrix power limit (/thread-12515.html) Matrix power limit - Albert Chan - 02-27-2019 03:28 PM I am not sure about HP Prime, but XCas 1.4.9-57(win32) had a matrix power 31 bits limit. Example: Perrin Primality test qpowmod(n) := ([[0,1,1],[1,0,0],[0,1,0]] % n) ^ (n-1) perrin(n) := dot(qpowmod(n)(2), [2,0,3]) == 0 map(range(2, 10), x -> x * perrin(x)) ==> [2, 3, 0, 5, 0, 7, 0, 0] However, the code will not work for n > 2^31 perrin(9876543211) ==> "Abs Error: Bad Argument Type" To fix it, need another matpow version that can handle bigger n: matpow2hlp(a, n, half) := ifte(odd(n), a*half, half) * half matpow2(a, n) := ifte(n<2^31, a^n, matpow2hlp(a, n, matpow2(a, n div 2))) qpowmod2(n) := matpow2([[0,1,1],[1,0,0],[0,1,0]] % n, n-1) perrin2(n) := dot(qpowmod2(n)(2), [2,0,3]) == 0 perrin2(9876543211) ==> true Update: it seems the limit is not really due to matrix power, but the modulo. RE: Matrix power limit - Joe Horn - 02-27-2019 05:51 PM HP Prime in CAS view: []^(2^8198) --> [] []^(2^8199) --> undef
{"ft_lang_label":"__label__en","ft_lang_prob":0.5496874,"math_prob":0.996339,"size":1230,"snap":"2022-40-2023-06","text_gpt3_token_len":487,"char_repetition_ratio":0.123164766,"word_repetition_ratio":0.010526316,"special_character_ratio":0.46829268,"punctuation_ratio":0.23548387,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98776174,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-01T15:57:27Z\",\"WARC-Record-ID\":\"<urn:uuid:a62ad207-3903-43cb-9d33-8a1671302503>\",\"Content-Length\":\"3522\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c5ec879b-a12b-4c6d-941f-1f4b8a03d91c>\",\"WARC-Concurrent-To\":\"<urn:uuid:8cfe66ca-22be-480a-b2ab-a4dafccf93f1>\",\"WARC-IP-Address\":\"209.197.117.170\",\"WARC-Target-URI\":\"https://hpmuseum.org/forum/printthread.php?tid=12515\",\"WARC-Payload-Digest\":\"sha1:CH2P7M5DKGKJ2BT4FUN7GOKARF7OWA32\",\"WARC-Block-Digest\":\"sha1:MV66QEZW2BNMH2264YTU3JVD3OKD2L5Y\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764499946.80_warc_CC-MAIN-20230201144459-20230201174459-00303.warc.gz\"}"}