A034947 Jacobi (or Kronecker) symbol (-1/n).
1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1
Offset: 1
Examples
G.f. = x + x^2 - x^3 + x^4 + x^5 - x^6 - x^7 + x^8 + x^9 + x^10 - x^11 - x^12 + ...
References
- J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, pp. 155, 182.
- H. Cohen, Course in Computational Number Theory, p. 28.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..10000
- J.-P. Allouche, G.-N. Han, and Jeffrey Shallit, On some conjectures of P. Barry, arXiv:2006.08909 [math.NT], 2020.
- J.-P. Allouche and Jonathan Sondow, Summation of rational series twisted by strongly B-multiplicative coefficients, Electron. J. Combin., 22 #1 (2015) P1.59; see p. 8.
- J.-P. Allouche and Jonathan Sondow, Summation of rational series twisted by strongly B-multiplicative coefficients, arXiv:1408.5770 [math.NT] v4, 2015; see p. 9.
- Jean-Paul Allouche and Leo Goldmakher, Mock characters and the Kronecker symbol, arXiv:1608.03957 [math.NT], 2016.
- L. Almodovar, V. H. Moll, H. Quand, Infinite products arising in paperfolding, JIS 19 (2016) # 16.5.1 eq. (1)
- Joerg Arndt, Matters Computational (The Fxtbook), section 38.8.4 Differences of the sum of Gray code digits, coefficients of polynomials L.
- Danielle Cox and K. McLellan, A problem on generation sets containing Fibonacci numbers, Fib. Quart., 55 (No. 2, 2017), 105-113.
- Chandler Davis and Donald E. Knuth, Number Representations and Dragon Curves -- I and II, Journal of Recreational Mathematics, volume 3, number 2, April 1970, pages 66-81, and number 3, July 1970, pages 133-149. Reprinted with addendum in Donald E. Knuth, Selected Papers on Fun and Games, CSLI Publications, 2010, pages 571-614. a(n) = d(n) at equation 3.1.
- Chandler Davis and Donald E. Knuth, Number Representations and Dragon Curves, Journal of Recreational Mathematics, volume 3, number 2, April 1970, pages 66-81, and number 3, July 1970, pages 133-149. [Cached copy, with permission]
- A. Iványi, Leader election in synchronous networks, Acta Univ. Sapientiae, Mathematica, 5, 2 (2013) 54-82.
- Jeffrey Shallit, Cloitre's Self-Generating Sequence, arXiv:2501.00784 [math.CO], 2025. See page 4.
- Eric Weisstein's World of Mathematics, Kronecker Symbol.
- Index entries for sequences obtained by enumerating foldings.
Crossrefs
Moebius transform of A035184.
Programs
-
Magma
[KroneckerSymbol(-1,n): n in [1..100]]; // Vincenzo Librandi, Aug 16 2016
-
Maple
with(numtheory): A034947 := n->jacobi(-1,n);
-
Mathematica
Table[KroneckerSymbol[ -1, n], {n, 0, 100}] (* Corrected by Jean-François Alcover, Dec 04 2013 *)
-
PARI
{a(n) = kronecker(-1, n)};
-
PARI
for(n=1, 81, f=factor(n); print1((-1)^sum(s=1, omega(n), f[s, 2]*(Mod(f[s, 1], 4)==3)), ", ")); \\ Arkadiusz Wesolowski, Nov 05 2013
-
PARI
a(n)=direuler(p=1,n,if(p==2,1/(1-kronecker(-4, p)*X)/(1-X),1/(1-kronecker(-4, p)*X))) /* Ralf Stephan, Mar 27 2015 */
-
PARI
a(n) = if(n%2==0, a(n/2), (n+2)%4-2) \\ Peter Munn, Jul 09 2022
-
Python
def A034947(n): s = bin(n)[2:] m = len(s) i = s[::-1].find('1') return 1-2*int(s[m-i-2]) if m-i-2 >= 0 else 1 # Chai Wah Wu, Apr 08 2021
-
Python
def A034947(n): return -1 if n>>(-n&n).bit_length()&1 else 1 # Chai Wah Wu, Feb 26 2025
Formula
Multiplicative with a(2^e) = 1, a(p^e) = (-1)^(e*(p-1)/2) if p>2.
a(2*n) = a(n), a(4*n+1) = 1, a(4*n+3) = -1, a(-n) = -a(n). a(n) = 2*A014577(n-1)-1.
This sequence can be constructed by starting with w = "empty string", and repeatedly applying the map w -> w 1 reverse(-w) [See Allouche and Shallit p. 182]. - N. J. A. Sloane, Jul 27 2012
a(n) = (-1)^A065339(n) = lambda(A097706(n)), where A065339(n) is number of primes of the form 4*m + 3 dividing n (counted with multiplicity) and lambda is Liouville's function, A008836. - Arkadiusz Wesolowski, Nov 05 2013 and Peter Munn, Jun 22 2022
Sum_{n>=1} a(n)/n = Pi/2, due to F. von Haeseler; more generally, Sum_{n>=1} a(n)/n^(2*d+1) = Pi^(2*d+1)*A000364(d)/(2^(2*d+2)-2)(2*d)! for d >= 0; see Allouche and Sondow, 2015. - Jean-Paul Allouche and Jonathan Sondow, Mar 20 2015
Dirichlet g.f.: beta(s)/(1-2^(-s)) = L(chi_2(4),s)/(1-2^(-s)). - Ralf Stephan, Mar 27 2015
a(n) = A209615(n) * (-1)^(v2(n)), where v2(n) = A007814(n) is the 2-adic valuation of n. - Jianing Song, Apr 24 2021
Comments