Skip to content

Debdut/oeis.haskell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oeis.haskell Generic badge

Generic badge Generic badge

Collection of OEIS Number Sequences in Haskell

Samples

Hypercube Colorings

  • A333333 - Irregular triangle: T(n,k) gives the number of k-polysticks on edges of the n-cube up to isometries of the n-cube, with 0 <= k <= A001787(n)
module HypercubeColorings.A333333 (a333333) where
import Helpers.HypercubeColorings (countPolyforms)

a333333_row :: Int -> [Int]
a333333_row n = map (a333333T n) [0..n*2^(n-1)]

a333333T :: Int -> Int -> Int
a333333T n = countPolyforms n 1

a333333_list :: [Int]
a333333_list = concatMap a333333_row [1..]

a333333 :: Int -> Int
a333333 n = a333333_list !! (n - 1)

Tilings

  • A303930 - Count leaf-free subgraphs of the 2 X n grid up to horizontal and vertical flipping
module Tiling.A303930 where

a303930 :: Int -> Integer
a303930 n = a303930_list !! (n - 1)

-- A303930
a303930_list :: [Integer]
a303930_list = map (`div` 4) sumOfOrbits where
  sumOfOrbits = foldr (zipWith (+)) allCount [rotationalCount, horizontalCount, verticalCount]

-- A093129
allCount :: [Integer]
allCount = 1 : 2 : recurse 1 2 where
  recurse a b = nextTerm : recurse b nextTerm where
    nextTerm = 5 * (b - a)

-- A001519
verticalCount :: [Integer]
verticalCount = 1 : 2 : recurse 1 2 where
  recurse a b = nextTerm : recurse b nextTerm where
    nextTerm = 3 * b - a

horizontalCount :: [Integer]
horizontalCount = 1 : 2 : 3 : 7 : recurse 1 2 3 7 where
  recurse a b c d = nextTerm : recurse b c d nextTerm where
    nextTerm = 5 * (c - a)

rotationalCount :: [Integer]
rotationalCount = 1 : 2 : 3 : 5 : recurse 1 2 3 5 where
  recurse a b c d = nextTerm : recurse b c d nextTerm where
    nextTerm = 5 * (c - a)

Contents

Sources

The sequence definitons are from The Online Encyclopedia of Integer Sequences - visit OEIS

Help Me Please 🥲

Buy Me A Coffee

Follow me on Twitter

About

A Collection of OEIS Sequences in Haskell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published