Portability | probably portable |
---|---|
Stability | experimental |
Maintainer | drewday@gmail.com |
- Silly Streams
- Simple Streams
- The Family of Fibionacci (and Lucas!)
- Padovans and Perrins, and Pells
- Who invited the J's?
- Basically Binary (Base 2)
- Fractals
- The Zoo
- Moser-de-Bruijn sequence
- Fermi Dirac Numbers
- 5-Smooth (Hamming) (Regular) Numbers
- Dunno this one either?
- Carry Bits
- Non-Negative Integers. Repeated. Floor (n/2)
- Square Pyramidal Numbers
- The Perturbation Method
- iterate k = 2^n-k
- What the heck is this?
- Horadam (0,1,4,2) Numbers
- Some random thing I found.
This module is an attempt to construct many and varied examples of Rivers and Streams. At the moment, the concept of what Rivers are (or are not) is not entirely clear in the mind of any particular person on Earth, myself foremost amoung the befuddled.
Primarily because I lay claim to inventing the idea, this is a worrisome situation. Nevertheless, whatever these things are, regular old Data.Stream streams (and kin) are subsets (or sub-classes, or.. sub-something) of these things, and hence they must qualify to be mapped in this ecosystem (by definition).
As of now, these example originate primarily from three excellent papers on Streams and their properties. More precisey, they originate from my haphazard and occasionally mindless transcription of what I saw from these documents. Therefore, the authors of the following papers deserve much of the credit, but bear none of the responsibility of the contents of this module.
CONTRACTIVE
- Graham Hutton and Mauro Jaskelioff, "Representing contractive functions on streams",
- Submitted to the Journal of Functional Programming (October 2011).
- Link: http://www.cs.nott.ac.uk/~gmh/bib.html#contractive
- PDF: http://www.cs.nott.ac.uk/~gmh/contractive.pdf
PEARL-UFP
- Ralph Hinze, "Functional pearl: streams and unique fixed points".
- Proceedings of the 13th ACM SIGPLAN international conference on Functional Programming (ICFP '08) (22-24 September 2008). pp. 189-200. (c) ACM
- Link: http://www.cs.ox.ac.uk/ralf.hinze/publications/index.html#B9
- PDF: http://www.cs.ox.ac.uk/ralf.hinze/publications/ICFP08.pdf
PROVING-UFP
- Ralf Hinze and Daniel W. H. James, "Proving The Unique Fixed-Point Principle Correct"
- Proceeding of the 16th ACM SIGPLAN international conference on Functional programming (ICFP '11) (September 2011). pp. 359-371. (c) ACM
- Link: http://www.cs.ox.ac.uk/people/daniel.james/unique.html
- PDF: http://www.cs.ox.ac.uk/people/daniel.james/unique/unique-conf.pdf
This module should clearly document the behavior of all functions. In fact, the code in this module is generally not intended to be imported and used directly. Instead the purpose of this module is to:
- show *many* examples of Streams, especially non-trivial ones (ie, more complicated than
fibionacci
) - provide visual (and eventually, pictoral) *proof* of equality (insofar that this is possible)
- ... more things
- ... should go here
- ... becuase there's a point to all of this, right?
Note: To accomidate the documentation, the text-width of this document is 129 characters.
As a witness to the correctness of the examples, I include the result of running doctest:
$ doctest Data/Rivers/Ecology.hs Cases: 74 Tried: 74 Errors: 0 Failures: 0
- sZero :: S Integer
- gZero :: G Integer Integer
- rZero :: G Integer Integer
- cZero :: S Integer
- cZeroH :: Num a => ([a], Int) -> a
- cZeroT :: Num t => ([a], t) -> a -> ([a], t)
- sOne :: S Integer
- sOnes :: S Integer
- gOne :: G Integer Integer
- gOne' :: G Integer Integer
- rOne :: G Integer Integer
- cOne :: S Integer
- cOneH :: t -> t
- cOneT :: t -> t -> t
- sNat :: S Integer
- sNatIt :: S Integer
- natnat :: S Integer
- gNat :: G Integer Integer
- gNat' :: [a] -> Int
- rNat :: G Integer Integer
- cNat :: S Integer
- cNatH :: t -> t
- cNatT :: Num a => a -> t -> a
- bin :: S Integer
- revPowersOfN2 :: S Integer
- a122803 :: G Integer Integer
- pot :: S Bool
- revPowersOf3 :: S Integer
- pothree :: G Integer Integer
- a000290 :: S Integer
- sFac :: S Integer
- sFib :: S Integer
- sFib2 :: S Integer
- revGfibs :: G Integer Integer
- cFib :: S Integer
- cFibH :: (a, b) -> a
- cFibT :: Num a => (a, a) -> a -> (a, a)
- gFibs :: G Integer Integer
- sLucas :: S Integer
- rLucas :: G Integer Integer
- fib4np1 :: S Integer
- luc4np1 :: S Integer
- fib2n :: S Integer
- luc2n :: S Integer
- fibpfib :: S Integer
- dxFib :: S Integer
- dxLucas :: S Integer
- padovanPP11010 :: S Integer
- padovan :: S Integer
- rpadovan :: G Integer Integer
- d2xpadovan :: S Integer
- perrin :: S Integer
- rperrin :: G Integer Integer
- cPell :: S Integer
- cPellH :: (a, a) -> a
- cPellT :: Num a => (a, a) -> a -> (a, a)
- rpell :: G Integer Integer
- jacob :: S Integer
- rjacob :: G Integer Integer
- jacobl :: S Integer
- rjacobl :: G Integer Integer
- jos :: S Integer
- josAlt :: S Integer
- msb :: S Integer
- athue :: S Integer
- thue :: S Integer
- thue' :: S Integer
- binlike1 :: S Integer
- binlike2 :: S Integer
- lsb :: S Integer
- sumcarry :: S Integer
- apolloD2 :: Floating a => [a] -> a
- apolloD2alt :: Floating a => [a] -> a
- apd2 :: Floating a => [a] -> a
- fr :: Num t => (t, t, t, t, t, t, t, t) -> (t, t, t, t, t, t, t, t)
- apd3 :: Coalg (Integer, (Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer)) Integer Integer
- proy :: (a, a, a, a, a, a, a, a) -> Integer -> a
- streamApD3 :: S Integer
- streamApD3' :: S (Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer)
- frac :: S Integer
- god :: S Integer
- blah :: S Integer
- hamming :: S Integer
- montest :: S Integer
- a092323 :: S Integer
- carry :: S Integer
- altCarry :: S Integer
- tree :: Integral a => a -> S a
- a004526 :: S Integer
- a000330 :: S Integer
- iterk2nk :: S Integer
- iterk2nkH :: (a, b) -> a
- iterk2nkT :: Num a => (a, a) -> a -> (a, a)
- a090017 :: G Integer Integer
- horadam0142 :: G Integer Integer
- a002605 :: G Integer Integer
Silly Streams
Constant Zeroes
>>>
stake 30 $ sZero
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
gZero :: G Integer IntegerSource
>>>
stake 30 $ fwdFix gZero
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
rZero :: G Integer IntegerSource
>>>
stake 30 $ revFix rZero
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
>>>
stake 30 $ cZero
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
Constant Ones
Believe it or not, this is in OEIS:
>>>
take 30 $ fromOEIS "A000012"
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
>>>
stake 30 $ sOne
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
>>>
stake 30 $ sOnes
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
gOne' :: G Integer IntegerSource
>>>
stake 30 $ fwdFix gOne
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
rOne :: G Integer IntegerSource
>>>
stake 30 $ revFix rOne
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
>>>
stake 30 $ cOne
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
The Natural Numbers
>>>
take 30 $ fromOEIS "A000027"
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
>>>
stake 30 $ sNat
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]
>>>
stake 30 $ siterate (+1) 0
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]
>>>
stake 30 $ natnat
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]
>>>
stake 30 $ fwdFix gNat
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]
rNat :: G Integer IntegerSource
>>>
stake 30 $ revFix rNat
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]
>>>
stake 30 $ cNat
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]
Natural Numbers from Binary
>>>
stake 30 $ bin
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]
Simple Streams
Power Streams
Powers of (-2)
revPowersOfN2 :: S IntegerSource
>>>
take 15 $ fromOEIS "A122803"
[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384]
>>>
stake 15 $ revPowersOfN2
[1,-2,4,-8,16,-32,64,-128,256,-512,1024,-2048,4096,-8192,16384]
Powers of (2) - Bool
>>>
stake 15 $ pot
[True,True,False,True,False,False,False,True,False,False,False,False,False,False,False]
Powers of (3)
revPowersOf3 :: S IntegerSource
>>>
take 15 $ fromOEIS "A000244"
[1,3,9,27,81,243,729,2187,6561,19683,59049,177147,531441,1594323,4782969]
>>>
stake 15 $ revPowersOf3
[1,3,9,27,81,243,729,2187,6561,19683,59049,177147,531441,1594323,4782969]
Squares
>>>
take 30 $ fromOEIS "A000290"
[0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361,400,441,484,529,576,625,676,729,784,841]
>>>
stake 30 $ bsum $ 2 * sNat + 1
[0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361,400,441,484,529,576,625,676,729,784,841]
Factorial Numbers
>>>
take 10 $ fromOEIS "A000142"
[1,1,2,6,24,120,720,5040,40320,362880]
>>>
stake 10 $ sFac
[1,1,2,6,24,120,720,5040,40320,362880]
The Family of Fibionacci (and Lucas!)
Forever Fibionacci
>>>
take 29 $ fromOEIS "A000045"
[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811]
>>>
stake 29 $ sFib
[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811]
>>>
stake 29 $ sFib2
[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811]
revGfibs :: G Integer IntegerSource
>>>
stake 29 $ revFix revGfibs
[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811]
cFibT :: Num a => (a, a) -> a -> (a, a)Source
>>>
stake 29 $ cFib
[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811]
gFibs :: G Integer IntegerSource
>>>
stake 29 $ fwdFix gFibs
[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811]
Lonely Lucas
>>>
take 28 $ fromOEIS "A000032"
[2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204]
>>>
stake 28 $ sLucas
[2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204]
rLucas :: G Integer IntegerSource
>>>
stake 28 $ revFix rLucas
[2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204]
under (4*n + 1)
The Fibionacci (4n + 1) and Lucas (4n + 1) numbers
drop0L is evidently a bisect twice function
>>>
stake 10 $ drop0L sFib
[1,5,34,233,1597,10946,75025,514229,3524578,24157817]
>>>
take 10 $ fromOEIS "A033889"
[1,5,34,233,1597,10946,75025,514229,3524578,24157817]
>>>
stake 10 $ drop0L sLucas
[1,11,76,521,3571,24476,167761,1149851,7881196,54018521]
>>>
take 10 $ fromOEIS "A056914"
[1,11,76,521,3571,24476,167761,1149851,7881196,54018521]
under (2*n)
The Fib (2*n) and Lucas (2*n) numbers
dromIp1L is evidently a bisect function
>>>
stake 20 $ dropIp1L sFib
[0,1,3,8,21,55,144,377,987,2584,6765,17711,46368,121393,317811,832040,2178309,5702887,14930352,39088169]
>>>
take 20 $ fromOEIS "A001906"
[0,1,3,8,21,55,144,377,987,2584,6765,17711,46368,121393,317811,832040,2178309,5702887,14930352,39088169]
>>>
stake 20 $ dropIp1L sLucas
[2,3,7,18,47,123,322,843,2207,5778,15127,39603,103682,271443,710647,1860498,4870847,12752043,33385282,87403803]
>>>
take 20 $ fromOEIS "A005248"
[2,3,7,18,47,123,322,843,2207,5778,15127,39603,103682,271443,710647,1860498,4870847,12752043,33385282,87403803]
under (sum)
>>>
stake 21 $ [1] <<| plus sFib sFib
[1,0,2,2,4,6,10,16,26,42,68,110,178,288,466,754,1220,1974,3194,5168,8362]
>>>
take 21 $ fromOEIS "A006355"
[1,0,2,2,4,6,10,16,26,42,68,110,178,288,466,754,1220,1974,3194,5168,8362]
under (diff)
>>>
take 20 $ fromOEIS "A039834"
[1,1,0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597]
>>>
stake 20 $ [1] <<| diff sFib
[1,1,0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597]
>>>
take 20 $ fromOEIS "A061084"
[1,2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778]
>>>
stake 20 $ diff sLucas
[-1,2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778]
Padovans and Perrins, and Pells
Padovan
padovanPP11010 :: S IntegerSource
>>>
take 30 $ fromOEIS "A000931"
[1,0,0,1,0,1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616]
>>>
stake 30 $ padovanPP11010
[1,0,0,1,0,1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616]
>>>
take 30 $ fromOEIS "A134816"
[1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616,816,1081,1432,1897,2513]
>>>
stake 30 $ padovan
[1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616,816,1081,1432,1897,2513]
rpadovan :: G Integer IntegerSource
>>>
stake 30 $ revFix rpadovan
[1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616,816,1081,1432,1897,2513]
>>>
take 31 $ fromOEIS "A133034"
[1,0,1,1,1,0,0,1,0,1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265]
>>>
stake 30 $ diff $ diff $ revFix rpadovan
[0,1,-1,1,0,0,1,0,1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265]
Perrin
>>>
take 30 $ fromOEIS "A001608"
[3,0,2,3,2,5,5,7,10,12,17,22,29,39,51,68,90,119,158,209,277,367,486,644,853,1130,1497,1983,2627,3480]
>>>
stake 30 $ perrin
[3,0,2,3,2,5,5,7,10,12,17,22,29,39,51,68,90,119,158,209,277,367,486,644,853,1130,1497,1983,2627,3480]
rperrin :: G Integer IntegerSource
>>>
stake 30 $ revFix rperrin
[3,0,2,3,2,5,5,7,10,12,17,22,29,39,51,68,90,119,158,209,277,367,486,644,853,1130,1497,1983,2627,3480]
Pell
Generating Function:
z -------------------- z^2 + 2z - 1
>>>
take 20 $ fromOEIS "A000129"
[0,1,2,5,12,29,70,169,408,985,2378,5741,13860,33461,80782,195025,470832,1136689,2744210,6625109]
cPellT :: Num a => (a, a) -> a -> (a, a)Source
>>>
stake 20 $ cPell
[0,1,2,5,12,29,70,169,408,985,2378,5741,13860,33461,80782,195025,470832,1136689,2744210,6625109]
rpell :: G Integer IntegerSource
>>>
stake 20 $ revFix rpell
[0,1,2,5,12,29,70,169,408,985,2378,5741,13860,33461,80782,195025,470832,1136689,2744210,6625109]
Who invited the J's?
Jacobsthal Sequence
>>>
take 20 $ fromOEIS "A001045"
[0,1,1,3,5,11,21,43,85,171,341,683,1365,2731,5461,10923,21845,43691,87381,174763]
>>>
stake 20 $ jacob
[0,1,1,3,5,11,21,43,85,171,341,683,1365,2731,5461,10923,21845,43691,87381,174763]
rjacob :: G Integer IntegerSource
>>>
stake 20 $ revFix rjacob
[0,1,1,3,5,11,21,43,85,171,341,683,1365,2731,5461,10923,21845,43691,87381,174763]
Jacobsthal-Lucas Sequence
>>>
take 20 $ fromOEIS "A014551"
[2,1,5,7,17,31,65,127,257,511,1025,2047,4097,8191,16385,32767,65537,131071,262145,524287]
>>>
stake 20 $ jacobl
[2,1,5,7,17,31,65,127,257,511,1025,2047,4097,8191,16385,32767,65537,131071,262145,524287]
rjacobl :: G Integer IntegerSource
>>>
stake 20 $ revFix rjacobl
[2,1,5,7,17,31,65,127,257,511,1025,2047,4097,8191,16385,32767,65537,131071,262145,524287]
Josephus Numbers
>>>
take 30 $ drop 1 $ fromOEIS "A006257"
[1,1,3,1,3,5,7,1,3,5,7,9,11,13,15,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29]
>>>
stake 30 $ jos
[1,1,3,1,3,5,7,1,3,5,7,9,11,13,15,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29]
>>>
stake 30 $ josAlt
[1,1,3,1,3,5,7,1,3,5,7,9,11,13,15,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29]
Basically Binary (Base 2)
Most Significant Bit
>>>
take 30 $ drop 1 $ fromOEIS "A053644"
[1,2,2,4,4,4,4,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]
>>>
stake 30 $ msb
[1,2,2,4,4,4,4,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]
Thue-Morse Sequence
>>>
take 30 $ fromOEIS "A010060"
[0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0]
>>>
stake 30 $ athue
[0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0]
>>>
stake 30 $ thue
[0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0]
Something with twos!
>>>
stake 30 $ binlike1
[0,1,0,1,2,0,0,1,2,2,4,0,0,0,0,1,2,2,4,2,4,4,8,0,0,0,0,0,0,0]
Something with twos! (2)
>>>
stake 30 $ binlike2
[0,1,1,0,1,2,0,2,1,0,2,2,0,4,2,0,1,4,0,2,2,0,2,4,0,4,4,0,2,8]
Who knows what this is?
>>>
take 30 $ fromOEIS "A000035"
[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
>>>
stake 30 $ bsum 0 |~| 1
[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
Binary Sum Carry
>>>
take 30 $ fromOEIS "A011371"
[0,0,1,1,3,3,4,4,7,7,8,8,10,10,11,11,15,15,16,16,18,18,19,19,22,22,23,23,25,25]
>>>
stake 30 $ sumcarry
[0,0,1,1,3,3,4,4,7,7,8,8,10,10,11,11,15,15,16,16,18,18,19,19,22,22,23,23,25,25]
Fractals
Apollonian Fractal
D2: (-1,2,2,3)
apolloD2 :: Floating a => [a] -> aSource
>>>
take 20 $ fromOEIS "A060790"
[1,2,2,3,15,38,110,323,927,2682,7754,22403,64751,187134,540822,1563011,4517183,13054898,37729362,109039875]
>>>
stake 20 $ revFix apolloD2
[2.0,2.0,3.0,15.0,38.0,110.0,323.0,927.0,2682.0,7754.0,22403.0,64751.0,187134.0,540822.0,1563011.0,4517183.0,1.3054898e7,3.7729362e7,1.09039875e8,3.15131087e8]
apolloD2alt :: Floating a => [a] -> aSource
>>>
stake 20 $ revFix apolloD2alt
[2.0,2.0,3.0,-1.0,2.0,2.0,3.0,-1.0,2.0,2.0,3.0,-1.0,2.0,2.0,3.0,-1.0,2.0,2.0,3.0,-1.0]
D3: (-0,0,1,1)
apd3 :: Coalg (Integer, (Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer)) Integer IntegerSource
>>>
stake 32 $ streamApD3
[0,0,1,1,1,2,2,3,4,8,9,9,15,32,32,33,56,120,121,121,209,450,450,451,780,1680,1681,1681,2911,6272,6272,6273]
streamApD3' :: S (Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer)Source
>>>
stake 4 $ streamApD3'
[(0,0,1,1,1,2,2,3),(4,8,9,9,15,32,32,33),(56,120,121,121,209,450,450,451),(780,1680,1681,1681,2911,6272,6272,6273)]
Some Fractal Numbers
>>>
take 30 $ fromOEIS "A025480"
[0,0,1,0,2,1,3,0,4,2,5,1,6,3,7,0,8,4,9,2,10,5,11,1,12,6,13,3,14,7]
>>>
stake 30 $ frac
[0,0,1,0,2,1,3,0,4,2,5,1,6,3,7,0,8,4,9,2,10,5,11,1,12,6,13,3,14,7]
Greatest Odd Divisor
>>>
take 30 $ fromOEIS "A000265"
[1,1,3,1,5,3,7,1,9,5,11,3,13,7,15,1,17,9,19,5,21,11,23,3,25,13,27,7,29,15]
>>>
stake 30 $ god
[1,1,3,1,5,3,7,1,9,5,11,3,13,7,15,1,17,9,19,5,21,11,23,3,25,13,27,7,29,15]
Dunno
The Zoo
Moser-de-Bruijn sequence
Fermi Dirac Numbers
5-Smooth (Hamming) (Regular) Numbers
>>>
take 30 $ fromOEIS "A051037"
[1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,25,27,30,32,36,40,45,48,50,54,60,64,72,75,80]
>>>
stake 30 $ hamming
[1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,25,27,30,32,36,40,45,48,50,54,60,64,72,75,80]
Dunno this one either?
>>>
take 30 $ fromOEIS "A092323"
[0,1,1,3,3,3,3,7,7,7,7,7,7,7,7,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
>>>
stake 30 $ (diff sNat - msb)
[0,-1,-1,-3,-3,-3,-3,-7,-7,-7,-7,-7,-7,-7,-7,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15]
Carry Bits
>>>
take 30 $ fromOEIS "A007814"
[0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1]
>>>
stake 30 $ carry
[0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1]
tree :: Integral a => a -> S aSource
>>>
stake 30 $ tree 0
[0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1]
Non-Negative Integers. Repeated. Floor (n/2)
>>>
take 30 $ fromOEIS "A004526"
[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14]
>>>
stake 30 $ a004526
[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14]
Square Pyramidal Numbers
>>>
take 16 $ 0 : fromOEIS "A000330"
[0,0,1,5,14,30,55,91,140,204,285,385,506,650,819,1015]
>>>
stake 16 $ a000330
[0,0,1,5,14,30,55,91,140,204,285,385,506,650,819,1015]
The Perturbation Method
iterate k = 2^n-k
>>>
take 21 $ 1 : fromOEIS "A078008"
[1,1,0,2,2,6,10,22,42,86,170,342,682,1366,2730,5462,10922,21846,43690,87382,174762]
iterk2nkT :: Num a => (a, a) -> a -> (a, a)Source
>>>
stake 21 $ [1,1] <<| iterk2nk
[1,1,0,2,2,6,10,22,42,86,170,342,682,1366,2730,5462,10922,21846,43690,87382,174762]
What the heck is this?
a090017 :: G Integer IntegerSource
>>>
take 15 $ fromOEIS "A090017"
[0,1,4,18,80,356,1584,7048,31360,139536,620864,2762528,12291840,54692416,243353344]
>>>
stake 15 $ revFix a090017
[0,1,4,18,80,356,1584,7048,31360,139536,620864,2762528,12291840,54692416,243353344]
Horadam (0,1,4,2) Numbers
horadam0142 :: G Integer IntegerSource
>>>
take 15 $ fromOEIS "A085449"
[0,1,2,8,24,80,256,832,2688,8704,28160,91136,294912,954368,3088384]
>>>
stake 15 $ revFix horadam0142
[0,1,2,8,24,80,256,832,2688,8704,28160,91136,294912,954368,3088384]