A040051 Parity of partition function A000041.
1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1
Offset: 0
References
- H. Gupta, A note on the parity of p(n), J. Indian Math. Soc. (N.S.) 10, (1946). 32-33. MR0020588 (8,566g)
- K. M. Majumdar, On the parity of the partition function p(n), J. Indian Math. Soc. (N.S.) 13, (1949). 23-24. MR0030553 (11,13d)
- M. V. Subbarao, A note on the parity of p(n), Indian J. Math. 14 (1972), 147-148. MR0357355 (50 #9823)
Links
- T. D. Noe, Table of n, a(n) for n = 0..1000
- R. Blecksmith; J. Brillhart; I. Gerst, Parity results for certain partition functions and identities similar to theta function identities, Math. Comp. 48 (1987), no. 177, 29-38. MR0866096 (87k:11113).
- Nicholas Eriksson, q-series, elliptic curves and odd values of the partition function, Int. J. Math. Math. Sci. 22 (1999), 55-65; MR 2001a:11175.
- M. D. Hirschhorn, On the residue mod 2 and mod 4 of p(n), Acta Arith. 38 (1980/81), no. 2, 105-109. MR0604226 (82d:10025)
- M. D. Hirschhorn, On the parity of p(n), II, J. Combin. Theory Ser. A 62 (1993), no. 1, 128-138.
- M. D. Hirschhorn and M. V. Subbarao, On the parity of p(n), Acta Arith. 50 (1988), no. 4, 355-356.
- O. Kolberg, Note on the parity of the partition function, Math. Scand. 7 1959 377-378. MR0117213 (22 #7995).
- P. A. MacMahon, The parity of p(n), the number of partitions of n, when n <= 1000, J. London Math. Soc., 1 (1926), 225-226.
- Mircea Merca, New recurrences for Euler's partition function, Turkish J. Math. 41:5 (2017), pp. 1184-1190.
- M. Newman, Periodicity modulo m and divisibility properties of the partition function, Trans. Amer. Math. Soc. 97 (1960), 225-236. MR0115981 (22 #6778)
- M. Newman, Congruences for the partition function to composite moduli, Illinois J. Math. 6 1962 59-63. MR0140472 (25 #3892)
- K. Ono, Parity of the partition function, Electron. Res. Announc. AMS, Vol. 1, 1995, pp. 35-42; MR 96d:11108.
- Ivars Peterson, Ken Ono's and Nicholas Eriksson's work
Programs
-
Haskell
import Data.Bits (xor) a040051 n = p 1 n :: Int where p _ 0 = 1 p k m | k <= m = p k (m - k) `xor` p (k+1) m | k > m = 0 -- Reinhard Zumkeller, Nov 15 2011
-
Mathematica
Table[ Mod[ PartitionsP@ n, 2], {n, 105}] (* Robert G. Wilson v, Mar 25 2011 *)
-
PARI
a(n)=if(n<0, 0, numbpart(n)%2)
-
PARI
a(n)=if(n<0, 0, polcoeff(1/eta(x+x*O(x^n)), n)%2)
-
PARI
a(n)=if(n<10^9, return(numbpart(n)%2)); my(r=n%4, u=select(k->k^2%32==8*r+1,[1..31]), st=u[1], m=n\4, s); u=[u[2]-u[1],u[3]-u[2],u[4]-u[3],u[1]+32-u[4]]; forstep(t=[1,3,7,5][r+1], sqrtint(32*m-1), u, k=t^2>>5; if(a(m-k), s++)); s%2 \\ Merca's algorithm, switching to direct computation for n less than 10^9. Very time-consuming but low memory use. - Charles R Greathouse IV, Jan 24 2018
-
Python
from sympy import npartitions def a(n): return npartitions(n)%2 # Indranil Ghosh, May 25 2017
Formula
a(n) = pp(n, 1), with Boolean pp(n, k) = if kReinhard Zumkeller, Sep 04 2003
a(n) = Pm(n,1) with Pm(n,k) = if kReinhard Zumkeller, Jun 09 2009
Comments