OFFSET
0,3
COMMENTS
Extension of factorial(n) to factim(n,m) defined by the recurrence a(0)=1, a(n)=a(n-1)*(n+m*i). Hence n! = factim(n,0), while the current sequence shows the imaginary parts of factim(n,1). The real parts are in A231530 and squares of magnitudes are in A101686.
From Peter Bala, Jun 01 2023: (Start)
Compare with A105751(n) = the imaginary part of Product_{k = 0..n} (1 + k*sqrt(-1)). Moll (2012) studied the prime divisors of the terms of A105750 - the real part of Product_{k = 0..n} (1 + k*sqrt(-1)) - and divided the primes into three types. Calculation suggests that a similar division holds in this case.
Type 1: the prime p does not divide any element of the sequence. It appears that for this sequence, unlike in A105750, there are no type 1 primes; i.e., every prime p divides some term of the sequence.
Type 2: primes p such that the p-adic valuation v_p(a(n)) has asymptotically linear behavior. An example is given below.
We conjecture that the set of type 2 primes consists of p = 2 and all primes of the form p == 1 (mod 4). See A002144.
Moll's conjecture 5.5 about type 2 primes extends to this sequence and takes the form:
(i) the 2-adic valuation v_2(a(n)) ~ n/4 as n -> oo.
(ii) for a type 2 prime p, the p-adic valuation v_p(a(n)) ~ n/(p - 1) as n -> oo.
Type 3: primes p such that the sequence of p-adic valuations {v_p(a(n)) : n >= 0} exhibits an oscillatory behavior (this phrase is not precisely defined). An example is given below.
We conjecture that the set of type 3 primes is A002145, primes of the form 4*k + 3. (End)
LINKS
Stanislav Sykora, Table of n, a(n) for n = 0..440
Victor H. Moll, An arithmetic conjecture on a sequence of arctangent sums, 2012, see f_n.
FORMULA
From Vladimir Reshetnikov, Oct 22 2015: (Start)
a(n) = Im((1+i)_n) = -Re(Gamma(i)*Gamma(n+1-i))*sinh(Pi)/Pi, where (a)_n is the Pochhammer symbol, i=sqrt(-1).
a(n) = (-1)^n*A003703(n+1).
E.g.f.: sin(log(1-x))/(x-1). (End)
P-recursive: a(n) = (2*n - 1)*a(n-1) - (n^2 - 2*n + 2)*a(n-2) with a(0) = 0 and a(1) = 1. - Peter Bala, Jun 01 2023
EXAMPLE
factim(5,1) = -90+190*i. Hence a(5) = 190.
From Peter Bala, Jun 01 2023: (Start)
Asymptotic linearity for the type 2 prime p = 5: the sequence of 5-adic valuations [ v_5(a(n)) : n = 1..100] = [0, 0, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 5, 5, 5, 6, 5, 6, 6, 7, 6, 6, 7, 7, 7, 8, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 11, 11, 11, 13, 11, 12, 12, 13, 12, 12, 13, 13, 13, 14, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 18, 19, 18, 18, 18, 19, 19, 19, 20, 19, 20, 21, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 24, 25, 24, 24, 24, 25, 25, 25].
Note that v_5(a(100)) = 25 = 100/(5 - 1), in line with Moll's conjecture 5.5 above.
Oscillatory behavior for the type 3 prime p = 3: the sequence of 3-adic valuations [ v_3(a(n)) : n = 1..100] = [0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 3, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 3, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 4, 0, 0, 0, 4, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0]. It appears that v_3(a(n)) = 0 unless n == 0 or 2 (mod 6). (End)
MAPLE
seq(simplify(-sinh(Pi)*Im(I!*(n-I)!)/Pi), n=0..19); # Peter Luschny, Oct 23 2015
MATHEMATICA
Table[Im[Pochhammer[1+I, n]], {n, 0, 20}]
Table[Sum[(-1)^(n+k) StirlingS1[n+1, 2k], {k, 0, (n+1)/2}], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 22 2015 *)
PROG
(PARI) Factim(nmax, m)={local(a, k); a=vector(nmax); a[1]=1+0*I;
for (k=2, nmax, a[k]=a[k-1]*(k-1+m*I); ); return(a); }
a = Factim(1000, 1); imag(a)
(PARI) t(n) = if( n<0, 0, n! * polcoeff(cos(log(1+x+x*O(x^n))), n));
vector(50, n, n--; (-1)^n*t(n+1)) \\ Altug Alkan, Oct 22 2015
(Python)
from sympy.functions.combinatorial.numbers import stirling
def A231531(n): return sum(stirling(n+1, k<<1, kind=1)*(1 if k&1 else -1) for k in range((n+1>>1)+1)) # Chai Wah Wu, Feb 22 2024
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Stanislav Sykora, Nov 10 2013
STATUS
approved