千嶂夹城
发布于 2025-08-19 / 10 阅读
0
0

115*95=10925

最近在看漫士老师视频的时候看到了评论区里这样一张图:

3ecba521d1743c97182de666e808238a13331516-1.jpg

有意思的数学巧合,解释一下就是在 10 进制下一个 n+1 位数乘以一个 n 位数,有

\overline{a_0a_1 \cdots a_n}\times\overline{b_1 \cdots b_n}=\overline{a_0c_1\cdots c_{2n}} \;且\;\forall\,i\in1,\cdots,n:\;a_i\times b_i=\overline{c_{2i-1}c_{2i}}

于是写了个 dfs 找了几个类似的案例:

一些类似的案例(9位乘8位以内)
  • 115 * 95 = 10925

  • 131 * 97 = 12707

  • 148 * 92 = 13616

  • 164 * 94 = 15416

  • 167 * 89 = 14863

  • 169 * 88 = 14872

  • 178 * 88 = 15664

  • 187 * 88 = 16456

  • 196 * 88 = 17248

  • 199 * 91 = 18109

  • 262 * 97 = 25414

  • 334 * 98 = 32732

  • 388 * 96 = 37248

  • 393 * 97 = 38121

  • 418 * 98 = 40964

  • 584 * 98 = 57232

  • 668 * 98 = 65464

  • 919 * 99 = 90981

  • 928 * 99 = 91872

  • 937 * 99 = 92763

  • 946 * 99 = 93654

  • 955 * 99 = 94545

  • 964 * 99 = 95436

  • 973 * 99 = 96327

  • 982 * 99 = 97218

  • 991 * 99 = 98109

  • 1124 * 971 = 1091404

  • 1164 * 938 = 1091832

  • 1376 * 924 = 1271424

  • 1484 * 917 = 1360828

  • 1655 * 897 = 1484535

  • 1668 * 924 = 1541232

  • 1673 * 888 = 1485624

  • 2248 * 971 = 2182808

  • 2544 * 964 = 2452416

  • 2654 * 958 = 2542532

  • 2721 * 967 = 2631207

  • 3681 * 963 = 3544803

  • 4524 * 984 = 4451616

  • 4881 * 968 = 4724808

  • 6343 * 989 = 6273227

  • 11524 * 9476 = 109201424

  • 15365 * 9445 = 145122425

  • 16524 * 8984 = 148451616

  • 17917 * 8742 = 156630414

  • 21992 * 9524 = 209451808

  • 26362 * 9642 = 254182404

  • 32955 * 9666 = 318543030

  • 35363 * 9762 = 345213606

  • 41669 * 9827 = 409481263

  • 68741 * 9783 = 672493203

  • 76558 * 9854 = 754402532

  • 83327 * 9928 = 827270456

  • 141394 * 96228 = 13606061832

  • 142741 * 95349 = 13610211609

  • 178962 * 91126 = 16308091212

  • 196539 * 92155 = 18112051545

  • 232629 * 97642 = 22714360818

  • 235184 * 96648 = 22730063232

  • 237267 * 95821 = 22735161207

  • 281595 * 96615 = 27206300925

  • 328637 * 96911 = 31848540307

  • 411984 * 99298 = 40909187232

  • 434942 * 98248 = 42732181616

  • 467381 * 97242 = 45449063202

  • 526983 * 98387 = 51848276421

  • 559168 * 97579 = 54563054272

  • 1222368 * 966331 = 1181212091808

  • 1276467 * 925547 = 1181430202449

  • 1637168 * 941386 = 1541207034848

  • 1739231 * 898542 = 1562772101202

  • 1825869 * 942461 = 1720810323609

  • 2754466 * 955728 = 2632520281248

  • 3343718 * 978798 = 3272824490964

  • 3639487 * 973249 = 3542127083263

  • 3717448 * 976676 = 3630742242848

  • 14884964 * 9142327 = 136083208271228

  • 14892734 * 9137524 = 136082714350616

  • 15617949 * 8998682 = 140540956543218

  • 23435184 * 9696648 = 227242730063232

  • 26386721 * 9632967 = 254182412631207

  • 27575322 * 9546682 = 263252830181604

  • 39876877 * 9564546 = 381404224402842

  • 49228443 * 9773647 = 481141424241621

  • 51377726 * 9912286 = 509270714141636

  • 84161397 * 9934386 = 836091804097242

  • 133628159 * 95152557 = 12715061016052563

  • 142236337 * 95686677 = 13610122436182149

  • 148868164 * 89153266 = 13272083024023624

  • 158535894 * 91513978 = 14508250315726332

  • 183827491 * 93617555 = 17209480249204505

  • 185746853 * 92655255 = 17210422030162515

  • 364128728 * 97295322 = 35428021840210416

  • 426397884 * 98143155 = 41848033621084020

  • 571381291 * 98547422 = 56308153207081802

生成这些案例的程序:

#include<queue>
#include<stack>
#include<vector>
#include<iostream>
using namespace std;
typedef long long ll;
struct Comb{
    int N,x,y;
};
constexpr ll pow10[20]={1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000,10000000000,100000000000,1000000000000,10000000000000,100000000000000,1000000000000000,10000000000000000,100000000000000000,1000000000000000000,10000000000000000000};
bool check(int N,ll x,ll y){
    for(int i=0;i<=N;i++)
    if( (x/pow10[i]%10) * (y/pow10[i]%10) != ((x*y)/pow10[2*i]%100) ) return false;
    if( x/pow10[N+1] != (x*y)/pow10[2*N+2] )  return false;
    return true;    
}
stack<Comb> q;
int main(){
    for(int i=1;i<=9;i++) for(int j=1;j<=9;j++) q.push({0,i,j});
    while(!q.empty()){
        Comb u = q.top(); q.pop(); 
        int N = u.N;ll x = u.x, y = u.y;
        if(N==8) continue;
        if(N&1) if((x/pow10[N/2]%10)*(y/pow10[N/2]%10)!=((x*y)/pow10[N-1]%100)) continue;
        if(N) for(int i=1;i<10;i++) if(check(N,i*pow10[N+1]+x,y)){
            cout<<i*pow10[N+1]+x<<'*'<<y<<'='<<(i*pow10[N+1]+x)*y<<endl;
        }
        for(int i=1;i<10;i++) for(int j=1;j<10;j++)
            q.push({N+1,(int)(i*pow10[N+1]+x),(int)(j*pow10[N+1]+y)});
    }
    return 0;
}


评论