Loïc Grenié on Fri, 20 Jan 2023 11:43:52 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Computing integer sequences via integrals |
I am trying to compute integer sequences via closed
forms of definite integrals, but probably this is impossible.
The question is: which integer sequences can be computed
by integrals?
Partial results:
Trying to "discretize" the reals, we are using floor()
and the area of the definite integrals.
For a start consider the plot of floor(x).
? ploth(x=1,10,floor(x))
The area is the union of rectangles and for integer
bounds the area is integer.
sagemath computes the following indefinite integrals:
sage: integrate(floor(x),x)
1/2*(2*x - floor(x) - 1)*floor(x)
sage: integrate(floor(x)^2,x)
x*floor(x)^2
The area for floor(x) and the sum(i=1,N-1,x) appear to be computed correctly:
sage: I1=integrate(floor(x),x)
sage: N=13;[I1(x=N)-I1(x=1)-N*(N-1)/2]
[0]
The area for floor(x)^2 doesn't work for me, why?
floor() might not be elementary function, but there is closed
form for it using exp() and log(), taking the principal
branch of the logarithm:
? floor1(x)=x - 1/2*I*log(-exp(-2*I*Pi*x))/Pi - 1/2
%12 = (x)->x-1/2*I*log(-exp(-2*I*Pi*x))/Pi-1/2
? floor1(13.1)
%13 = 13.000000000000000000000000000000000000 + 0.E-39*I