login
A081215
a(n) = (n^(n+1)+(-1)^n)/(n+1)^2.
4
1, 0, 1, 5, 41, 434, 5713, 90075, 1657009, 34867844, 826446281, 21794641505, 633095889817, 20088655029078, 691413758034721, 25657845139503479, 1021273028302258913, 43404581642184336392, 1961870762757168078553
OFFSET
0,4
COMMENTS
From Mathew Englander, Oct 19 2020: (Start)
The sum of two adjacent terms of the sequence cannot be prime.
In base n, a(n) has n-1 digits, which are (beginning from the left): n-2, 2, n-4, 4, and so on, except that if n is even the rightmost digit is 1 instead of 0. In that case, the other digits form a palindrome with every even digit from 2 to n-2 appearing twice. For example, a(14) in base 14 is c2a486684a2c1. If n is odd, then all digits from 1 to n-1 occur exactly once. For example, a(15) in base 15 is d2b496785a3c1e.
For any positive integer k, any prime p, and any positive integer h such that h*p > 2, a(h*p^k - 2) == (-1)^h * (1 - 2^(h-1)) (mod p). For example, a(7*p^k - 2) == 63 (mod p); a(10*p^k - 2) == -511 (mod p).
Suppose k and m are positive integers. If k is even, then a(k*m) == 1, a(k*m+1) == 0, and a(k*m-1) == -1 (all mod m). If k is odd, then a(k*m) == (-1)^m and a(k*m+1) == ceiling(m/2) (both mod m), while a(k*m-1) == m/2 - 1 for m even, and a(k*m-1) == 1 for m odd (mod m).
For proofs of the above, see the Englander link. (End)
LINKS
FORMULA
a(n) = (-1)^n + Sum_{k=1..n} (-1)^(k+1)*(n+1)^(n-k)*C(n+1,n+2-k). - Gionata Neri, May 19 2016
E.g.f.: (Ei(1,x) - Ei(1,-LambertW(-x)))/x. - Robert Israel, May 19 2016
For n > 1, a(n) = Sum_{k=1..floor(n/2)} (n^(n-2*k) * (2*k/n + n - 2*k)). - Mathew Englander, Oct 19 2020
MAPLE
seq((j^(j+1)+(-1)^j)/(j+1)^2, j=0..50); # Robert Israel, May 19 2016
MATHEMATICA
Array[(#^(# + 1) + (-1)^#)/(# + 1)^2 &, 19, 0] (* Michael De Vlieger, Nov 13 2020 *)
PROG
(PARI) a(n) = (n^(n+1)+(-1)^n)/(n+1)^2; \\ Michel Marcus, Oct 20 2020
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Vladeta Jovovic, Apr 17 2003
STATUS
approved