login
A356684
a(n) = (n-1)*a(n-1) - n*a(n-2), with a(1) = a(2) = -1.
1
-1, -1, 1, 7, 23, 73, 277, 1355, 8347, 61573, 523913, 5024167, 53479135, 624890417, 7946278813, 109195935523, 1612048228547, 25439293045885, 427278358483537, 7609502950269503, 143217213477235783, 2840152418116022377
OFFSET
1,4
LINKS
Mohammed Bouras, A new sequence of prime numbers, Romanian Math. Mag. (15 August 2022). See Table 1 p. 1.
FORMULA
a(n) = A051403(n-3) + n*A051403(n-4).
a(n)/(n^2 - n - 1) = 1/(2-3/(3-4/(4-5/(...(n-1)-n/(n-(n+1)))))), for n >= 2.
MATHEMATICA
a[1]=a[2]=-1; a[n_]:=a[n]=(n-1)a[n-1]-n a[n-2]; Array[a, 22] (* Stefano Spezia, Aug 23 2022 *)
PROG
(PARI) a(n) = if(n<=2, -1, 1/2*((n-1)*sum(k=0, n-3, k!) + n*(n-2)*sum(k=0, n-4, k!))) \\ Jianing Song, Oct 15 2022, following the formula above
CROSSREFS
Sequence in context: A002223 A034563 A242496 * A048539 A240526 A018886
KEYWORD
sign,easy
AUTHOR
Mohammed Bouras, Aug 22 2022
STATUS
approved