sequsequ.py
Simple, high-school-leveled sequence library written in Python
간단한 고등학교 수준 수열 라이브러리 (Python)
Copyright
© 2021 Sanha(sweetcorn1229), all rights reserved.
Docs
Get Started
from sequsequ import *
Sequ
constructor(f)
seq = Sequ(lambda n: 2*n-1)
name | type | required |
---|---|---|
f | function | O |
int/float at(n)
nth term / 제 n항
seq.at(n)
name | type | required |
---|---|---|
n | int | O |
int/float sum(n)
seq.sum(n)
name | type | required |
---|---|---|
n | int | O |
int/float sum(m, n)
seq.sum(m, n)
name | type | required |
---|---|---|
m | int | O |
n | int | O |
int/float product(n)
seq.product(n)
name | type | required |
---|---|---|
n | int | O |
int/float product(m, n)
seq.product(m, n)
name | type | required |
---|---|---|
m | int | O |
n | int | O |
ArithmeticSequ extends Sequ
Arithmetic sequence / 등차 수열
constructor(a1, d)
aseq = ArithmeticSequ(a1, d);
name | type | required |
---|---|---|
a1 | int/float | O |
d | int/float | O |
int/float a1
The first term / 초항
aseq.a1
int/float d
Common difference / 공차
aseq.d
int/float limit()
aseq.limit()
int/float series()
aseq.series()
GeometricSequ extends Sequ
Geometric sequence / 등비 수열
constructor(a1, r)
gseq = GeometricSequ(a1, r);
name | type | required |
---|---|---|
a1 | int/float | O |
r | int/float | O |
int/float a1
The first term / 초항
gseq.a1
int/float r
Common ratio / 공비
gseq.r
int/float/str limit()
gseq.limit()
If the limit oscillates, it returns str "oscillation".
int/float/str series()
gseq.series()
If the series oscillates, it returns str "oscillation".
HarmonicSequ extends Sequ
Harmonic sequence / 조화 수열
constructor(a1, d)
hseq = HarmonicSequ(a1, d);
name | type | required |
---|---|---|
a1 | int/float | O |
d | int/float | O |
int/float a1
The first term / 초항
hseq.a1
int/float d
Common difference / 공비
hseq.d
int/float limit()
hseq.limit()