Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[問題案]Bernoulli Number(bernoulli_number) #75

Closed
yosupo06 opened this issue Sep 24, 2019 · 4 comments
Closed

[問題案]Bernoulli Number(bernoulli_number) #75

yosupo06 opened this issue Sep 24, 2019 · 4 comments
Assignees

Comments

@yosupo06
Copy link
Owner

@yosupo06 yosupo06 commented Sep 24, 2019

#3 (comment)

$N$ が与えられます。ベルヌーイ数 B_0, B_1, B_2, ..., B_N を mod 998244353 で出力してください。

  • 0 <= N <= 500,000
@yosupo06 yosupo06 added this to 精査待ち in 問題リスト via automation Sep 24, 2019
@yosupo06 yosupo06 changed the title [問題案]Bernoulli number [問題案]Bernoulli Number Sep 24, 2019
@yosupo06

This comment has been minimized.

Copy link
Owner Author

@yosupo06 yosupo06 commented Sep 27, 2019

これ母関数計算するだけなら一瞬で準備終わらないか?やるか

@yosupo06 yosupo06 changed the title [問題案]Bernoulli Number [問題案]Bernoulli Number(bernoulli_number) Sep 27, 2019
@yosupo06 yosupo06 moved this from 精査待ち to 作業待ち in 問題リスト Sep 27, 2019
@yosupo06 yosupo06 self-assigned this Sep 28, 2019
@yosupo06

This comment has been minimized.

Copy link
Owner Author

@yosupo06 yosupo06 commented Sep 30, 2019

x / (exp(x) - 1)を俺のライブラリで計算したら愚直と違うものが出てきた

@hos-lyric

This comment has been minimized.

Copy link
Contributor

@hos-lyric hos-lyric commented Oct 1, 2019

ありがち:

  • n! で割ってない
  • exp(X) - 1 が可逆ではないために正しく割り算できてない

実は Bernoulli 数の流儀は符号が若干諸説あるらしい
B_0 から順に 1, -1/2, 1/6, 0, -1/30, 0, 1/42, ... が標準的なのかな

@yosupo06

This comment has been minimized.

Copy link
Owner Author

@yosupo06 yosupo06 commented Oct 2, 2019

n!をかけたらうまく行き始めました ありがとうございます

@yosupo06 yosupo06 closed this Oct 3, 2019
問題リスト automation moved this from 作業待ち to 作成済み Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
問題リスト
  
作成済み
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.