R J Cano on Wed, 19 Jul 2023 00:20:02 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

2023-Draft_0.0.19


Hi,

in my humble opinion, this transformation currently is NOT yet known
(documented) by Mathematicians, and it looks potentially useful for
the kind of problem with matrices involved in / underlying to games of
the same type than Sudoku, Shidoku, Latin, and Latin-Greek squares
(more precisely their generation and analysis), ...

For instance, it allows to implement one unique routine for checking /
validating Sudoku-type puzzles of any size, when they are represented
as row-major vectors. By applying it, small boxes can be treat as
simple rows.

For the most simple case (when y=x), it is also found that the
transformation is reduced to swapping the middle coefficients in a
Quartic Polynomial...

 - - - - - - - - - - - -
Acknowledgement for the PARI-GP development staff, since without their
contribution efforts and excellence, probably the ease of computer
aided experimentation required in order to realize this, would not
have been possible. Merci folks :-)
- - - - - - - - - - - - - -

Cheers,

P.S.: GP source as is inside attachment file, below and until the end
of the present message...

/* R. J. Cano <bacanocano@gmail.com>; Tue, 18 Jul 2023 21:48:12 +0000
;; Let us introduce the "Inner transposition" of matrices: G[ A[i,j],
B[k,L] ] =(def.) F[ A[i,k], B[j,L] ] */

rowmaj_before_an_innertranspos(y,x)={ vector( y*x, i, i ) }

rowmaj_innertranspos_formal(y,x)={
  my(Nllvec:vec=[]:vec);
  my( z=gcd(y,x) );
  if(z==1, return(Nllvec) );
  my( s0=if(ispseudoprime(z),[z],divisors(z)), s );
  s=if(#s0==1,s0,Vecrev(s0[2..(#s0-1)]));
  if(Nllvec==s, return(Nllvec) );
   my( rmi=vector(#s) , t, u, w, q, v=vector(y*x,i,i), a=vector(y*x) );
  for(m=1,#s,
    q=0;
    a*=0;
     t=y/s[m];
     u=s[m];
     w=x/s[m];
     forvec(k=[ [1,t], [1,u], [1,u], [1,w] ],
       a[q++]= k[3] - k[2]
     ,0);
   rmi[m]= [ [t,u,w], v+(x-w)*a ];
  );
  rmi
}

rowmaj_innertranspos_simplified(y,x)={
  my(Nllvec:vec=[]:vec);
  my( z=gcd(y,x) );
  if(z==1, return(Nllvec) );
  my( s0=if(ispseudoprime(z),[z],divisors(z)), s );
  s=if(#s0==1,s0,Vecrev(s0[2..(#s0-1)]));
  if(Nllvec==s, return(Nllvec) );
   my( rmi=vector(#s) , t, u, w );
  for(m=1,#s,
    t=y/s[m];
    u=s[m];
    w=x/s[m];
    my( f=concat(Vec(matrix(u,u,i,j,i-j)))~ );
    f=concat( vector(#f,h1,vector(w,h2,f[h1]) ) );
    f=concat( vector(t,h3,f) );
    f*=(x-w);
    for(k=1,#f,f[k]+=k);
    rmi[m]=[ [t,u,w], f ]
  );
  rmi
}

/* kkeuthieyo? (Ce fini?) */
/* R. J. Cano <bacanocano@gmail.com>; Tue, 18 Jul 2023 21:48:12 +0000 ;; Let us introduce the "Inner transposition" of matrices: G[ A[i,j], B[k,L] ] =(def.) F[ A[i,k], B[j,L] ] */

rowmaj_before_an_innertranspos(y,x)={ vector( y*x, i, i ) }

rowmaj_innertranspos_formal(y,x)={
  my(Nllvec:vec=[]:vec);
  my( z=gcd(y,x) );
  if(z==1, return(Nllvec) );
  my( s0=if(ispseudoprime(z),[z],divisors(z)), s );
  s=if(#s0==1,s0,Vecrev(s0[2..(#s0-1)]));
  if(Nllvec==s, return(Nllvec) );
   my( rmi=vector(#s) , t, u, w, q, v=vector(y*x,i,i), a=vector(y*x) );
  for(m=1,#s,
    q=0;
    a*=0;
     t=y/s[m];
     u=s[m];
     w=x/s[m];
     forvec(k=[ [1,t], [1,u], [1,u], [1,w] ],
       a[q++]= k[3] - k[2]
     ,0);
   rmi[m]= [ [t,u,w], v+(x-w)*a ];
  );
  rmi
}

rowmaj_innertranspos_simplified(y,x)={
  my(Nllvec:vec=[]:vec);
  my( z=gcd(y,x) );
  if(z==1, return(Nllvec) );
  my( s0=if(ispseudoprime(z),[z],divisors(z)), s );
  s=if(#s0==1,s0,Vecrev(s0[2..(#s0-1)]));
  if(Nllvec==s, return(Nllvec) );
   my( rmi=vector(#s) , t, u, w );
  for(m=1,#s,
    t=y/s[m];
    u=s[m];
    w=x/s[m];
    my( f=concat(Vec(matrix(u,u,i,j,i-j)))~ );
    f=concat( vector(#f,h1,vector(w,h2,f[h1]) ) );
    f=concat( vector(t,h3,f) );
    f*=(x-w);
    for(k=1,#f,f[k]+=k);
    rmi[m]=[ [t,u,w], f ]
  );
  rmi
}

/* kkeuthieyo? (Ce fini?) */