This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* 累乗関数 *) | |
(* 数でも行列でも使える *) | |
let rec pow a n op un = (* opが演算子、unがunit *) | |
if n == 0 then un | |
else | |
let b = pow a (n/2) op un in | |
if n mod 2 == 0 then op b b | |
else op b (op b a);; | |
let m = pow 10 6 ( * ) 1;; | |
(* mod mでの計算の演算子 *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# phi関数の乗法性を用いる | |
# n!を素因数分解して、各素因数についてphi(p^e)を求めて掛け合わせる | |
# 階乗の素因数分解は良い求め方がある | |
# http://qiita.com/HirotoKagotani/items/87234e4104cb2b7fb8ff | |
# | |
# 累乗もmodで求めた方がいいかと思ったが、大丈夫だった | |
modulus = 1000003 | |
# nまでの素数を配列に入れて返す |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% エラーが出る場合はフォントをTeX側から見える位置に置くか, | |
% export OSFONTDIR=/usr/shar/fonts とする. | |
% http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1904 | |
\documentclass[a4paper, ja=standard, uplatex, dvipdfmx]{bxjsarticle} | |
\title{title} | |
\author{author} | |
\usepackage[deluxe]{otf} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[uplatex]{jsarticle} | |
\usepackage[deluxe]{otf} | |
\usepackage[directunicode*, noalphabet]{pxchfon}[2017/04/08] | |
\setminchofont[0]{SourceHanSerif-Regular.ttc} | |
\setboldminchofont[0]{SourceHanSerif-Bold.ttc} | |
\setgothicfont[0]{SourceHanSans-Regular.ttc} | |
\setboldgothicfont[0]{SourceHanSans-Bold.ttc} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{ltjsarticle} | |
\usepackage[no-math]{luatexja-fontspec} | |
\setmainjfont[BoldFont=Source Han Serif Bold]{Source Han Serif} | |
\setsansjfont[BoldFont=Source Han Sans Bold]{Source Han Sans} | |
%\setmainjfont[BoldFont=file:SourceHanSerif-Bold.ttc(0)]{file:SourceHanSerif-Regular.ttc(0)} | |
%\setsansjfont[BoldFont=file:SourceHanSans-Bold.ttc(0)]{SourceHanSans-Regular.ttc(0)} | |
\begin{document} | |
あいうえお直雲辞間 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[a4paper,xelatex,ja=standard]{bxjsarticle} | |
\setCJKmainfont{Source Han Serif} | |
\setCJKsansfont{Source Han Sans} | |
\begin{document} | |
あいうえお直雲辞間 | |
明朝\textbf{明朝ボールド}\textsf{ゴシック}\textbf{\textsf{ボールドゴシック}} | |
\end{document} |
OlderNewer