module Music.Theory.Math.Oeis where
import Data.Bits
import Data.Char
import Data.List
import Data.Ratio
import qualified Data.Set as Set
import qualified Data.MemoCombinators as Memo
import qualified Music.Theory.Math as Math
import qualified Music.Theory.Math.Prime as Prime
a000005 :: Integral n => [n]
a000005 :: forall n. Integral n => [n]
a000005 = forall a b. (a -> b) -> [a] -> [b]
map (forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
product forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
+ n
1) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Integral n => n -> [n]
a124010_row) [n
1..]
a000010 :: Integral n => [n]
a000010 :: forall n. Integral n => [n]
a000010 = forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
a000010_n [n
1 ..]
a000010_n :: Integral n => n -> n
a000010_n :: forall n. Integral n => n -> n
a000010_n n
n = forall i a. Num i => [a] -> i
genericLength (forall a. (a -> Bool) -> [a] -> [a]
filter (forall a. Eq a => a -> a -> Bool
==n
1) (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Integral a => a -> a -> a
gcd n
n) [n
1..n
n]))
a000012 :: Num n => [n]
a000012 :: forall n. Num n => [n]
a000012 = forall a. a -> [a]
repeat n
1
a000031 :: Integral n => [n]
a000031 :: forall n. Integral n => [n]
a000031 = forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
a000031_n [n
0..]
a000031_n :: Integral n => n -> n
a000031_n :: forall n. Integral n => n -> n
a000031_n n
n =
if n
n forall a. Eq a => a -> a -> Bool
== n
0
then n
1
else let divs :: [n]
divs = forall n. Integral n => n -> [n]
a027750_row n
n
in ((forall a. Integral a => a -> a -> a
`div` n
n) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(*) (forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
a000010_n [n]
divs) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map (n
2 forall a b. (Num a, Integral b) => a -> b -> a
^) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. [a] -> [a]
reverse) [n]
divs
a000032 :: Num n => [n]
a000032 :: forall n. Num n => [n]
a000032 = n
2 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000032 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000032)
a000040 :: Integral n => [n]
a000040 :: forall n. Integral n => [n]
a000040 =
let base :: [n]
base = [n
2, n
3, n
5, n
7, n
11, n
13, n
17]
larger :: [n]
larger = n
p0 forall a. a -> [a] -> [a]
: forall a. (a -> Bool) -> [a] -> [a]
filter n -> Bool
prime [n]
more
prime :: n -> Bool
prime n
n = forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all ((forall a. Ord a => a -> a -> Bool
> n
0) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Integral a => a -> a -> a
mod n
n) (forall a. (a -> Bool) -> [a] -> [a]
takeWhile (\n
x -> n
xforall a. Num a => a -> a -> a
*n
x forall a. Ord a => a -> a -> Bool
<= n
n) [n]
larger)
n
_ : n
p0 : [n]
more = forall {a}. (Num a, Enum a) => (a, [a]) -> [a]
roll ([n] -> (n, [n])
makeWheels [n]
base)
roll :: (a, [a]) -> [a]
roll (a
n,[a]
rs) = [a
n forall a. Num a => a -> a -> a
* a
k forall a. Num a => a -> a -> a
+ a
r | a
k <- [a
0..], a
r <- [a]
rs]
makeWheels :: [n] -> (n, [n])
makeWheels = forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl forall {a}. Integral a => (a, [a]) -> a -> (a, [a])
nextSize (n
1,[n
1])
nextSize :: (a, [a]) -> a -> (a, [a])
nextSize (a
size,[a]
bs) a
p = (a
size forall a. Num a => a -> a -> a
* a
p,[a
r | a
k <- [a
0..a
pforall a. Num a => a -> a -> a
-a
1], a
b <- [a]
bs, let r :: a
r = a
sizeforall a. Num a => a -> a -> a
*a
kforall a. Num a => a -> a -> a
+a
b, forall a. Integral a => a -> a -> a
mod a
r a
p forall a. Ord a => a -> a -> Bool
> a
0])
in [n]
base forall a. [a] -> [a] -> [a]
++ [n]
larger
a000041 :: Num n => [n]
a000041 :: forall n. Num n => [n]
a000041 =
let p_m :: Integer -> Integer -> n
p_m = forall a b r. Memo a -> Memo b -> (a -> b -> r) -> a -> b -> r
Memo.memo2 forall a. Integral a => Memo a
Memo.integral forall a. Integral a => Memo a
Memo.integral Integer -> Integer -> n
p
p :: Integer -> Integer -> n
p Integer
_ Integer
0 = n
1
p Integer
k Integer
m = if Integer
m forall a. Ord a => a -> a -> Bool
< Integer
k then n
0 else Integer -> Integer -> n
p_m Integer
k (Integer
m forall a. Num a => a -> a -> a
- Integer
k) forall a. Num a => a -> a -> a
+ Integer -> Integer -> n
p_m (Integer
k forall a. Num a => a -> a -> a
+ Integer
1) Integer
m
in forall a b. (a -> b) -> [a] -> [b]
map (Integer -> Integer -> n
p_m Integer
1) [Integer
0::Integer ..]
a000045 :: Num n => [n]
a000045 :: forall n. Num n => [n]
a000045 = n
0 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000045 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000045)
a000051 :: Num n => [n]
a000051 :: forall n. Num n => [n]
a000051 = forall a. (a -> a) -> a -> [a]
iterate (forall a. Num a => a -> a -> a
subtract n
1 forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. Num a => a -> a -> a
* n
2)) n
2
a000071 :: Num n => [n]
a000071 :: forall n. Num n => [n]
a000071 = forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
subtract n
1) (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000045)
a000073 :: Num n => [n]
a000073 :: forall n. Num n => [n]
a000073 = n
0 forall a. a -> [a] -> [a]
: n
0 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000073 (forall a. [a] -> [a]
tail (forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000073 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000073)))
a000078 :: Num n => [n]
a000078 :: forall n. Num n => [n]
a000078 =
let f :: [a] -> [a]
f [a]
xs = let y :: a
y = (forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. [a] -> a
head forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. [[a]] -> [[a]]
transpose forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Int -> [a] -> [a]
take Int
4 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. [a] -> [[a]]
tails) [a]
xs in a
y forall a. a -> [a] -> [a]
: [a] -> [a]
f (a
yforall a. a -> [a] -> [a]
:[a]
xs)
in n
0 forall a. a -> [a] -> [a]
: n
0 forall a. a -> [a] -> [a]
: n
0 forall a. a -> [a] -> [a]
: forall {a}. Num a => [a] -> [a]
f [n
0, n
0, n
0, n
1]
a000079 :: Num n => [n]
a000079 :: forall n. Num n => [n]
a000079 = forall a. (a -> a) -> a -> [a]
iterate (forall a. Num a => a -> a -> a
* n
2) n
1
a000085 :: Integral n => [n]
a000085 :: forall n. Integral n => [n]
a000085 = n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(*) [n
1..] forall n. Integral n => [n]
a000085) (forall a. [a] -> [a]
tail forall n. Integral n => [n]
a000085)
a000108 :: Num n => [n]
a000108 :: forall n. Num n => [n]
a000108 = forall a b. (a -> b) -> [a] -> [b]
map forall a. [a] -> a
last (forall a. (a -> a) -> a -> [a]
iterate (forall a. (a -> a -> a) -> [a] -> [a]
scanl1 forall a. Num a => a -> a -> a
(+) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. [a] -> [a] -> [a]
++ [n
0])) [n
1])
a000120 :: Integral i => [i]
a000120 :: forall n. Integral n => [n]
a000120 = let r :: [[i]]
r = [i
0] forall a. a -> [a] -> [a]
: (forall a b. (a -> b) -> [a] -> [b]
map forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map) (forall a. Num a => a -> a -> a
+ i
1) (forall a. (a -> a -> a) -> [a] -> [a]
scanl1 forall a. [a] -> [a] -> [a]
(++) [[i]]
r) in forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [[i]]
r
a000142 :: (Enum n, Num n) => [n]
a000142 :: forall n. (Enum n, Num n) => [n]
a000142 = n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(*) [n
1..] forall n. (Enum n, Num n) => [n]
a000142
a000201 :: Integral n => [n]
a000201 :: forall n. Integral n => [n]
a000201 =
let f :: [a] -> [a] -> [a]
f (a
x:[a]
xs) (a
y:[a]
ys) = a
y forall a. a -> [a] -> [a]
: [a] -> [a] -> [a]
f [a]
xs (forall a. Eq a => a -> [a] -> [a]
delete (a
x forall a. Num a => a -> a -> a
+ a
y) [a]
ys)
f [a]
_ [a]
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"a000201"
in forall {a}. (Eq a, Num a) => [a] -> [a] -> [a]
f [n
1..] [n
1..]
a000204 :: Num n => [n]
a000204 :: forall n. Num n => [n]
a000204 = n
1 forall a. a -> [a] -> [a]
: n
3 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000204 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000204)
a000213 :: Num n => [n]
a000213 :: forall n. Num n => [n]
a000213 = n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000213 (forall a. [a] -> [a]
tail (forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000213 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000213)))
a000217 :: (Enum n,Num n) => [n]
a000217 :: forall n. (Enum n, Num n) => [n]
a000217 = forall a. (a -> a -> a) -> [a] -> [a]
scanl1 forall a. Num a => a -> a -> a
(+) [n
0..]
a000225 :: Num n => [n]
a000225 :: forall n. Num n => [n]
a000225 = forall a. (a -> a) -> a -> [a]
iterate ((forall a. Num a => a -> a -> a
+ n
1) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. Num a => a -> a -> a
* n
2)) n
0
a000285 :: Num n => [n]
a000285 :: forall n. Num n => [n]
a000285 = n
1 forall a. a -> [a] -> [a]
: n
4 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000285 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000285)
a000290 :: Integral n => [n]
a000290 :: forall n. Integral n => [n]
a000290 = let square :: a -> a
square a
n = a
n forall a. Num a => a -> a -> a
* a
n in forall a b. (a -> b) -> [a] -> [b]
map forall {a}. Num a => a -> a
square [n
0..]
a000292 :: (Enum n,Num n) => [n]
a000292 :: forall n. (Enum n, Num n) => [n]
a000292 = forall a. (a -> a -> a) -> [a] -> [a]
scanl1 forall a. Num a => a -> a -> a
(+) forall n. (Enum n, Num n) => [n]
a000217
a000384 :: Integral n => [n]
a000384 :: forall n. Integral n => [n]
a000384 = forall b a. (b -> a -> b) -> b -> [a] -> [b]
scanl forall a. Num a => a -> a -> a
(+) n
0 forall n. Integral n => [n]
a016813
a000578 :: Num n => [n]
a000578 :: forall n. Num n => [n]
a000578 =
n
0 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
8 forall a. a -> [a] -> [a]
:
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
+ n
6) forall n. Num n => [n]
a000578) (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
* n
3) (forall a. [a] -> [a]
tail (forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (-) (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000578) forall n. Num n => [n]
a000578)))
a000583 :: Integral n => [n]
a000583 :: forall n. Integral n => [n]
a000583 = forall b a. (b -> a -> b) -> b -> [a] -> [b]
scanl forall a. Num a => a -> a -> a
(+) n
0 forall n. Integral n => [n]
a005917
a000670 :: Integral n => [n]
a000670 :: forall n. Integral n => [n]
a000670 =
let f :: [a] -> [[a]] -> [a]
f [a]
xs ([a]
bs:[[a]]
bss) = let y :: a
y = forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum (forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(*) [a]
xs [a]
bs) in a
y forall a. a -> [a] -> [a]
: [a] -> [[a]] -> [a]
f (a
y forall a. a -> [a] -> [a]
: [a]
xs) [[a]]
bss
f [a]
_ [[a]]
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"a000670d"
in n
1 forall a. a -> [a] -> [a]
: forall {a}. Num a => [a] -> [[a]] -> [a]
f [n
1] (forall a b. (a -> b) -> [a] -> [b]
map forall a. [a] -> [a]
tail (forall a. [a] -> [a]
tail forall i. Integral i => [[i]]
a007318_tbl))
a000796 :: Integral n => [n]
a000796 :: forall n. Integral n => [n]
a000796 =
let gen :: (a, a, a) -> [(a, a, a)] -> [a]
gen (a, a, a)
_ [] = forall a. HasCallStack => [Char] -> a
error [Char]
"A000796"
gen (a, a, a)
z ((a, a, a)
x:[(a, a, a)]
xs) =
let lb :: a
lb = forall {a}. Integral a => (a, a, a) -> a -> a
approx (a, a, a)
z a
3
approx :: (a, a, a) -> a -> a
approx (a
a,a
b,a
c) a
n = forall a. Integral a => a -> a -> a
div (a
a forall a. Num a => a -> a -> a
* a
n forall a. Num a => a -> a -> a
+ a
b) a
c
mult :: (c, c, c) -> (c, c, c) -> (c, c, c)
mult (c
a,c
b,c
c) (c
d,c
e,c
f) = (c
a forall a. Num a => a -> a -> a
* c
d,c
a forall a. Num a => a -> a -> a
* c
e forall a. Num a => a -> a -> a
+ c
b forall a. Num a => a -> a -> a
* c
f,c
c forall a. Num a => a -> a -> a
* c
f)
in if a
lb forall a. Eq a => a -> a -> Bool
/= forall {a}. Integral a => (a, a, a) -> a -> a
approx (a, a, a)
z a
4
then (a, a, a) -> [(a, a, a)] -> [a]
gen (forall {c}. Num c => (c, c, c) -> (c, c, c) -> (c, c, c)
mult (a, a, a)
z (a, a, a)
x) [(a, a, a)]
xs
else a
lb forall a. a -> [a] -> [a]
: (a, a, a) -> [(a, a, a)] -> [a]
gen (forall {c}. Num c => (c, c, c) -> (c, c, c) -> (c, c, c)
mult (a
10,-a
10 forall a. Num a => a -> a -> a
* a
lb,a
1) (a, a, a)
z) ((a, a, a)
xforall a. a -> [a] -> [a]
:[(a, a, a)]
xs)
in forall a b. (a -> b) -> [a] -> [b]
map forall a. Num a => Integer -> a
fromInteger (forall {a}. Integral a => (a, a, a) -> [(a, a, a)] -> [a]
gen (Integer
1,Integer
0,Integer
1) [(Integer
n,Integer
aforall a. Num a => a -> a -> a
*Integer
d,Integer
d) | (Integer
n,Integer
d,Integer
a) <- forall a b. (a -> b) -> [a] -> [b]
map (\Integer
k -> (Integer
k,Integer
2 forall a. Num a => a -> a -> a
* Integer
k forall a. Num a => a -> a -> a
+ Integer
1,Integer
2)) [Integer
1..]])
a000930 :: Num n => [n]
a000930 :: forall n. Num n => [n]
a000930 = n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000930 (forall a. Int -> [a] -> [a]
drop Int
2 forall n. Num n => [n]
a000930)
a000931 :: Num n => [n]
a000931 :: forall n. Num n => [n]
a000931 = n
1 forall a. a -> [a] -> [a]
: n
0 forall a. a -> [a] -> [a]
: n
0 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a000931 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000931)
a001008 :: Integral i => [i]
a001008 :: forall n. Integral n => [n]
a001008 = forall a b. (a -> b) -> [a] -> [b]
map forall a. Ratio a -> a
numerator (forall a. (a -> a -> a) -> [a] -> [a]
scanl1 forall a. Num a => a -> a -> a
(+) (forall a b. (a -> b) -> [a] -> [b]
map (i
1 forall a. Integral a => a -> a -> Ratio a
%) [i
1..]))
a001037 :: Integral n => [n]
a001037 :: forall n. Integral n => [n]
a001037 = forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
a001037_n [n
0..]
a001037_n :: Integral n => n -> n
a001037_n :: forall n. Integral n => n -> n
a001037_n n
n = if n
n forall a. Eq a => a -> a -> Bool
== n
0 then n
1 else (forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum (forall a b. (a -> b) -> [a] -> [b]
map (\n
d -> (n
2 forall a b. (Num a, Integral b) => a -> b -> a
^ n
d) forall a. Num a => a -> a -> a
* forall n. Integral n => n -> n
a008683_n (n
n forall a. Integral a => a -> a -> a
`div` n
d)) (forall n. Integral n => n -> [n]
a027750_row n
n))) forall a. Integral a => a -> a -> a
`div` n
n
a001113 :: Integral n => [n]
a001113 :: forall n. Integral n => [n]
a001113 =
let gen :: (a, a, a) -> [(a, a, a)] -> [a]
gen (a, a, a)
_ [] = forall a. HasCallStack => [Char] -> a
error [Char]
"A001113"
gen (a, a, a)
z ((a, a, a)
x:[(a, a, a)]
xs) =
let lb :: a
lb = forall {a}. Integral a => (a, a, a) -> a -> a
approx (a, a, a)
z a
1
approx :: (a, a, a) -> a -> a
approx (a
a,a
b,a
c) a
n = forall a. Integral a => a -> a -> a
div (a
a forall a. Num a => a -> a -> a
* a
n forall a. Num a => a -> a -> a
+ a
b) a
c
mult :: (c, c, c) -> (c, c, c) -> (c, c, c)
mult (c
a,c
b,c
c) (c
d,c
e,c
f) = (c
a forall a. Num a => a -> a -> a
* c
d,c
a forall a. Num a => a -> a -> a
* c
e forall a. Num a => a -> a -> a
+ c
b forall a. Num a => a -> a -> a
* c
f,c
c forall a. Num a => a -> a -> a
* c
f)
in if a
lb forall a. Eq a => a -> a -> Bool
/= forall {a}. Integral a => (a, a, a) -> a -> a
approx (a, a, a)
z a
2
then (a, a, a) -> [(a, a, a)] -> [a]
gen (forall {c}. Num c => (c, c, c) -> (c, c, c) -> (c, c, c)
mult (a, a, a)
z (a, a, a)
x) [(a, a, a)]
xs
else a
lb forall a. a -> [a] -> [a]
: (a, a, a) -> [(a, a, a)] -> [a]
gen (forall {c}. Num c => (c, c, c) -> (c, c, c) -> (c, c, c)
mult (a
10,-a
10 forall a. Num a => a -> a -> a
* a
lb,a
1) (a, a, a)
z) ((a, a, a)
xforall a. a -> [a] -> [a]
:[(a, a, a)]
xs)
in forall {a}. Integral a => (a, a, a) -> [(a, a, a)] -> [a]
gen (n
1,n
0,n
1) [(n
n,n
a forall a. Num a => a -> a -> a
* n
d,n
d) | (n
n,n
d,n
a) <- forall a b. (a -> b) -> [a] -> [b]
map (\n
k -> (n
1,n
k,n
1)) [n
1..]]
a001147 :: Integral t => [t]
a001147 :: forall n. Integral n => [n]
a001147 = t
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(*) [t
1, t
3 ..] forall n. Integral n => [n]
a001147
a001156 :: Num n => [n]
a001156 :: forall n. Num n => [n]
a001156 =
let p :: [t] -> t -> a
p [t]
_ t
0 = a
1
p ks' :: [t]
ks'@(t
k:[t]
ks) t
m = if t
m forall a. Ord a => a -> a -> Bool
< t
k then a
0 else [t] -> t -> a
p [t]
ks' (t
m forall a. Num a => a -> a -> a
- t
k) forall a. Num a => a -> a -> a
+ [t] -> t -> a
p [t]
ks t
m
p [t]
_ t
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"A001156"
in forall a b. (a -> b) -> [a] -> [b]
map (forall {t} {a}. (Num t, Num a, Ord t) => [t] -> t -> a
p (forall a. [a] -> [a]
tail forall n. Integral n => [n]
a000290)) [Integer
0::Integer ..]
a001333 :: Num n => [n]
a001333 :: forall n. Num n => [n]
a001333 = n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a001333 (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
* n
2) (forall a. [a] -> [a]
tail forall n. Num n => [n]
a001333))
a001622 :: Num n => [n]
a001622 :: forall n. Num n => [n]
a001622 = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
digitToInt) [Char]
"161803398874989484820458683436563811772030917980576286213544862270526046281890244970720720418939113748475408807538689175212663386222353693179318006076672635443338908659593958290563832266131992829026788067520876689250171169620703222104321626954862629631361443814975870122034080588795445474924618569536486444924104432077134494704956584678850987433944221254487706647809158846074998871240076521705751797883416625624940758906970400028121042762177111777805315317141011704666599146697987317613560067087480711" forall a. [a] -> [a] -> [a]
++ forall a. HasCallStack => [Char] -> a
error [Char]
"A001622"
a001622_k :: Floating n => n
a001622_k :: forall n. Floating n => n
a001622_k = (n
1 forall a. Num a => a -> a -> a
+ forall a. Floating a => a -> a
sqrt n
5) forall a. Fractional a => a -> a -> a
/ n
2
a001644 :: Num n => [n]
a001644 :: forall n. Num n => [n]
a001644 = n
3 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
3 forall a. a -> [a] -> [a]
: forall a b c d. (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
zipWith3 ((forall a. Num a => a -> a -> a
(+) forall b c a. (b -> c) -> (a -> b) -> a -> c
.) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Num a => a -> a -> a
(+)) forall n. Num n => [n]
a001644 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a001644) (forall a. Int -> [a] -> [a]
drop Int
2 forall n. Num n => [n]
a001644)
a001653 :: [Integer]
a001653 :: [Integer]
a001653 = Integer
1 forall a. a -> [a] -> [a]
: Integer
5 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (-) (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
* Integer
6) (forall a. [a] -> [a]
tail [Integer]
a001653)) [Integer]
a001653
a001687 :: Num n => [n]
a001687 :: forall n. Num n => [n]
a001687 = n
0 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
0 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
0 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a001687 (forall a. Int -> [a] -> [a]
drop Int
3 forall n. Num n => [n]
a001687)
a001950 :: Integral n => [n]
a001950 :: forall n. Integral n => [n]
a001950 = forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Integral n => [n]
a000201 [n
1..]
a002267 :: Num n => [n]
a002267 :: forall n. Num n => [n]
a002267 = [n
2, n
3, n
5, n
7, n
11, n
13, n
17, n
19, n
23, n
29, n
31, n
41, n
47, n
59, n
71]
a002487 :: Num n => [n]
a002487 :: forall n. Num n => [n]
a002487 =
let f :: [a] -> [a] -> [a]
f (a
a:[a]
a') (a
b:[a]
b') = a
a forall a. Num a => a -> a -> a
+ a
b forall a. a -> [a] -> [a]
: a
a forall a. a -> [a] -> [a]
: [a] -> [a] -> [a]
f [a]
a' [a]
b'
f [a]
_ [a]
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"a002487"
x :: [n]
x = n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall {a}. Num a => [a] -> [a] -> [a]
f (forall a. [a] -> [a]
tail [n]
x) [n]
x
in n
0 forall a. a -> [a] -> [a]
: [n]
x
a002858 :: [Integer]
a002858 :: [Integer]
a002858 = Integer
1 forall a. a -> [a] -> [a]
: Integer
2 forall a. a -> [a] -> [a]
: Int -> Integer -> [Integer] -> [Integer]
ulam Int
2 Integer
2 [Integer]
a002858
ulam :: Int -> Integer -> [Integer] -> [Integer]
ulam :: Int -> Integer -> [Integer] -> [Integer]
ulam Int
n Integer
u [Integer]
us =
let u' :: Integer
u' = forall {t}. (Eq t, Num t) => t -> Integer -> [Integer] -> Integer
f (Integer
0 :: Integer) (Integer
u forall a. Num a => a -> a -> a
+ Integer
1) [Integer]
us'
f :: t -> Integer -> [Integer] -> Integer
f t
2 Integer
z [Integer]
_ = t -> Integer -> [Integer] -> Integer
f t
0 (Integer
z forall a. Num a => a -> a -> a
+ Integer
1) [Integer]
us'
f t
e Integer
z (Integer
v:[Integer]
vs) | Integer
z forall a. Num a => a -> a -> a
- Integer
v forall a. Ord a => a -> a -> Bool
<= Integer
v = if t
e forall a. Eq a => a -> a -> Bool
== t
1 then Integer
z else t -> Integer -> [Integer] -> Integer
f t
0 (Integer
z forall a. Num a => a -> a -> a
+ Integer
1) [Integer]
us'
| Integer
z forall a. Num a => a -> a -> a
- Integer
v forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Integer]
us' = t -> Integer -> [Integer] -> Integer
f (t
e forall a. Num a => a -> a -> a
+ t
1) Integer
z [Integer]
vs
| Bool
otherwise = t -> Integer -> [Integer] -> Integer
f t
e Integer
z [Integer]
vs
f t
_ Integer
_ [] = forall a. HasCallStack => [Char] -> a
error [Char]
"ulam?"
us' :: [Integer]
us' = forall a. Int -> [a] -> [a]
take Int
n [Integer]
us
in Integer
u' forall a. a -> [a] -> [a]
: Int -> Integer -> [Integer] -> [Integer]
ulam (Int
n forall a. Num a => a -> a -> a
+ Int
1) Integer
u' [Integer]
us
a003108 :: Num n => [n]
a003108 :: forall n. Num n => [n]
a003108 =
let p :: [t] -> t -> a
p [t]
_ t
0 = a
1
p ks' :: [t]
ks'@(t
k:[t]
ks) t
m = if t
m forall a. Ord a => a -> a -> Bool
< t
k then a
0 else [t] -> t -> a
p [t]
ks' (t
m forall a. Num a => a -> a -> a
- t
k) forall a. Num a => a -> a -> a
+ [t] -> t -> a
p [t]
ks t
m
p [t]
_ t
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"A003108"
in forall a b. (a -> b) -> [a] -> [b]
map (forall {t} {a}. (Num t, Num a, Ord t) => [t] -> t -> a
p (forall a. [a] -> [a]
tail forall n. Num n => [n]
a000578)) [Integer
0::Integer ..]
a003215_n :: Num n => n -> n
a003215_n :: forall {a}. Num a => a -> a
a003215_n n
n = n
3 forall a. Num a => a -> a -> a
* n
n forall a. Num a => a -> a -> a
* (n
n forall a. Num a => a -> a -> a
+ n
1) forall a. Num a => a -> a -> a
+ n
1
a003215 :: (Enum n,Num n) => [n]
a003215 :: forall n. (Enum n, Num n) => [n]
a003215 = forall a b. (a -> b) -> [a] -> [b]
map forall {a}. Num a => a -> a
a003215_n [n
0..]
a003269 :: Num n => [n]
a003269 :: forall n. Num n => [n]
a003269 = n
0 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a003269 (forall a. Int -> [a] -> [a]
drop Int
3 forall n. Num n => [n]
a003269)
a003520 :: Num n => [n]
a003520 :: forall n. Num n => [n]
a003520 = n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a003520 (forall a. Int -> [a] -> [a]
drop Int
4 forall n. Num n => [n]
a003520)
a003462 :: [Integer]
a003462 :: [Integer]
a003462 = forall a. (a -> a) -> a -> [a]
iterate ((forall a. Num a => a -> a -> a
+ Integer
1) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. Num a => a -> a -> a
* Integer
3)) Integer
0
a003462_n :: Integer -> Integer
a003462_n :: Integer -> Integer
a003462_n = (forall a. Integral a => a -> a -> a
`div` Integer
2) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. Num a => a -> a -> a
subtract Integer
1) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Integer
3 forall a b. (Num a, Integral b) => a -> b -> a
^)
a003586 :: [Integer]
a003586 :: [Integer]
a003586 =
let smooth :: Set a -> [a]
smooth Set a
s = let (a
x, Set a
s') = forall a. Set a -> (a, Set a)
Set.deleteFindMin Set a
s in a
x forall a. a -> [a] -> [a]
: Set a -> [a]
smooth (forall a. Ord a => a -> Set a -> Set a
Set.insert (a
3 forall a. Num a => a -> a -> a
* a
x) (forall a. Ord a => a -> Set a -> Set a
Set.insert (a
2 forall a. Num a => a -> a -> a
* a
x) Set a
s'))
in forall {a}. (Ord a, Num a) => Set a -> [a]
smooth (forall a. a -> Set a
Set.singleton Integer
1)
a003849 :: Num n => [n]
a003849 :: forall n. Num n => [n]
a003849 =
let fws :: [[n]]
fws = [n
1] forall a. a -> [a] -> [a]
: [n
0] forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. [a] -> [a] -> [a]
(++) [[n]]
fws (forall a. [a] -> [a]
tail [[n]]
fws)
in forall a. [a] -> [a]
tail (forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [[n]]
fws)
a004001 :: [Int]
a004001 :: [Int]
a004001 =
let h :: Int -> Int -> [Int]
h Int
n Int
x =
let x' :: Int
x' = [Int]
a004001 forall a. [a] -> Int -> a
!! (Int
x forall a. Num a => a -> a -> a
- Int
1) forall a. Num a => a -> a -> a
+ [Int]
a004001 forall a. [a] -> Int -> a
!! (Int
n forall a. Num a => a -> a -> a
- Int
x forall a. Num a => a -> a -> a
- Int
1)
in Int
x' forall a. a -> [a] -> [a]
: Int -> Int -> [Int]
h (Int
n forall a. Num a => a -> a -> a
+ Int
1) Int
x'
in Int
1 forall a. a -> [a] -> [a]
: Int
1 forall a. a -> [a] -> [a]
: Int -> Int -> [Int]
h Int
3 Int
1
a004718 :: Num n => [n]
a004718 :: forall n. Num n => [n]
a004718 = n
0 forall a. a -> [a] -> [a]
: forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat (forall a. [[a]] -> [[a]]
transpose [forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
+ n
1) forall n. Num n => [n]
a004718, forall a b. (a -> b) -> [a] -> [b]
map forall {a}. Num a => a -> a
negate (forall a. [a] -> [a]
tail forall n. Num n => [n]
a004718)])
a005185 :: [Int]
a005185 :: [Int]
a005185 =
let ix :: Int -> Int
ix Int
n = [Int]
a005185 forall a. [a] -> Int -> a
!! (Int
n forall a. Num a => a -> a -> a
- Int
1)
zadd :: [Int] -> [Int] -> [Int]
zadd = forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+)
zsub :: [Int] -> [Int] -> [Int]
zsub = forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (-)
in Int
1 forall a. a -> [a] -> [a]
: Int
1 forall a. a -> [a] -> [a]
: [Int] -> [Int] -> [Int]
zadd (forall a b. (a -> b) -> [a] -> [b]
map Int -> Int
ix ([Int] -> [Int] -> [Int]
zsub [Int
3..] [Int]
a005185)) (forall a b. (a -> b) -> [a] -> [b]
map Int -> Int
ix ([Int] -> [Int] -> [Int]
zsub [Int
3..] (forall a. [a] -> [a]
tail [Int]
a005185)))
a005448 :: Integral n => [n]
a005448 :: forall n. Integral n => [n]
a005448 = n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Integral n => [n]
a005448 [n
3,n
6 ..]
a005448_n :: Integral n => n -> n
a005448_n :: forall n. Integral n => n -> n
a005448_n n
n = n
3 forall a. Num a => a -> a -> a
* n
n forall a. Num a => a -> a -> a
* (n
n forall a. Num a => a -> a -> a
- n
1) forall a. Integral a => a -> a -> a
`div` n
2 forall a. Num a => a -> a -> a
+ n
1
a005728 :: Integral i => [i]
a005728 :: forall n. Integral n => [n]
a005728 =
let phi :: a -> i
phi a
n = forall i a. Num i => [a] -> i
genericLength (forall a. (a -> Bool) -> [a] -> [a]
filter (forall a. Eq a => a -> a -> Bool
==a
1) (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Integral a => a -> a -> a
gcd a
n) [a
1..a
n]))
f :: a -> a
f a
n = if a
n forall a. Eq a => a -> a -> Bool
== a
0 then a
1 else a -> a
f (a
n forall a. Num a => a -> a -> a
- a
1) forall a. Num a => a -> a -> a
+ forall {a} {i}. (Num i, Integral a) => a -> i
phi a
n
in forall a b. (a -> b) -> [a] -> [b]
map forall {a} {i}. (Num i, Integral a) => a -> i
f [Integer
0::Integer ..]
a005811 :: Integral n => [n]
a005811 :: forall n. Integral n => [n]
a005811 =
let f :: [a] -> [a]
f (a
x:[a]
xs) = a
x forall a. a -> [a] -> [a]
: [a] -> [a]
f ([a]
xs forall a. [a] -> [a] -> [a]
++ [a
x forall a. Num a => a -> a -> a
+ a
x forall a. Integral a => a -> a -> a
`mod` a
2, a
x forall a. Num a => a -> a -> a
+ a
1 forall a. Num a => a -> a -> a
- a
x forall a. Integral a => a -> a -> a
`mod` a
2])
f [a]
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"A005811"
in n
0 forall a. a -> [a] -> [a]
: forall {a}. Integral a => [a] -> [a]
f [n
1]
a005917 :: Integral n => [n]
a005917 :: forall n. Integral n => [n]
a005917 =
let f :: Int -> [a] -> [[a]]
f Int
x [a]
ws = let ([a]
us,[a]
vs) = forall a. Int -> [a] -> ([a], [a])
splitAt Int
x [a]
ws in [a]
us forall a. a -> [a] -> [a]
: Int -> [a] -> [[a]]
f (Int
x forall a. Num a => a -> a -> a
+ Int
2) [a]
vs
in forall a b. (a -> b) -> [a] -> [b]
map forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum (forall {a}. Int -> [a] -> [[a]]
f Int
1 [n
1, n
3 ..])
a006003 :: Integral n => [n]
a006003 :: forall n. Integral n => [n]
a006003 = forall b a. (b -> a -> b) -> b -> [a] -> [b]
scanl forall a. Num a => a -> a -> a
(+) n
0 forall n. Integral n => [n]
a005448
a006003_n :: Integral n => n -> n
a006003_n :: forall n. Integral n => n -> n
a006003_n n
n = n
n forall a. Num a => a -> a -> a
* (n
n forall a b. (Num a, Integral b) => a -> b -> a
^ (Int
2::Int) forall a. Num a => a -> a -> a
+ n
1) forall a. Integral a => a -> a -> a
`div` n
2
a006046 :: [Int]
a006046 :: [Int]
a006046 = forall a b. (a -> b) -> [a] -> [b]
map (forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat) (forall a. [a] -> [[a]]
inits [[Int]]
a047999_tbl)
a006052 :: Integral n => [n]
a006052 :: forall n. Integral n => [n]
a006052 = [n
1,n
0,n
1,n
880,n
275305224]
a006842 :: Integral i => [i]
a006842 :: forall n. Integral n => [n]
a006842 = forall a b. (a -> b) -> [a] -> [b]
map forall a. Ratio a -> a
numerator (forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall i. Integral i => i -> [Ratio i]
Math.farey [i
1..])
a006843 :: Integral i => [i]
a006843 :: forall n. Integral n => [n]
a006843 = forall a b. (a -> b) -> [a] -> [b]
map forall a. Ratio a -> a
denominator (forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall i. Integral i => i -> [Ratio i]
Math.farey [i
1..])
a007318 :: Integral i => [i]
a007318 :: forall n. Integral n => [n]
a007318 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall i. Integral i => [[i]]
a007318_tbl
a007318_tbl :: Integral i => [[i]]
a007318_tbl :: forall i. Integral i => [[i]]
a007318_tbl =
let f :: [c] -> [c]
f [c]
r = forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (c
0 forall a. a -> [a] -> [a]
: [c]
r) ([c]
r forall a. [a] -> [a] -> [a]
++ [c
0])
in forall a. (a -> a) -> a -> [a]
iterate forall {a}. Num a => [a] -> [a]
f [i
1]
a008277 :: (Enum n,Num n) => [n]
a008277 :: forall n. (Enum n, Num n) => [n]
a008277 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall n. (Enum n, Num n) => [[n]]
a008277_tbl
a008277_tbl :: (Enum n,Num n) => [[n]]
a008277_tbl :: forall n. (Enum n, Num n) => [[n]]
a008277_tbl = forall a b. (a -> b) -> [a] -> [b]
map forall a. [a] -> [a]
tail forall n. (Enum n, Num n) => [[n]]
a048993_tbl
a008278 :: (Enum n,Num n) => [n]
a008278 :: forall n. (Enum n, Num n) => [n]
a008278 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall n. (Enum n, Num n) => [[n]]
a008278_tbl
a008278_tbl :: (Enum n,Num n) => [[n]]
a008278_tbl :: forall n. (Enum n, Num n) => [[n]]
a008278_tbl =
let f :: [c] -> [c]
f [c]
p =
let q :: [c]
q = forall a. [a] -> [a]
reverse (forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(*) [c
1..] (forall a. [a] -> [a]
reverse [c]
p))
in forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (c
0 forall a. a -> [a] -> [a]
: [c]
q) ([c]
p forall a. [a] -> [a] -> [a]
++ [c
0])
in forall a. (a -> a) -> a -> [a]
iterate forall {c}. (Num c, Enum c) => [c] -> [c]
f [n
1]
a008683 :: Integral n => [n]
a008683 :: forall n. Integral n => [n]
a008683 = forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
a008683_n [n
1..]
a008683_n :: Integral n => n -> n
a008683_n :: forall n. Integral n => n -> n
a008683_n =
let mu :: [a] -> a
mu [] = a
1
mu (a
1:[a]
es) = - [a] -> a
mu [a]
es
mu [a]
_ = a
0
in forall {a} {a}. (Eq a, Num a, Num a) => [a] -> a
mu forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. [(a, b)] -> ([a], [b])
unzip forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i. Integral i => i -> [(i, Int)]
Prime.prime_factors_m
a010049 :: Num n => [n]
a010049 :: forall n. Num n => [n]
a010049 =
let c :: [a] -> [a] -> [a]
c [a]
us (a
v:[a]
vs) = forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum (forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(*) [a]
us (a
1 forall a. a -> [a] -> [a]
: forall a. [a] -> [a]
reverse [a]
us)) forall a. a -> [a] -> [a]
: [a] -> [a] -> [a]
c (a
vforall a. a -> [a] -> [a]
:[a]
us) [a]
vs
c [a]
_ [a]
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"A010049"
in forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry forall {a}. Num a => [a] -> [a] -> [a]
c (forall a. Int -> [a] -> ([a], [a])
splitAt Int
1 forall n. Num n => [n]
a000045)
a010060 :: [Integer]
a010060 :: [Integer]
a010060 =
let interleave :: [a] -> [a] -> [a]
interleave (a
x:[a]
xs) [a]
ys = a
x forall a. a -> [a] -> [a]
: [a] -> [a] -> [a]
interleave [a]
ys [a]
xs
interleave [] [a]
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"a010060?"
in Integer
0 forall a. a -> [a] -> [a]
: forall a. [a] -> [a] -> [a]
interleave (forall a b. (a -> b) -> [a] -> [b]
map (Integer
1 forall a. Num a => a -> a -> a
-) [Integer]
a010060) (forall a. [a] -> [a]
tail [Integer]
a010060)
a014081 :: (Integral i, Bits i) => [i]
a014081 :: forall i. (Integral i, Bits i) => [i]
a014081 = forall a b. (a -> b) -> [a] -> [b]
map (\Int
n -> forall n. Integral n => [n]
a000120 forall a. [a] -> Int -> a
!! (Int
n forall a. Bits a => a -> a -> a
.&. forall a. Integral a => a -> a -> a
div Int
n Int
2)) [Int
0..]
a014577 :: Integral i => [i]
a014577 :: forall n. Integral n => [n]
a014577 =
let f :: t -> t
f t
n = if t
n forall a. Integral a => a -> a -> a
`rem` t
2 forall a. Eq a => a -> a -> Bool
== t
1 then t -> t
f (t
n forall a. Integral a => a -> a -> a
`quot` t
2) else t
1 forall a. Num a => a -> a -> a
- (t
n forall a. Integral a => a -> a -> a
`div` t
2 forall a. Integral a => a -> a -> a
`rem` t
2)
in forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
f [i
0..]
a016813 :: Integral n => [n]
a016813 :: forall n. Integral n => [n]
a016813 = [n
1, n
5 ..]
a017817 :: Num n => [n]
a017817 :: forall n. Num n => [n]
a017817 = n
1 forall a. a -> [a] -> [a]
: n
0 forall a. a -> [a] -> [a]
: n
0 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a017817 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a017817)
a020695 :: Num n => [n]
a020695 :: forall n. Num n => [n]
a020695 = forall a. Int -> [a] -> [a]
drop Int
3 forall n. Num n => [n]
a000045
a020985 :: [Integer]
a020985 :: [Integer]
a020985 =
let f :: [t] -> t -> [t]
f (t
x:[t]
xs) t
w = t
x forall a. a -> [a] -> [a]
: t
xforall a. Num a => a -> a -> a
*t
w forall a. a -> [a] -> [a]
: [t] -> t -> [t]
f [t]
xs (t
0 forall a. Num a => a -> a -> a
- t
w)
f [] t
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"a020985?"
in Integer
1 forall a. a -> [a] -> [a]
: Integer
1 forall a. a -> [a] -> [a]
: forall {t}. Num t => [t] -> t -> [t]
f (forall a. [a] -> [a]
tail [Integer]
a020985) (-Integer
1)
a022095 :: Num n => [n]
a022095 :: forall n. Num n => [n]
a022095 = n
1 forall a. a -> [a] -> [a]
: n
5 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a022095 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a022095)
a022096 :: Num n => [n]
a022096 :: forall n. Num n => [n]
a022096 = n
1 forall a. a -> [a] -> [a]
: n
6 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) forall n. Num n => [n]
a022096 (forall a. [a] -> [a]
tail forall n. Num n => [n]
a022096)
a027750 :: Integral n => [n]
a027750 :: forall n. Integral n => [n]
a027750 = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall n. Integral n => n -> [n]
a027750_row [n
1..]
a027750_row :: Integral n => n -> [n]
a027750_row :: forall n. Integral n => n -> [n]
a027750_row n
n = forall a. (a -> Bool) -> [a] -> [a]
filter ((forall a. Eq a => a -> a -> Bool
== n
0) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. Integral a => a -> a -> a
mod n
n)) [n
1..n
n]
a027934 :: Num n => [n]
a027934 :: forall n. Num n => [n]
a027934 =
let f :: a -> a -> a -> a
f a
x a
y a
z = a
3 forall a. Num a => a -> a -> a
* a
x forall a. Num a => a -> a -> a
- a
y forall a. Num a => a -> a -> a
- a
2 forall a. Num a => a -> a -> a
* a
z
in n
0 forall a. a -> [a] -> [a]
: n
1 forall a. a -> [a] -> [a]
: n
2 forall a. a -> [a] -> [a]
: forall a b c d. (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
zipWith3 forall {a}. Num a => a -> a -> a -> a
f (forall a. Int -> [a] -> [a]
drop Int
2 forall n. Num n => [n]
a027934) (forall a. [a] -> [a]
tail forall n. Num n => [n]
a027934) forall n. Num n => [n]
a027934
a029635 :: Num i => [i]
a029635 :: forall n. Num n => [n]
a029635 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall i. Num i => [[i]]
a029635_tbl
a029635_tbl :: Num i => [[i]]
a029635_tbl :: forall i. Num i => [[i]]
a029635_tbl =
let f :: [c] -> [c]
f [c]
r = forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (c
0 forall a. a -> [a] -> [a]
: [c]
r) ([c]
r forall a. [a] -> [a] -> [a]
++ [c
0])
in [i
2] forall a. a -> [a] -> [a]
: forall a. (a -> a) -> a -> [a]
iterate forall {a}. Num a => [a] -> [a]
f [i
1,i
2]
a030308 :: (Eq n,Num n) => [[n]]
a030308 :: forall n. (Eq n, Num n) => [[n]]
a030308 =
let f :: [a] -> [a]
f [a]
l = case [a]
l of
[] -> [a
1]
a
0:[a]
b -> a
1 forall a. a -> [a] -> [a]
: [a]
b
a
1:[a]
b -> a
0 forall a. a -> [a] -> [a]
: [a] -> [a]
f [a]
b
[a]
_ -> forall a. HasCallStack => [Char] -> a
error [Char]
"A030308"
in forall a. (a -> a) -> a -> [a]
iterate forall {a}. (Num a, Eq a) => [a] -> [a]
f [n
0]
a033622 :: [Integer]
a033622 :: [Integer]
a033622 = forall a b. (a -> b) -> [a] -> [b]
map Integer -> Integer
a033622_n [Integer
0..]
a033622_n :: Integer -> Integer
a033622_n :: Integer -> Integer
a033622_n Integer
n =
if forall a. Integral a => a -> Bool
even Integer
n
then Integer
9 forall a. Num a => a -> a -> a
* Integer
2 forall a b. (Num a, Integral b) => a -> b -> a
^ Integer
n forall a. Num a => a -> a -> a
- Integer
9 forall a. Num a => a -> a -> a
* Integer
2 forall a b. (Num a, Integral b) => a -> b -> a
^ ( Integer
n forall a. Integral a => a -> a -> a
`div` Integer
2) forall a. Num a => a -> a -> a
+ Integer
1
else Integer
8 forall a. Num a => a -> a -> a
* Integer
2 forall a b. (Num a, Integral b) => a -> b -> a
^ Integer
n forall a. Num a => a -> a -> a
- Integer
6 forall a. Num a => a -> a -> a
* Integer
2 forall a b. (Num a, Integral b) => a -> b -> a
^ ((Integer
n forall a. Num a => a -> a -> a
+ Integer
1 )forall a. Integral a => a -> a -> a
`div` Integer
2) forall a. Num a => a -> a -> a
+ Integer
1
a033812 :: Num n => [n]
a033812 :: forall n. Num n => [n]
a033812 = [n
8, n
1, n
6, n
3, n
5, n
7, n
4, n
9, n
2]
a034968 :: Integral n => [n]
a034968 :: forall n. Integral n => [n]
a034968 =
let f :: t -> t -> t -> t
f t
i t
s t
n = if t
n forall a. Eq a => a -> a -> Bool
== t
0 then t
s else t -> t -> t -> t
f (t
i forall a. Num a => a -> a -> a
+ t
1) (t
s forall a. Num a => a -> a -> a
+ forall a. Integral a => a -> a -> a
rem t
n t
i) (forall a. Integral a => a -> a -> a
quot t
n t
i)
in forall a b. (a -> b) -> [a] -> [b]
map (forall {t}. Integral t => t -> t -> t -> t
f n
2 n
0) [n
0 ..]
a036562 :: [Integer]
a036562 :: [Integer]
a036562 = Integer
1 forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map Integer -> Integer
a036562_n [Integer
0..]
a036562_n :: Integer -> Integer
a036562_n :: Integer -> Integer
a036562_n Integer
n = Integer
4forall a b. (Num a, Integral b) => a -> b -> a
^(Integer
nforall a. Num a => a -> a -> a
+Integer
1) forall a. Num a => a -> a -> a
+ Integer
3forall a. Num a => a -> a -> a
*Integer
2forall a b. (Num a, Integral b) => a -> b -> a
^Integer
n forall a. Num a => a -> a -> a
+ Integer
1
a046042 :: Num n => [n]
a046042 :: forall n. Num n => [n]
a046042 =
let p :: [t] -> t -> a
p [t]
_ t
0 = a
1
p ks' :: [t]
ks'@(t
k:[t]
ks) t
m = if t
m forall a. Ord a => a -> a -> Bool
< t
k then a
0 else [t] -> t -> a
p [t]
ks' (t
m forall a. Num a => a -> a -> a
- t
k) forall a. Num a => a -> a -> a
+ [t] -> t -> a
p [t]
ks t
m
p [t]
_ t
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"A046042"
in forall a b. (a -> b) -> [a] -> [b]
map (forall {t} {a}. (Num t, Num a, Ord t) => [t] -> t -> a
p (forall a. [a] -> [a]
tail forall n. Integral n => [n]
a000583)) [Integer
1::Integer ..]
a047999 :: [Int]
a047999 :: [Int]
a047999 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [[Int]]
a047999_tbl
a047999_tbl :: [[Int]]
a047999_tbl :: [[Int]]
a047999_tbl = forall a. (a -> a) -> a -> [a]
iterate (\[Int]
r -> forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Bits a => a -> a -> a
xor (Int
0 forall a. a -> [a] -> [a]
: [Int]
r) ([Int]
r forall a. [a] -> [a] -> [a]
++ [Int
0])) [Int
1]
a048993 :: (Enum n,Num n) => [n]
a048993 :: forall n. (Enum n, Num n) => [n]
a048993 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall n. (Enum n, Num n) => [[n]]
a048993_tbl
a048993_tbl :: (Enum n,Num n) => [[n]]
a048993_tbl :: forall n. (Enum n, Num n) => [[n]]
a048993_tbl = forall a. (a -> a) -> a -> [a]
iterate (\[n]
row -> n
0 forall a. a -> [a] -> [a]
: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) [n]
row (forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(*) [n
1..] (forall a. [a] -> [a]
tail [n]
row)) forall a. [a] -> [a] -> [a]
++ [n
1]) [n
1]
a049455 :: Integral n => [n]
a049455 :: forall n. Integral n => [n]
a049455 = forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst (forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall n. Num n => [[(n, n)]]
Math.stern_brocot_tree_lhs)
a049456 :: Integral n => [n]
a049456 :: forall n. Integral n => [n]
a049456 = forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> b
snd (forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall n. Num n => [[(n, n)]]
Math.stern_brocot_tree_lhs)
a053121 :: Num n => [n]
a053121 :: forall n. Num n => [n]
a053121 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall i. Num i => [[i]]
a053121_tbl
a053121_tbl :: Num n => [[n]]
a053121_tbl :: forall i. Num i => [[i]]
a053121_tbl = forall a. (a -> a) -> a -> [a]
iterate (\[n]
row -> forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (n
0 forall a. a -> [a] -> [a]
: [n]
row) (forall a. [a] -> [a]
tail [n]
row forall a. [a] -> [a] -> [a]
++ [n
0, n
0])) [n
1]
a058265 :: Num n => [n]
a058265 :: forall n. Num n => [n]
a058265 = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
digitToInt) [Char]
"183928675521416113255185256465328660042417874609759224677875863940420322208196642573843541942830701414197982685924097416417845074650743694383154582049951379624965553964461366612154027797267811894104121160922328215595607181671218236598665227337853781569698925211739579141322872106187898408525495693114534913498534595761750359652213238142472727224173581877000697905510254904496571074252654772281100659893755563630933305282623575385197199429914530082546639774729005870059744813919316728258488396263329709" forall a. [a] -> [a] -> [a]
++ forall a. HasCallStack => [Char] -> a
error [Char]
"A058265"
a058265_k :: Floating n => n
a058265_k :: forall n. Floating n => n
a058265_k = (n
1forall a. Fractional a => a -> a -> a
/n
3) forall a. Num a => a -> a -> a
* (n
1 forall a. Num a => a -> a -> a
+ (n
19 forall a. Num a => a -> a -> a
+ n
3 forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
sqrt n
33) forall a. Floating a => a -> a -> a
** (n
1forall a. Fractional a => a -> a -> a
/n
3) forall a. Num a => a -> a -> a
+ (n
19 forall a. Num a => a -> a -> a
- n
3 forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
sqrt n
33) forall a. Floating a => a -> a -> a
** (n
1forall a. Fractional a => a -> a -> a
/n
3))
a060588a :: Integral n => [n]
a060588a :: forall n. Integral n => [n]
a060588a = forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
a060588a_n [n
0..]
a060588a_n :: Integral n => n -> n
a060588a_n :: forall n. Integral n => n -> n
a060588a_n n
n = (-n
n forall a. Num a => a -> a -> a
- forall a b. (RealFrac a, Integral b) => a -> b
floor (forall a b. (Integral a, Num b) => a -> b
fromIntegral n
n forall a. Fractional a => a -> a -> a
/ (Double
3::Double))) forall a. Integral a => a -> a -> a
`mod` n
3
a061654 :: Integral n => [n]
a061654 :: forall n. Integral n => [n]
a061654 = forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
a061654_n [n
0 ..]
a061654_n :: Integral n => n -> n
a061654_n :: forall n. Integral n => n -> n
a061654_n n
n = (n
3 forall a. Num a => a -> a -> a
* n
16forall a b. (Num a, Integral b) => a -> b -> a
^n
n forall a. Num a => a -> a -> a
+ n
2) forall a. Integral a => a -> a -> a
`div` n
5
a071996 :: Integral n => [n]
a071996 :: forall n. Integral n => [n]
a071996 =
let f :: t -> a
f t
n =
case t
n of
t
0 -> forall a. HasCallStack => [Char] -> a
error [Char]
"A071996"
t
1 -> a
0
t
2 -> a
1
t
_ -> let m :: t
m = forall a b. (RealFrac a, Integral b) => a -> b
floor (forall a b. (Integral a, Num b) => a -> b
fromIntegral t
n forall a. Fractional a => a -> a -> a
/ (Double
3::Double)) in t -> a
f t
m forall a. Num a => a -> a -> a
+ t -> a
f (t
n forall a. Num a => a -> a -> a
- t
m)
in forall a b. (a -> b) -> [a] -> [b]
map forall {a} {i}. (Num i, Integral a) => a -> i
f [Int
1::Int ..]
a073334 :: Num n => [n]
a073334 :: forall n. Num n => [n]
a073334 =
let f :: Int -> a
f Int
n = forall n. Num n => [n]
a000045 forall a. [a] -> Int -> a
!! ((forall n. Integral n => [n]
a005811 forall a. [a] -> Int -> a
!! Int
n) forall a. Num a => a -> a -> a
+ Int
4)
in n
3 forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall {a}. Num a => Int -> a
f [Int
1..]
a080843 :: Integral n => [n]
a080843 :: forall n. Integral n => [n]
a080843 =
let rw :: a -> [a]
rw a
n = case a
n of {a
0 -> [a
0,a
1];a
1 -> [a
0,a
2];a
2 -> [a
0];a
_ -> forall a. HasCallStack => [Char] -> a
error [Char]
"A080843"}
unf :: [[a]] -> [a]
unf = let f :: Int -> [[a]] -> [a]
f Int
n [[a]]
l = case [[a]]
l of {[] -> forall a. HasCallStack => [Char] -> a
error [Char]
"A080843";[a]
x:[[a]]
xs -> forall a. Int -> [a] -> [a]
drop Int
n [a]
x forall a. [a] -> [a] -> [a]
++ Int -> [[a]] -> [a]
f (forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
x) [[a]]
xs} in forall {a}. Int -> [[a]] -> [a]
f Int
0
in forall {a}. [[a]] -> [a]
unf (forall a. (a -> a) -> a -> [a]
iterate (forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall {a} {a}. (Eq a, Num a, Num a) => a -> [a]
rw) [n
0])
a080992 :: Num n => [n]
a080992 :: forall n. Num n => [n]
a080992 =
[n
16,n
03,n
02,n
13
,n
05,n
10,n
11,n
08
,n
09,n
06,n
07,n
12
,n
04,n
15,n
14,n
01]
a083866 :: (Enum n,Num n) => [n]
a083866 :: forall n. (Enum n, Num n) => [n]
a083866 = forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> b
snd (forall a. (a -> Bool) -> [a] -> [a]
filter ((forall a. Eq a => a -> a -> Bool
== (Int
0::Int)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) (forall a b. [a] -> [b] -> [(a, b)]
zip forall n. Num n => [n]
a004718 [n
0..]))
a095660 :: Num i => [i]
a095660 :: forall n. Num n => [n]
a095660 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall i. Num i => [[i]]
a095660_tbl
a095660_tbl :: Num i => [[i]]
a095660_tbl :: forall i. Num i => [[i]]
a095660_tbl =
let f :: [c] -> [c]
f [c]
r = forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (c
0 forall a. a -> [a] -> [a]
: [c]
r) ([c]
r forall a. [a] -> [a] -> [a]
++ [c
0])
in [i
3] forall a. a -> [a] -> [a]
: forall a. (a -> a) -> a -> [a]
iterate forall {a}. Num a => [a] -> [a]
f [i
1,i
3]
a095666 :: Num i => [i]
a095666 :: forall n. Num n => [n]
a095666 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall i. Num i => [[i]]
a095666_tbl
a095666_tbl :: Num i => [[i]]
a095666_tbl :: forall i. Num i => [[i]]
a095666_tbl =
let f :: [c] -> [c]
f [c]
r = forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (c
0 forall a. a -> [a] -> [a]
: [c]
r) ([c]
r forall a. [a] -> [a] -> [a]
++ [c
0])
in [i
4] forall a. a -> [a] -> [a]
: forall a. (a -> a) -> a -> [a]
iterate forall {a}. Num a => [a] -> [a]
f [i
1,i
4]
a096940 :: Num i => [i]
a096940 :: forall n. Num n => [n]
a096940 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall i. Num i => [[i]]
a096940_tbl
a096940_tbl :: Num i => [[i]]
a096940_tbl :: forall i. Num i => [[i]]
a096940_tbl =
let f :: [c] -> [c]
f [c]
r = forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (c
0 forall a. a -> [a] -> [a]
: [c]
r) ([c]
r forall a. [a] -> [a] -> [a]
++ [c
0])
in [i
5] forall a. a -> [a] -> [a]
: forall a. (a -> a) -> a -> [a]
iterate forall {a}. Num a => [a] -> [a]
f [i
1,i
5]
a105809 :: Num n => [n]
a105809 :: forall n. Num n => [n]
a105809 = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall i. Num i => [[i]]
a105809_tbl
a105809_tbl :: Num n => [[n]]
a105809_tbl :: forall i. Num i => [[i]]
a105809_tbl =
let f :: ([c], [c]) -> ([c], [c])
f (c
u:[c]
_, [c]
vs) = ([c]
vs, forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. Num a => a -> a -> a
(+) (c
u forall a. a -> [a] -> [a]
: [c]
vs) ([c]
vs forall a. [a] -> [a] -> [a]
++ [c
0]))
f ([c], [c])
_ = forall a. HasCallStack => [Char] -> a
error [Char]
"A105809"
in forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst (forall a. (a -> a) -> a -> [a]
iterate forall {c}. Num c => ([c], [c]) -> ([c], [c])
f ([n
1], [n
1, n
1]))
a124010 :: Integral n => [n]
a124010 :: forall n. Integral n => [n]
a124010 = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall n. Integral n => n -> [n]
a124010_row [n
1..]
a124010_row :: Integral n => n -> [n]
a124010_row :: forall n. Integral n => n -> [n]
a124010_row n
n =
let f :: a -> [a] -> [a]
f a
u [a]
w =
case (a
u, [a]
w) of
(a
1, [a]
_) -> []
(a
_, a
p:[a]
ps) ->
let h :: a -> a -> [a]
h a
v a
e =
let (a
v', a
m) = forall a. Integral a => a -> a -> (a, a)
divMod a
v a
p
in if a
m forall a. Eq a => a -> a -> Bool
== a
0
then a -> a -> [a]
h a
v' (a
e forall a. Num a => a -> a -> a
+ a
1)
else if a
e forall a. Ord a => a -> a -> Bool
> a
0
then a
e forall a. a -> [a] -> [a]
: a -> [a] -> [a]
f a
v [a]
ps
else a -> [a] -> [a]
f a
v [a]
ps
in a -> a -> [a]
h a
u a
0
(a, [a])
_ -> forall a. HasCallStack => [Char] -> a
error [Char]
"a124010"
in if n
n forall a. Eq a => a -> a -> Bool
== n
1 then [n
0] else forall {a} {a}. (Num a, Ord a, Integral a) => a -> [a] -> [a]
f n
n forall n. Integral n => [n]
a000040
a124472 :: Num n => [n]
a124472 :: forall n. Num n => [n]
a124472 =
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat
[[n
200,n
217,n
232,n
249,n
8,n
25,n
40,n
57,n
72,n
89,n
104,n
121,n
136,n
153,n
168,n
185]
,[n
58,n
39,n
26,n
7,n
250,n
231,n
218,n
199,n
186,n
167,n
154,n
135,n
122,n
103,n
90,n
71]
,[n
198,n
219,n
230,n
251,n
6,n
27,n
38,n
59,n
70,n
91,n
102,n
123,n
134,n
155,n
166,n
187]
,[n
60,n
37,n
28,n
5,n
252,n
229,n
220,n
197,n
188,n
165,n
156,n
133,n
124,n
101,n
92,n
69]
,[n
201,n
216,n
233,n
248,n
9,n
24,n
41,n
56,n
73,n
88,n
105,n
120,n
137,n
152,n
169,n
184]
,[n
55,n
42,n
23,n
10,n
247,n
234,n
215,n
202,n
183,n
170,n
151,n
138,n
119,n
106,n
87,n
74]
,[n
203,n
214,n
235,n
246,n
11,n
22,n
43,n
54,n
75,n
86,n
107,n
118,n
139,n
150,n
171,n
182]
,[n
53,n
44,n
21,n
12,n
245,n
236,n
213,n
204,n
181,n
172,n
149,n
140,n
117,n
108,n
85,n
76]
,[n
205,n
212,n
237,n
244,n
13,n
20,n
45,n
52,n
77,n
84,n
109,n
116,n
141,n
148,n
173,n
180]
,[n
51,n
46,n
19,n
14,n
243,n
238,n
211,n
206,n
179,n
174,n
147,n
142,n
115,n
110,n
83,n
78]
,[n
207,n
210,n
239,n
242,n
15,n
18,n
47,n
50,n
79,n
82,n
111,n
114,n
143,n
146,n
175,n
178]
,[n
49,n
48,n
17,n
16,n
241,n
240,n
209,n
208,n
177,n
176,n
145,n
144,n
113,n
112,n
81,n
80]
,[n
196,n
221,n
228,n
253,n
4,n
29,n
36,n
61,n
68,n
93,n
100,n
125,n
132,n
157,n
164,n
189]
,[n
62,n
35,n
30,n
3,n
254,n
227,n
222,n
195,n
190,n
163,n
158,n
131,n
126,n
99,n
94,n
67]
,[n
194,n
223,n
226,n
255,n
2,n
31,n
34,n
63,n
66,n
95,n
98,n
127,n
130,n
159,n
162,n
191]
,[n
64,n
33,n
32,n
1,n
256,n
225,n
224,n
193,n
192,n
161,n
160,n
129,n
128,n
97,n
96,n
65]]
a125519 :: Num n => [n]
a125519 :: forall n. Num n => [n]
a125519 = [n
831,n
326,n
267,n
574,n
584,n
257,n
316,n
841,n
158,n
683,n
742,n
415,n
425,n
732,n
673,n
168]
a126275 :: Integral n => [n]
a126275 :: forall n. Integral n => [n]
a126275 = forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
a126275_n [n
2..]
a126275_n :: Integral n => n -> n
a126275_n :: forall n. Integral n => n -> n
a126275_n n
n = (n
n forall a b. (Num a, Integral b) => a -> b -> a
^ (Int
2::Int) forall a. Num a => a -> a -> a
* (n
n forall a b. (Num a, Integral b) => a -> b -> a
^ (Int
4::Int) forall a. Num a => a -> a -> a
- n
1)) forall a. Integral a => a -> a -> a
`div` n
12
a126276 :: Integral n => [n]
a126276 :: forall n. Integral n => [n]
a126276 = forall a b. (a -> b) -> [a] -> [b]
map forall n. Integral n => n -> n
a126276_n [n
2..]
a126276_n :: Integral n => n -> n
a126276_n :: forall n. Integral n => n -> n
a126276_n n
n = (n
n forall a b. (Num a, Integral b) => a -> b -> a
^ (Int
3::Int) forall a. Num a => a -> a -> a
* (n
n forall a b. (Num a, Integral b) => a -> b -> a
^ (Int
3::Int) forall a. Num a => a -> a -> a
+ n
1) forall a. Num a => a -> a -> a
* (n
n forall a b. (Num a, Integral b) => a -> b -> a
^ (Int
2::Int) forall a. Num a => a -> a -> a
- n
1)) forall a. Integral a => a -> a -> a
`div` n
12
a126651 :: Num n => [n]
a126651 :: forall n. Num n => [n]
a126651 =
[n
71, n
1, n
51, n
32, n
50, n
2, n
80
,n
21, n
41, n
61, n
56, n
26, n
13, n
69
,n
31, n
81, n
11, n
20, n
62, n
65, n
17
,n
34, n
40, n
60, n
43, n
28, n
64, n
18
,n
48, n
42, n
22, n
54, n
39, n
75, n
7
,n
33, n
53, n
15, n
68, n
16, n
44, n
58
,n
49, n
29, n
67, n
14, n
66, n
24, n
38]
a126652 :: Num n => [n]
a126652 :: forall n. Num n => [n]
a126652 = [n
40, n
5, n
30, n
15, n
25, n
35, n
20, n
45, n
10]
a126653 :: Num n => [n]
a126653 :: forall n. Num n => [n]
a126653 = [n
24, n
3, n
18, n
9, n
15, n
21, n
12, n
27, n
6]
a126654 :: Num n => [n]
a126654 :: forall n. Num n => [n]
a126654 = [n
32, n
4, n
24, n
12, n
20, n
28, n
16, n
36, n
8]
a126709 :: Num n => [n]
a126709 :: forall n. Num n => [n]
a126709 =
[n
4,n
9,n
2
,n
3,n
5,n
7
,n
8,n
1,n
6]
a126710 :: Num n => [n]
a126710 :: forall n. Num n => [n]
a126710 =
[ n
7,n
12, n
1,n
14
, n
2,n
13, n
8,n
11
,n
16, n
3,n
10, n
5
, n
9, n
6,n
15, n
4]
a126976 :: Num n => [n]
a126976 :: forall n. Num n => [n]
a126976 =
[n
06,n
32,n
03,n
34,n
35,n
01
,n
07,n
11,n
27,n
28,n
08,n
30
,n
19,n
14,n
16,n
15,n
23,n
24
,n
18,n
20,n
22,n
21,n
17,n
13
,n
25,n
29,n
10,n
09,n
26,n
12
,n
36,n
05,n
33,n
04,n
02,n
31]
a212804 :: Integral n => [n]
a212804 :: forall n. Integral n => [n]
a212804 = n
1 forall a. a -> [a] -> [a]
: forall n. Num n => [n]
a000045
a245553 :: Integral n => [n]
a245553 :: forall n. Integral n => [n]
a245553 =
let rw :: a -> [a]
rw a
n = case a
n of {a
1 -> [a
2,a
3];a
2 -> [a
3];a
3 -> [a
1];a
_ -> forall a. HasCallStack => [Char] -> a
error [Char]
"A245553"}
jn :: [a] -> [a]
jn [a]
x = [a]
x forall a. [a] -> [a] -> [a]
++ forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall {a} {a}. (Eq a, Num a, Num a) => a -> [a]
rw [a]
x
unf :: [[a]] -> [a]
unf = let f :: Int -> [[a]] -> [a]
f Int
n [[a]]
l = case [[a]]
l of {[] -> forall a. HasCallStack => [Char] -> a
error [Char]
"A245553";[a]
x:[[a]]
xs -> forall a. Int -> [a] -> [a]
drop Int
n [a]
x forall a. [a] -> [a] -> [a]
++ Int -> [[a]] -> [a]
f (forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
x) [[a]]
xs} in forall {a}. Int -> [[a]] -> [a]
f Int
0
in forall {a}. [[a]] -> [a]
unf (forall a. (a -> a) -> a -> [a]
iterate forall {a}. (Eq a, Num a) => [a] -> [a]
jn [n
1])
a255723 :: Num n => [n]
a255723 :: forall n. Num n => [n]
a255723 = n
0 forall a. a -> [a] -> [a]
: forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat (forall a. [[a]] -> [[a]]
transpose [forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
subtract n
2) forall n. Num n => [n]
a255723
,forall a b. (a -> b) -> [a] -> [b]
map (-n
1 forall a. Num a => a -> a -> a
-) forall n. Num n => [n]
a255723
,forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
+ n
2) forall n. Num n => [n]
a255723
,forall a. [a] -> [a]
tail forall n. Num n => [n]
a255723])
a256184 :: Num n => [n]
a256184 :: forall n. Num n => [n]
a256184 = n
0 forall a. a -> [a] -> [a]
: forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat (forall a. [[a]] -> [[a]]
transpose [forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
subtract n
2) forall n. Num n => [n]
a256184
,forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
subtract n
1) forall n. Num n => [n]
a256184
,forall a b. (a -> b) -> [a] -> [b]
map forall {a}. Num a => a -> a
negate (forall a. [a] -> [a]
tail forall n. Num n => [n]
a256184)])
a256185 :: Num n => [n]
a256185 :: forall n. Num n => [n]
a256185 = n
0 forall a. a -> [a] -> [a]
: forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat (forall a. [[a]] -> [[a]]
transpose [forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
subtract n
3) forall n. Num n => [n]
a256185
,forall a b. (a -> b) -> [a] -> [b]
map (-n
2 forall a. Num a => a -> a -> a
-) forall n. Num n => [n]
a256185
,forall a b. (a -> b) -> [a] -> [b]
map forall {a}. Num a => a -> a
negate (forall a. [a] -> [a]
tail forall n. Num n => [n]
a256185)])
a270876 :: Integral n => [n]
a270876 :: forall n. Integral n => [n]
a270876 = [n
1,n
0,n
1,n
255,n
251449712]
a320872 :: Num n => [n]
a320872 :: forall n. Num n => [n]
a320872 =
[n
17, n
89, n
71, n
113, n
59, n
5, n
47, n
29, n
101
,n
41, n
89, n
83, n
113, n
71, n
29, n
59, n
53, n
101
,n
37, n
79, n
103, n
139, n
73, n
7, n
43, n
67, n
109
,n
29, n
131, n
107, n
167, n
89, n
11, n
71, n
47, n
149
,n
43, n
127, n
139, n
199, n
103, n
7, n
67, n
79, n
163
,n
37, n
151, n
139, n
211, n
109, n
7, n
79, n
67, n
181
,n
43, n
181, n
157, n
241, n
127, n
13, n
97, n
73, n
211]