A283876 Number of partitions of n into distinct twin primes (A001097).
1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 4, 2, 4, 4, 3, 4, 4, 5, 4, 4, 5, 5, 5, 5, 6, 6, 5, 7, 6, 8, 7, 7, 9, 7, 9, 8, 9, 9, 9, 9, 11, 11, 11, 12, 11, 14, 12, 13, 14, 14, 13, 15, 15, 17, 16, 16, 19, 17, 20, 19, 21, 21, 21, 21, 23, 23, 23, 23, 24, 26, 25, 28, 28, 30, 29, 30, 32
Offset: 0
Keywords
Examples
a(29) = 4 because we have [29], [19, 7, 3], [17, 7, 5] and [13, 11, 5].
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 0..10000
- Eric Weisstein's World of Mathematics, Twin Primes
- Index entries for related partition-counting sequences
Programs
-
Mathematica
nmax = 95; CoefficientList[Series[Product[1 + Boole[PrimeQ[k] && (PrimeQ[k - 2] || PrimeQ[k + 2])] x^k, {k, 1, nmax}], {x, 0, nmax}], x]
-
PARI
listA001097(lim)=my(v=List([3]),p=5); forprime(q=7,lim, if(q-p==2, listput(v,p); listput(v,q)); p=q); if(p+2>lim && isprime(p+2), listput(v,p)); Vec(v) first(n)=my(v=listA001097(n),x=O('x^(n+1))+'x); Vec(prod(i=1,#v, 1+x^v[i]))[1..n+1] \\ Charles R Greathouse IV, Mar 17 2017
-
PARI
Vec(prod(k=1, 95, (1 + (isprime(k) && (isprime(k - 2) || isprime(k + 2)))*x^k)) + O(x^96)) \\ Indranil Ghosh, Mar 17 2017
Formula
G.f.: Product_{k>=1} (1 + x^A001097(k)).
Comments