login
Number of ways of writing n=p+k with p a prime number and k a primorial number.
6

%I #21 Mar 01 2016 23:32:48

%S 0,0,1,2,1,1,1,2,2,0,1,1,2,1,1,0,1,1,2,1,1,0,1,1,2,0,0,0,1,1,1,2,2,0,

%T 2,0,2,1,1,0,1,1,3,1,1,0,2,1,3,0,0,0,2,1,1,0,0,0,2,1,2,1,1,0,1,0,2,1,

%U 1,0,1,1,3,1,1,0,2,0,1,1,1,0,1,1,2,0,0,0,2,1,2,0,0,0,1,0,1,1,1,0,1,1,3,1,1

%N Number of ways of writing n=p+k with p a prime number and k a primorial number.

%C Number of partitions of n into the sum of a prime number and a primorial number. Number of decompositions of n into an unordered sum of a prime number and a primorial number.

%C For n through small powers of 10, the range of partition values seen is about log_10(n)+2. - _Bill McEachen_, Jan 07 2016

%H Bill McEachen, <a href="/A175933/b175933.txt">Table of n, a(n) for n = 1..10000</a>

%e a(4)=2 because 4(natural) = 2(prime)+2(primorial) = 3(prime)+1(primorial).

%p A002110 := proc(n) option remember; if n = 0 then 1; else mul( ithprime(k),k=1..n) ; end if; end proc:

%p A175933 := proc(n) a := 0 ; for k from 0 do p := A002110(k) ; if p +2 > n then return a; elif isprime(n-p) then a := a+1 ; end if; end do: end proc:

%p seq(A175933(n),n=1..120) ; # _R. J. Mathar_, Oct 25 2010

%t t = Table[Product[Prime@ k, {k, n}], {n, 0, 5}]; Table[Count[Map[First, Function[k, Transpose@ {k - #, #} &@ Prime@ Range@ PrimePi@ k]@ n], x_ /; MemberQ[t, x]], {n, 120}] (* _Michael De Vlieger_, Jan 09 2016 *)

%o (PARI) lyst(maxx)={n=1; while (n<=maxx,c=0; q=1; for(i5=0, n, if(i5>0, q=q*prime(i5)); if(q>n-2,break); z=truncate(q); if(isprime(n-z),c++)); print1(c,","); n+=1);} \\ _Bill McEachen_, Jan 07 2016

%o (PARI) A175933(n,p=1,k=1,c=0)={until(2>n-k*=p=nextprime(p+1),isprime(n-k)&&c++);c} \\ _M. F. Hasler_, Jan 21 2016

%Y Cf. A002110, A062602, A129363.

%K nonn

%O 1,4

%A _Juri-Stepan Gerasimov_, Oct 24 2010

%E a(85), a(89), etc. corrected by _R. J. Mathar_, Oct 25 2010