\documentclass{article}
\usepackage{graphicx}  
\usepackage[landscape]{geometry}
\usepackage[pdftex]{color}
\usepackage{url}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{amsfonts}
\newcommand{\ex}{\color{blue}}
\pagestyle{empty}
\newcommand{\kr}[2]{\left(\frac{#1}{#2}\right)}
\advance\topmargin-.9in
\advance\textheight2in
\advance\textwidth3.0in
\advance\oddsidemargin-1.45in
\advance\evensidemargin-1.45in
\parindent0pt
\parskip2pt
\newcommand{\hr}{\centerline{\rule{3.5in}{1pt}}}
\newcommand{\ZZ}{\mathbf{Z}}

      \usepackage[utf8]{inputenc}

      \usepackage[T1]{fontenc}

\begin{document}
\begin{multicols*}{3}
\begin{center}
%\textbf{Sage Quick Reference:\\Elementary Number Theory}\\
%William Stein\\
%Sage Version 3.4\\
%\url{http://wiki.sagemath.org/quickref}\\
%GNU Free Document License, extend for your own use\\
\textbf{Kısa Sage Kılavuzu: Temel Sayılar Kuramı}\\
William Stein (Türkçe'ye uyarlayan Kürşat Aker)\\
%Sage Version 3.4
Sage Sürüm 3.4\\
\url{http://wiki.sagemath.org/quickref}\\
%GNU Free Document License, extend for your own use\\
GNU Özgür Belge Lisansı, Dileğinize göre geliştirin\\
\end{center}
\vspace{-2ex}

 \hr
Bu belge boyunca, $m,n,a,b, vb.$  tamsayılardır ($\in$\texttt{ZZ}).\\
\verb!                 ZZ! =  $\mathbf{Z} $ =  tamsayılar \\
\vspace{-3ex}

%*********************************************
% \hr\textbf{Integers}
 \hr\textbf{Tamsayılar}
\vspace{-2ex}
$$\ldots, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \ldots$$
\vspace{-5ex}

%$n$ divided by $m$ has {\em remainder} \texttt{n \% m}
%
%\texttt{gcd(n,m), gcd({\it list})}
%
%extended gcd $g = sa + tb=\gcd(a,b)$: \texttt{g,s,t=xgcd(a,b)}
%
%\texttt{lcm(n,m), lcm({\it list})}
%
%binomial coefficient $\binom{m}{n} = $ \texttt{binomial(m,n)}
%
%digits in a given base: \texttt{n.digits({\it base})}
%
%number of digits: \texttt{n.ndigits({\it base})}
%
%({\it base} is optional and defaults to 10)
%
%divides $n\mid m$: \texttt{n.divides(m)} if $nk=m$ some $k$
%
%divisors -- all $d$ with $d\mid n$: \texttt{n.divisors()}
%
%factorial -- $n! = $ \texttt{n.factorial()}

$n$'nin $m$ ile bölümünden {\em kalan} $=$ \texttt{n \% m}

\texttt{gcd(n,m), gcd({\it sayı listesi})} obeb

ayrıntılı obeb $g = sa + tb=\gcd(a,b)$: \texttt{g,s,t=xgcd(a,b)}

\texttt{lcm(n,m), lcm({\it sayı listesi})} ekok

binom katsayı $\binom{m}{n} = $ \verb!binomial(m,n)!

\texttt{n}'nin verilen {\it taban}'ındaki ifadesi: \texttt{n.digits({\it taban})}

\texttt{n}'nin bu {\it taban}'daki basamak sayısı: \texttt{n.ndigits({\it taban})}

({\it taban} tercihe bağlıdır, belirtilmezse 10 olarak varsayılır)

$n\mid m$ ($n$, $m$'yi böler) : \texttt{n.divides(m)} 
%bir $k$ için $nk=m$ ise

bölenler -- $d\mid n$ olan tüm $d$'ler: \texttt{n.divisors()}

faktöriyel -- $n! = $ \texttt{n.factorial()}

%*********************************************
% \hr\textbf{Prime Numbers}
%\vspace{-2ex}
%
%$$2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, \ldots$$
%\vspace{-4ex}
%
%factorization: \texttt{factor(n)}
%
%primality testing: \texttt{is\_prime(n)}, \texttt{is\_pseudoprime(n)}
%
%prime power testing: \texttt{is\_prime\_power(n)}
%
%$\pi(x) = \#\{p: p \leq x\text{ is prime}\} = $ \texttt{prime\_pi(x)}
%
%set of prime numbers: \texttt{Primes()}
%
%$\{p : m \leq p < n\text{ and $p$ prime}\} = $\texttt{prime\_range(m,n)}
%
%prime powers: \texttt{prime\_powers(m,n)} 
%
%first $n$ primes: \texttt{primes\_first\_n(n)}
%
%next and previous primes: \texttt{next\_prime(n)}, \\
%\mbox{}\quad\texttt{previous\_prime(n)},  \texttt{next\_probable\_prime(n)}
%
%prime powers:\\
%\mbox{}\quad\texttt{next\_prime\_power(n)}, \texttt{pevious\_prime\_power(n)}
%
%
%Lucas-Lehmer test for primality of $2^p-1$\\
%\verb|  def is_prime_lucas_lehmer(p):|\\
%\verb|      s = Mod(4, 2^p - 1)|\\
%\verb|      for i in range(3, p+1): s = s^2 - 2|\\
%\verb|      return s == 0|\\

 \hr\textbf{Asal Sayılar}
\vspace{-2ex}

$$2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, \ldots$$
\vspace{-4ex}

çarpanlara ayırma: \texttt{factor(n)}

asal mı?: \texttt{is\_prime(n)}, \texttt{is\_pseudoprime(n)}

asal kuvveti mi?: \texttt{is\_prime\_power(n)}

$\pi(x) = |\{p: p \leq x\text{ asal }\}| = $ \texttt{prime\_pi(x)}

asal sayılar kümesi: \texttt{Primes()}

$\{p : m \leq p < n\text{ ve $p$ asal}\} = $\texttt{prime\_range(m,n)}

asal kuvvetleri: \texttt{prime\_powers(m,n)} 

ilk $n$ asal sayı: \texttt{primes\_first\_n(n)}

bir sonraki ve bir önceki asal sayı: \texttt{next\_prime(n)}, \\
\mbox{}\quad\texttt{previous\_prime(n)},  \texttt{next\_probable\_prime(n)}

bir sonraki ve bir önceki asal kuvveti:\\
\mbox{}\quad\texttt{next\_prime\_power(n)}, \texttt{pevious\_prime\_power(n)}


$2^p-1$ için Lucas-Lehmer asallık testi:\\
\verb|  def is_prime_lucas_lehmer(p):|\\
\verb|      s = Mod(4, 2^p - 1)|\\
\verb|      for i in range(3, p+1): s = s^2 - 2|\\
\verb|      return s == 0|\\

%*********************************************
% \hr\textbf{Modular Arithmetic and Congruences}
%
%{\tiny
%\verb|k=12; m = matrix(ZZ, k, [(i*j)%k for i in [0..k-1] for j in [0..k-1]]); m.plot(cmap='gray')|}
%
%\mbox{}\qquad\qquad
%\includegraphics[width=14em]{mod12}
%
%Euler's $\phi(n)$ function: \texttt{euler\_phi(n)}
%
%Kronecker symbol $\kr{a}{b} = $ \texttt{kronecker\_symbol(a,b)}
%
%Quadratic residues: \texttt{quadratic\_residues(n)}
%
%Quadratic non-residues: \texttt{quadratic\_residues(n)}
%
%ring $\ZZ/n\ZZ = $ \texttt{Zmod(n) = IntegerModRing(n)}
%
%$a$ modulo $n$ as element of $\ZZ/n\ZZ$: \texttt{Mod(a, n)}
%
%
%primitive root modulo $n = $ \texttt{primitive\_root(n)}
%
%inverse of $n\pmod{m}$: \texttt{n.inverse\_mod(m)}
%
%power $a^n\pmod{m}$: \texttt{power\_mod(a, n, m)}
%
%Chinese remainder theorem: \texttt{x = crt(a,b,m,n)}\\
%\mbox{} \qquad finds $x$ with $x\equiv a\pmod{m}$ and $x\equiv b\pmod{n}$
%
%discrete log: \texttt{log(Mod(6,7), Mod(3,7))}
%
%order of $a\pmod{n}=$\texttt{Mod(a,n).multiplicative\_order()}
%
%square root of $a\pmod{n}=$\texttt{Mod(a,n).sqrt()}

 \hr\textbf{Modüler Aritmetik ve Kalandaşlık}

{\tiny
\verb|k=12; m = matrix(ZZ, k, [(i*j)%k for i in [0..k-1] for j in [0..k-1]]); m.plot(cmap='gray')|}

\mbox{}\qquad\qquad
\includegraphics[width=14em]{mod12}

Euler $\phi(n)$ fonksiyonu: \texttt{euler\_phi(n)}

Kronecker simgesi $\kr{a}{b} = $ \texttt{kronecker\_symbol(a,b)}

Karesel kalandaşlar: \texttt{quadratic\_residues(n)}

Karesel kalandaş olmayanlar: \texttt{quadratic\_residues(n)}

$\ZZ/n\ZZ$ halkası $ = $ \texttt{Zmod(n) = IntegerModRing(n)}

$a$'nın $n$'ye göre kalanı ($\in \ZZ/n\ZZ$): \texttt{Mod(a, n)}

$n$'ye göre ilkel kökler $ = $ \texttt{primitive\_root(n)}

$a$'nın çarpmaya göre tersi  $\in \ZZ/n\ZZ$: \texttt{a.inverse\_mod(n)}

$a^m  \in \ZZ/n\ZZ$ : \texttt{power\_mod(a, m, n)}

Çin Kalan Teoremi: \texttt{x = crt(a,b,m,n)}\\
\mbox{}\,  Öyle bir $x$ bul ki, $x\equiv a\pmod{m}$ ve $x\equiv b\pmod{n}$'dir.

kesikli logaritma: \texttt{log(Mod(6,7), Mod(3,7))}

$a$'nın mertebesi $=$ \texttt{Mod(a,n).multiplicative\_order()}

%$a \in \ZZ/n\ZZ$'nın karekökü $=$ \texttt{Mod(a,n).sqrt()}
$a$'nın $\bmod{\, n}$'de  karekökü $=$ \texttt{Mod(a,n).sqrt()}


%*********************************************
% \hr\textbf{Special Functions}
%
%{\tiny\verb|complex_plot(zeta, (-30,5), (-8,8))|}
%
%\mbox{}\qquad\qquad\includegraphics[width=15em]{zeta}
%
%$\zeta(s) = \prod_{p} \frac{1}{1-p^{-s}} = \sum \frac{1}{n^s} = $ \texttt{zeta(s)}
%
%$\text{Li}(x) = \int_{2}^{x} \frac{1}{\log(t)} dt = $ \texttt{Li(x)}
%
%$\Gamma(s) = \int_0^{\infty} t^{s-1}e^{-t}dt = $ \texttt{gamma(s)}
%
%\mbox{}
%\vspace{9em}

 \hr\textbf{Özel Fonksiyonlar}

{\tiny\verb|complex_plot(zeta, (-30,5), (-8,8))|}

\mbox{}\qquad\qquad\includegraphics[width=15em]{zeta}

$\zeta(s) = \prod_{p} \frac{1}{1-p^{-s}} = \sum \frac{1}{n^s} = $ \texttt{zeta(s)}

$\text{Li}(x) = \int_{2}^{x} \frac{1}{\log(t)} dt = $ \texttt{Li(x)}

$\Gamma(s) = \int_0^{\infty} t^{s-1}e^{-t}dt = $ \texttt{gamma(s)}

\mbox{}
\vspace{9em}

%*********************************************
% \hr\textbf{Continued Fractions}
%
%{\tiny \verb|continued_fraction(pi)|}
%
%{\small $$
%\pi = 3+ \frac{\displaystyle 1}{\displaystyle 7+ \frac{\displaystyle 1}{\displaystyle 15+ \frac{\displaystyle 1}{\displaystyle 1+ \frac{\displaystyle 1}{\displaystyle 292 + \cdots}}}}$$}
%
%continued fraction: \texttt{c=continued\_fraction(x, {\it bits})}
%
%convergents: \texttt{c.convergents()}
%
%convergent numerator $p_n =$ \texttt{c.pn(n)}
%
%convergent denominator $q_n =$ \texttt{c.qn(n)}
%
%value: \texttt{c.value()}

%%%

\hr\textbf{Sürekli Kesirler}

{\tiny \verb|continued_fraction(pi)|}

{\small $$
\pi = 3+ \frac{\displaystyle 1}{\displaystyle 7+ \frac{\displaystyle 1}{\displaystyle 15+ \frac{\displaystyle 1}{\displaystyle 1+ \frac{\displaystyle 1}{\displaystyle 292 + \cdots}}}}$$}

sürekli kesir: \texttt{c=continued\_fraction(x, {\it hassasiyet})}

\texttt{c}'nin yakınsarları: \texttt{c.convergents()}

yakınsar payı, $p_n =$ \texttt{c.pn(n)}

yakınsar paydası, $q_n =$ \texttt{c.qn(n)}

değer: \texttt{c.value()}
 
 
%*********************************************
% \hr\textbf{Elliptic Curves}
%
%{\tiny
%\verb|EllipticCurve([0,0,1,-1,0]).plot(plot_points=300,thickness=3)|}
%
%\mbox{}\qquad\qquad\includegraphics[width=10em]{ec}
%
%\mbox{}\quad\texttt{E = EllipticCurve([$a_1,a_2,a_3,a_4,a_6$])}
%\vspace{-2ex}
%
%$$y^2 + a_1 xy + a_3 y = x^3 + a_2 x^2 + a_4 x + a_6$$
%
%conductor $N$ of $E = $\texttt{E.conductor()}
%
%discriminant $\Delta$ of $E = $\texttt{E.discriminant()}
%
%rank of $E =$  \texttt{E.rank()}
%
%free generators for $E(\mathbf{Q}) = $ \texttt{E.gens()}
%
%$j$-invariant $=$ \texttt{E.j\_invariant()}
%
%$N_p = \#\{\text{solutions to $E$ modulo $p$}\} = $ \texttt{E.Np({\it prime})}
%
%$a_p = p+1 - N_p = $\texttt{E.ap({\it prime})}
%
%$L(E,s) = \sum \frac{a_n}{n^s} = $ \texttt{E.lseries()}
%
%$\text{ord}_{s=1}L(E,s) = $ \texttt{E.analytic\_rank()}

\hr\textbf{Eliptik Eğriler}

{\tiny
\verb|EllipticCurve([0,0,1,-1,0]).plot(plot_points=300,thickness=3)|}

\mbox{}\qquad\qquad\includegraphics[width=10em]{ec}

\mbox{}\quad\texttt{E = EllipticCurve([$a_1,a_2,a_3,a_4,a_6$])}
\vspace{-2ex}

$$y^2 + a_1 xy + a_3 y = x^3 + a_2 x^2 + a_4 x + a_6$$

$E$'nin öncüsü $ = $\texttt{E.conductor()}

$E$'nin diskriminantı, $\Delta$ $ = $  \texttt{E.discriminant()}

$E$'nin rankı $=$  \texttt{E.rank()}

$E(\mathbf{Q})$'nın serbest üretenleri $ = $ \texttt{E.gens()}

$j$-değişmezi $=$ \texttt{E.j\_invariant()}

$N_p = \text{$E$'nin mod $p$'deki noktalarının sayısı} = $ \texttt{E.Np({\it asal})}

$a_p = p+1 - N_p = $\texttt{E.ap({\it asal})}

$L(E,s) = \sum \frac{a_n}{n^s} = $ \texttt{E.lseries()}

$\text{ord}_{s=1}L(E,s) = $ \texttt{E.analytic\_rank()}


%*********************************************
% \hr\textbf{Elliptic Curves Modulo $p$}
%
%{\tiny
%\verb|EllipticCurve(GF(997), [0,0,1,-1,0]).plot()|}
%
%\mbox{}\qquad\qquad\includegraphics[width=7em]{ecmodp}
%
%\mbox{}\quad\texttt{E = EllipticCurve(GF(p), [$a_1,a_2,a_3,a_4,a_6$])}
%
%$\#E(\mathbf{F}_p) = $ \texttt{E.cardinality()}
%
%generators for $E(\mathbf{F}_p) = $ \texttt{E.gens()}
%
%$E(\mathbf{F}_p) = $\texttt{E.points()}


 \hr\textbf{Mod $p$'de Eliptik Eğriler}

{\tiny
\verb|EllipticCurve(GF(997), [0,0,1,-1,0]).plot()|}

\mbox{}\qquad\qquad\includegraphics[width=7em]{ecmodp}

\mbox{}\quad\texttt{E = EllipticCurve(GF(p), [$a_1,a_2,a_3,a_4,a_6$])}

$E(\mathbf{F}_p)$'nin nokta sayısı $=$ \texttt{E.cardinality()}

$E(\mathbf{F}_p)$'nin üretenleri $ = $ \texttt{E.gens()}

$E(\mathbf{F}_p) = $\texttt{E.points()}







%%*********************************************
% \hr\textbf{Binary Quadratic Forms}
%\texttt{QuadraticForm}

%*********************************************
% \hr\textbf{Quadratic Fields}
%\texttt{ZZ[I]}
%\texttt{QuadraticField}

%*********************************************
% \hr\textbf{Cyclotomic Fields}
%\texttt{CyclotomicField}
%\texttt{Gauss sums}


%*********************************************
% \hr\textbf{Finite Fields}
%\texttt{GF(q)}



\end{multicols*}

\end{document}
