Jump to content

Yellowstone sequence: Difference between revisions

m
m (→‎{{header|Haskell}}: (Pruned out a redundant language extension))
Line 177:
(Plotting tested only on Haskell for Mac).
 
<lang haskell>{-#import LANGUAGEqualified FlexibleContextsGraphics.SVGFonts.ReadFont #-}as F
 
module Yellowstone where
 
import qualified Graphics.SVGFonts.ReadFont as F
import Graphics.Rendering.Chart.Backend.Diagrams
import Graphics.Rendering.Chart.Easy
Line 188 ⟶ 184:
import Codec.Picture
import Control.Arrow (second)
 
------------------YELLOWSTONE PERMUTATION------------------
yellowstone :: [Integer]
Line 202 ⟶ 198:
in (p1, n, residue)
active (_, x, _) = x
 
relativelyPrime :: Integer -> Integer -> Bool
relativelyPrime a b = 1 == gcd a b
 
----------30 FIRST TERMS, AND CHART OF FIRST 100-----------
main :: IO (Image PixelRGBA8)
Line 214 ⟶ 210:
chartRender env $
plot (line "Yellowstone terms" [zip [1 ..] (take 100 yellowstone)])
 
---------------------CHART GENERATION----------------------
chartRender
Line 223 ⟶ 219:
in renderDia Rasterific (RasterificOptions (mkWidth width)) $
fst $ runBackendR env (toRenderable (execEC ec))
 
------------------------ LOCAL FONT------------------------
chartEnv :: IO (DEnv Double)
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.