HP 49G: Minimum Multiplier M of Integer N such that M*N Consists Only of 1's & 0's +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: HP 49G: Minimum Multiplier M of Integer N such that M*N Consists Only of 1's & 0's (/thread-14407.html) |
HP 49G: Minimum Multiplier M of Integer N such that M*N Consists Only of 1's & 0's - Gerald H - 01-24-2020 10:06 AM Surprisingly (?) every integer N is a factor of an integer P consisting solely of 1's & 0's, for the smallest N the values of P are given here: https://oeis.org/A004290 The challenge is to write an HP 49G programme to find minimal P/N. Fastest unerring programme wins. RE: HP 49G: Minimum Multiplier M of Integer N such that M*N Consists Only of 1's &... - Gerald H - 01-31-2020 02:01 AM Here my attempt for the 49G, incorporating insights of Albert Chan (as best I could). Execution time remains lamentably high, improvements expected. A non-brute force algorithm would be very useful. Name of programme: A4290 Both FPTR F 1A is internal SREPL PTR 2F3A3 is internal SIZE for integers stable from 1.19-6 to 2.10-8. Code: Size: 352.5 |