A103151 Number of decompositions of 2n+1 into 2p+q, where p and q are both odd primes (A065091).
0, 0, 0, 1, 1, 2, 1, 3, 2, 2, 2, 3, 3, 4, 2, 4, 2, 4, 4, 4, 4, 5, 3, 4, 6, 5, 3, 6, 3, 3, 6, 6, 5, 7, 3, 4, 7, 6, 5, 8, 3, 7, 7, 7, 4, 10, 5, 6, 9, 5, 5, 11, 5, 6, 9, 7, 6, 10, 7, 5, 11, 8, 6, 10, 5, 6, 12, 8, 5, 12, 5, 9, 12, 8, 6, 13, 7, 6, 11, 9, 9, 16, 4, 8, 12, 9, 9, 13, 7, 6, 13, 11, 8, 16, 6
Offset: 1
Keywords
Examples
For 2*4+1 = 9 we have just one such composition: 9 = 2*3+3, so a(4)=1; For 2*14+1 = 29 we have four such compositions: 29 = 2*3+23 = 2*5+19 = 2*11+7 = 2*13+3, so a(14)=4.
Links
- R. J. Mathar, Table of n, a(n) for n = 1..10777
Programs
-
Maple
A103151 := proc(n) local s,a,q; a := 0 ; s := 2*n+1 ; for pi from 2 do q := s-2*ithprime(pi) ; if q <=2 then return a ; else if isprime(q) then a := a+1 ; end if; end if; end do: end proc: # R. J. Mathar, Feb 22 2014
-
Mathematica
Do[m = 3; ct = 0; While[(m*2) < n, If[PrimeQ[m], cp = n - (2*m); If[ PrimeQ[cp], ct = ct + 1]]; m = m + 2]; Print[ct], {n, 9, 299, 2}]
Extensions
Edited and Scheme-code added by Antti Karttunen, Jun 19 2007
Comments