OFFSET
0,7
FORMULA
a(n) = floor((n + 1) log Pi) - floor(n log Pi). - Alonso del Arte, Dec 20 2018
EXAMPLE
Pi^5 = 306.01968478528145326274131... and Pi^6 = 961.389193575304437...; in between them we find e^6 = 403.4287934927351226... and no other powers of e with integer exponents. Hence a(5) = 1.
Pi^6 = 961.389193575304437... and Pi^7 = 3020.2932277767920675142...; in between them we find e^7 = 1096.63315842845859926372... and e^8 = 2980.957987041728274743592... Hence a(6) = 2.
MAPLE
Digits:= 30:
log_Pi:= evalf(log(Pi));
a:= n-> floor((n+1)*log_Pi) -floor(n*log_Pi):
seq(a(n), n=0..80); # Alois P. Heinz, Dec 21 2018
MATHEMATICA
Table[Floor[(n + 1)Log[Pi]] - Floor[n Log[Pi]], {n, 0, 99}] (* Alonso del Arte, Dec 21 2018 *)
PROG
(Scala) val logPi = Math.log(Math.PI); for (n <- 0 to 99) yield (Math.floor(logPi * (n + 1)) - Math.floor(logPi * n)).toInt // Alonso del Arte, Dec 21 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved