|
|
A193356
|
|
If n is even then 0, otherwise n.
|
|
29
|
|
|
1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0, 17, 0, 19, 0, 21, 0, 23, 0, 25, 0, 27, 0, 29, 0, 31, 0, 33, 0, 35, 0, 37, 0, 39, 0, 41, 0, 43, 0, 45, 0, 47, 0, 49, 0, 51, 0, 53, 0, 55, 0, 57, 0, 59, 0, 61, 0, 63, 0, 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
Multiplicative with a(2^e)=0 if e>0 and a(p^e)=p^e for odd primes p. - R. J. Mathar, Aug 01 2011
A005408 and A000004 interleaved (the usual OEIS policy is not to include sequences like this where alternate terms are zero; this is an exception). - Omar E. Pol, Feb 02 2013
a(n) is the determinant of the (n+2) X (n+2) circulant matrix with the first row [0,0,1,1,...,1]. This matrix is closely linked with the famous ménage problem (see also comments of Vladimir Shevelev in sequence A000179). Namely it defines the class of permutations p of 1,2,...,n+2 such that p(i)<>i and p(i)<>i+1 for i=1,2,...,n+1, and p(n+2)<>1,n+2. And a(n) is also the difference between the number of even and odd such permutations. - Dmitry Efimov, Feb 02 2016
|
|
REFERENCES
|
Franz Lemmermeyer, Reciprocity Laws. From Euler to Eisenstein, Springer, 2000, p. 237, eq. (8.5).
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n^k mod 2n, for any k>=2, also for k=n.
Dirichlet g.f.: (1-2^(1-s))*zeta(s-1). - R. J. Mathar, Aug 01 2011
a(n) = Product_{k=1..floor(n/2)}(sin(2*Pi*k/n))^2, for n >= 1 (with the empty product put to 1). Trivial for even n from the factor 0 for k = n/2. For odd n see, e.g., the Lemmermeyer reference, eq. (8.5) on p. 237. - Wolfdieter Lang, Aug 29 2016
a(n) = Sum_{k = 1..n} (-1)^(1+gcd(k,n)) = Sum_{d | n} (-1)^(d+1)*phi(n/d), where phi(n) = A000010(n). - Peter Bala, Jan 14 2024
|
|
MAPLE
|
|
|
MATHEMATICA
|
Table[PowerMod[n, n, 2*n], {n, 200}]
|
|
PROG
|
(Magma) I:=[1, 0, 3, 0]; [n le 4 select I[n] else 2*Self(n-2)-Self(n-4): n in [1..80]]; // Vincenzo Librandi, Feb 24 2014
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,mult
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|