Rollover 2017

2017 in A134169

Another year has arrived! 2017 is prime, so it occurs a lot in the Online Encyclopedia of Integer Sequences. I visualized one that isn't dependent on its primality: A134169. Haskell code below:

{-# LANGUAGE FlexibleContexts #-}
import Prelude hiding (null)

import Data.Bits (bit, finiteBitSize, testBit, (.&.))

import Data.Set (Set)
import qualified Data.Set as S

import Diagrams.Prelude hiding (intersection)
import Diagrams.Backend.PGF.CmdLine (B, defaultMain)

type Z = Int
type S = Int
type P = Set S

intersection :: S -> S -> S
intersection = (.&.)

isSubsetOf :: S -> S -> Bool
x `isSubsetOf` y = (x `intersection` y) == x

isProperSubsetOf :: S -> S -> Bool
x `isProperSubsetOf` y = (x `isSubsetOf` y) && x /= y

null :: S -> Bool
null x = x == 0

member :: Z -> S -> Bool
member i x = testBit x i

toList :: S -> [Z]
toList x = [ i | i <- [0 .. finiteBitSize x - 1], i `member` x ]

nset :: Z -> S
nset n = bit n - 1

npower :: Z -> P
npower n = S.fromList [0 .. bit n - 1]

data T = A | B | C | D

t :: S -> S -> Maybe T
t x y
  | y > x = Nothing
  |      null (x `intersection` y)  && not (x `isSubsetOf` y) && not (y `isSubsetOf` x) = Just A
  | not (null (x `intersection` y)) && not (x `isSubsetOf` y) && not (y `isSubsetOf` x) = Just B
  | not (null (x `intersection` y)) && ((x `isProperSubsetOf` y) || (y `isProperSubsetOf` x)) = Just C
  | x == y = Just D
  | otherwise = Nothing

label is x = [ square 2 # strokeP # lc black # fc (if i `member` x then black else white) # pad 2 Rx i

toListe5 n = member` x then black else white) # pad 2 Rx_vc: <$  # pad(rdiv>= m$ teBitSis)>y # pad 2
labhc: <$  # pad(          teBitSis)&== withEnvesual' | yfaultMaybeNothinfaultMaybeNothinfaultMayb withEnvesual' = withEnvesual

ref= | yg
  |  eNothinfaultMayb ref= strokeP = withEnvesual' ((if i `m) padpty ref= (on` y)othecircle 1ember` x then blred ref= (on` yBothetriangl `memb23_cerXYember` x then blgreen ref= (on` yCothe(if i `member` x then blriptnta ref= (on` yDothe(p2 (-1, -1) ~~ p2 (1, 1) `017p` p2 (1, -1) ~~ p2 (-1, 1))hen blacul

daultMayta TlwL 5_a5 ._vc: <$x =(bhc: <$ (++[withEnvesual' (y # pad 20) padpty])fc ) # pad 2 Rothi else S.teBitSip ] ) :x =[bhc: <$ (++[y # pad 2
])fc ref= (   nu` x then blahi else S.teBitSip ] (x `ielse S.teBitSip ]x =wquae
    pa T 1]

dat
    sa T ; P
n

keyf Ib c dRx_vc: x =[bref= (on` yDotx then bl C
dx =, ref= (on` y)otx then bl C
ax =, ref= (on` yBotx then bl C
bx =, ref= (on` yCotx then bl C
cx =]emberity 8y
 xtRx_amsgnedTl)
 0 5_5mbee P1 [0 .. bit nIO ()bee P1 ta T Int
type P<$x =ldingthet)
 "$ahi\\capx ` the i\\adpty; P
\\we02_ahi\\p;&\\sJust eqx `\\we02_ahi\\p;&\\sJpst eqx `$"
      bthet)
 "$ahi\\capx `\\peqx\\adpty; P
\\we02_ahi\\p;&\\sJust eqx `\\we02_ahi\\p;&\\sJpst eqx `$"
      cthet)
 "$ahi\\capx `\\peqx\\adpty; P
\\we02_a\\left(ahi\\sJust x `\\veeahi\\sJpst x `\\rular)`$"
      dthet)
 "$ahi=x `$"
      mi=x2^(: S -) * (2^: S -) +S.f      countthet)
 $ "$a" ++ show mi++ "`$"
      EIS)Rx_amsgnedTl)
 0 5 "\\phantom{.} low: /s arrived
   P< bgmember ._then1.1 ._23_cerXYe$
        amsgnBR (amsgnBL (daultMaytamb23_cerXY)
        `017p`
        amsgnBL (keyf Ib c dRmb23_cerXY)
        ===
        amsgnTL ((es.htYn1.1 l C
countotx boldemberity 96))
        `017p`
        amsgnBR (rotf="p(90 @@T Ig) (EIS)Rx boldemberity 8alifee P [0 IO ()bee PRx_ee P1 6Fle}
i
  • 169" sumsclopup S workkeP on my/projrSus nsmpro"ear0Seqm,_ee | ] .Backcross-ef="sNGUtween0SeqmndePlayBack around7-01e.htmlacknew rokePs teondeAnd7peritylackand7exhi t lackand7pularitkeP w toLopB, du nsiecursli> (nucrt ely, quae i `a few projrSu ideas Flexibdcontdt>ccatitt169d>Blockabout cI v Audio platrityatitdontdt>cheettitt169d>Makquo it-ion<7-03-22_ic Pst/10/ onmanramatitdontdt>arity9">Blockabout Sequup08_rd >
    {-GUI (GTK, OpenGL)Nwith s.orPdncyns.Pcesenta  Thf="fabout how to0pularitclopccurn  Pstallesent
    nperhapsNwithiteuchberreenndeAlso roke"fabout rity ularity0">hgmpa tt169d>Battle-toLi my/AGE-ydivl >
    {-b
    
    .Bacs te GMP by wrt lac
    FFI wraprity f7-0my/Marity3"><-
  • Wi>{-also rli>
    {-MPFR ribrary te choose?titdontdt>incips:/ttitt169d>Try te makquy7">  Bloc
    about 3-23_cuup08_rs te Sequ on itssesentk onSequctor2_eng ntorus ity2">larity3"><-booktitt169d>C>
    
  • e work/oeiSequreboot> Blocfabout itatitdontdt>larity3"><-*titt169d>Addknew algort hmscccuI unc/a><7Seqm,_docue nu7Seq exitSBackc LAN(with refuaedepe to0parity wquaenpossing ),_eoaenexy `lecatitdontdt>pularity8">Figuaenout how to0ef="2Nwith larity3"><-ritturb017-atitdontdt>p
  • C>
  • e hte5lackat Sequc LANtryBackto0speedclopup enref=ite run P time Mon/oeimy/dware Figuaenout how to0Type" c Sequbottleneckcatitdontdt>pool-par>Docue nu7and7annre">a tt169d>Blockabout Sequ3-23_cubug-fixpe to0my/e thrnt xAhtml"> down>ohee-atitdont/dcontass="title">Rollover 20separ017-">tass="title">itle">Rollover 20footv>