A193356 If n is even then 0, otherwise n.
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
Offset: 1
References
- Franz Lemmermeyer, Reciprocity Laws. From Euler to Eisenstein, Springer, 2000, p. 237, eq. (8.5).
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- C. Kravvaritis, Determinant evaluations for binary circulant matrices, Special Matrices, V2(1) (2014), 187-199.
- Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
Programs
-
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
-
Maple
A193356:=n->(1-(-1)^n)*n/2: seq(A193356(n), n=1..100); # Wesley Ivan Hurt, Aug 07 2015
-
Mathematica
Table[PowerMod[n,n,2*n], {n,200}]
-
PARI
a(n)=if(n%2,n) \\ Charles R Greathouse IV, Jul 24 2011
-
Python
A193356 = [i if i%2 else 0 for i in range(1, 101)] # Jwalin Bhatt, Jun 17 2025
Formula
a(n) = n^k mod 2n, for any k>=2, also for k=n. [extended by Wolfdieter Lang, Dec 21 2011]
Dirichlet g.f.: (1-2^(1-s))*zeta(s-1). - R. J. Mathar, Aug 01 2011
G.f.: x*(1+x^2)/(1-x^2)^2. - Philippe Deléham, Feb 13 2012
a(n) = n * (n mod 2). - Wesley Ivan Hurt, Jun 29 2013
G.f.: Sum_{n >= 1} A000010(n)*x^n/(1 + x^n). - Mircea Merca, Feb 22 2014
a(n) = 2*a(n-2)-a(n-4), for n>4. - Wesley Ivan Hurt, Aug 07 2015
E.g.f.: x*cosh(x). - Robert Israel, Feb 03 2016
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)^((n-k)*k). - Rick L. Shepherd, Sep 18 2020
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
Dirichlet g.f.: DirichletLambda(s-1). - Michael Shamos, Jun 13 2025
Comments