Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Calculations of the OEIS sequences A227722 (SecList) and A227723 (BecList)
- % If not stopped manually, these scripts check all the 2^32 5-ary Boolean functions,
- % which would probably take some weeks.
- % BitPerm32 = oeis.org/A195665/a195665_3.txt
- BitPerm32 = BitPerm32(1:120,1:32) + 1 ;
- SecPerm32 = zeros(32) ;
- for m=1:32
- for n=1:32
- SecPerm32(m,n) = bitxor(m-1,n-1) ;
- end
- end
- SecPerm32 = SecPerm32 + 1 ;
- BecPerm32 = zeros(3840,32) ;
- for m=1:120
- for n=1:32
- BecPerm32( (m-1)*32 + n , 1:32 ) = SecPerm32( n , BitPerm32(m,:) ) ;
- end
- end
- Powtwo32 = zeros(32,1) ;
- for m=0:31
- Powtwo32(32-m) = 2^m ;
- end
- Bin16char = dec2bin(0:65535) ;
- Bin16 = false(65536,16) ;
- for m=1:65536
- for n=1:16
- Bin16(m,n) = str2double( Bin16char(m,n) ) ;
- end
- end
- clear Bin16char
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % SecList
- SecList = 0 ;
- SecListLong = 1 ;
- for m=1:65536
- Bin32 = [ repmat(Bin16(m,:),65536,1) Bin16 ] ;
- for n=1:65536
- F = Bin32(n,:) ;
- Sec = selfintersect( F(SecPerm32) ) ;
- Candidate = Sec(1,:)*Powtwo32 ;
- if Candidate > SecList(end)
- SecList(end+1) = Candidate ;
- SecListLong = SecListLong + 1
- end
- end
- end
- % BecList
- LastSec = 0 ;
- BecList = 0 ;
- BecListLong = 1 ;
- for m=1:65536
- Bin32 = [ repmat(Bin16(m,:),65536,1) Bin16 ] ;
- for n=1:65536
- F = Bin32(n,:) ;
- Sec = selfintersect( F(SecPerm32) ) ;
- PreCandidate = Sec(1,:)*Powtwo32 ;
- if PreCandidate > LastSec
- LastSec = PreCandidate ;
- Bec = selfintersect( F(BecPerm32) ) ;
- Candidate = Bec(1,:)*Powtwo32 ;
- if Candidate > BecList(end)
- BecList(end+1) = Candidate ;
- BecListLong = BecListLong + 1
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement