Questions tagged [eulers-number]

Euler's number (usually denoted e in mathematics) is a transcendental constant approximately equal to 2.718281828. It is the base of natural logarithms.

The mathematical constant e (wikipedia) can be defined in various equivalent ways:

  • the unique positive real number such that the derivative of the function f(x) = ex is always equal to ex
  • the unique positive real number such that the derivative of the function loge x = 1 / x
  • the limit as n tends to infinity of (1 + 1/n) ^ n
  • the sum of the infinite series 1 / n! as n goes from zero to infinity

Ths first of these accounts for the frequency with which e crops up in models involving compounded growth.

64 questions
0
votes
1 answer

Understanding why my for loop does not work to approximate e

e can be approximated using the formula e = 1 + (1/1!) + (1/2!) + (1/3!)... + (1/n!). I am trying to use for loops to accept whatever integer the user sets n to be. The program should approximate e by using the formula above from (1/1!) + ....…
Zach_P
  • 15
  • 1
  • 4
0
votes
2 answers

Google Puzzle Euler Number

This post is twofold. I am a neophyte to Python. First part. This is my code for the old Google puzzle: 'First 10 digit prime number in the consecutive digits of e' (https://google-tale.blogspot.ca/2008/07/google-billboard-puzzle.html) euler =…
Alan
  • 157
  • 8
0
votes
2 answers

Euler number with tasks

I want to calculate Euler number with multiple threads using this formula =∑((3k) ^ 2 + 1)/(3k)! , k =0,... ,∞ , but I am not getting the right results so far and once of the problems is that when I use fairly big number I am going out of range…
kuskmen
  • 3,648
  • 4
  • 27
  • 54
0
votes
1 answer

Approximate Euler's Number in script

I'm writing a script that calls a function get_fact to calculate Euler's number to 10 decimal places. My function is: function [ nfactorial ] = get_fact( n ) %input a non-negative integer %output is factorial of that integer for i=0:n …
rubisco_
  • 63
  • 1
  • 7
0
votes
1 answer

Euler's and Fibonacci's approximation in script

I have written two function in Matlab; one solves for the factorial of the input and the other solves for the nth term of the Fibonacci sequence. I'm now trying to make a script for each function - one to calculate Euler's number to 10 decimals and…
rubisco_
  • 63
  • 1
  • 7
0
votes
1 answer

solving euler series with python

s(i+1) = ((si)^2 + 45) mod 1,000,000,007 this is one series for which my program works fine s = [0,0] i = 1 for i in range(1,5): s.append((pow(s[i],2) + 45) % 1000000007) print s values we are getting here are S = 0, 45, 2070, 4284945,…
puncrazy
  • 349
  • 2
  • 14
0
votes
3 answers

What's wrong with my code: wrong value output when I try to calculate Euler's number, e, in C?

I'm trying to approximate Euler's number in C using a loop that terminates when the difference between two successive values of e is less than 0.0000001. The value I get is 2.99.. I tried setting it up so that with each iteration, e will be compared…
C.A.T.
  • 5
  • 1
0
votes
1 answer

How to stop Mathematica from giving numerical answer?

I am very new to Mathematica. Everything is a nightmare to me. I am trying to calculate a product Product[((1 - 0.9 z^-1 Power[E, -I k (11 \[Pi])/50]) (1 - 0.9 z^-1 Power[E, I k (11 \[Pi])/50])), {k, 1, 4}] but Mathematica answers on the form (1…
mickey
  • 403
  • 1
  • 6
  • 20
0
votes
1 answer

Euler's pentagonal number function in python

max = 200 max=max+2 ### due to the later code, it got offset by 2 P = [0]*max ### make a list of zeros, length max P[0] = 1 P[1] = 1 print 0,":", P[0] ### print value for n = 0,1 print 1,":", P[1] Psign = [0]*max ### make a list the same length…
0
votes
1 answer

I need to find the Euler number of an image along with number of upstream concavities and conxexities in the image

I m using MATLAB. This is the code I have written I = imread('image.tif'); imshow(I); title('Original'); eul = bweuler(I,8); CH = bwconvhull(BW); bwlabel() it is giving me Euler number but not giving the number of concavities. I know I m…
tarun
  • 21
  • 1
  • 7
-1
votes
2 answers

How do I use e (Eurler's number) and log function correctly in Python?

I'm just trying out maths functions in Python as I'm very new to it and I've noticed something when using e. I'm trying to work out log(1+e^2) which I know from using a calculator is 0.9237 but when I type this out in PyCharm, I get 2.1269. I've…
-1
votes
3 answers

I am trying to calculate a certain number with C++ for loops, but I keep getting the "Program has stopped working" Error message

I am trying to run this code in Dev C++: #include #include using namespace std; int main() { float sum =1; int num = -1; for(int i=1; i<=1000; i++) { num *= i; …
Superhuman
  • 85
  • 9
-1
votes
2 answers

I need help finding the natural log of user generated input

how do I use python to find the natural log of a user's input? import math def log_e(power_of_e): math.log = power_of_e exponent = math.log return exponent my_number = float(input('Enter a number and I will give you it\'s natural…
-2
votes
2 answers

Project Euler: Even Fibonacci numbers

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do…
user8831891
-2
votes
1 answer

is there any way to get the sum of the product of euler's number and an integer, where the integer can range upto 10^6000?

So I tried using BigDecimal which is giving me the value of Euler's number up to 50 decimal points. But since the constraint value is this high the number can range from 1 to 10^6000, and hence I am not getting any precision(making it optimal is…
Orion
  • 11
  • 2