A133364 Number of ways of writing n as a sum of a prime and a square-full number.
0, 0, 1, 1, 0, 2, 1, 1, 1, 1, 3, 2, 1, 2, 2, 1, 1, 2, 2, 2, 3, 1, 2, 1, 1, 1, 4, 2, 2, 3, 1, 4, 2, 2, 3, 1, 2, 5, 4, 2, 2, 2, 2, 3, 4, 2, 3, 2, 3, 2, 4, 2, 2, 3, 3, 4, 2, 1, 2, 2, 2, 4, 3, 1, 2, 3, 3, 5, 4, 2, 2, 3, 2, 3, 6, 1, 5, 2, 4, 4, 2, 1, 6, 3, 2, 4, 4, 3
Offset: 1
Examples
a(3) = 1 because 3=2+1 where 2 is prime and 1 is square-full. a(4) = 1 because 4=3+1 where 3 is prime and 1 is square-full. a(5) = 0 because there is no positive solution to 5 = prime+(square-full). a(6) = 2 because 6=5+1=2+4. a(7) = 1 because 7=3+4. a(8) = 1 because 8=7+1. a(9) = 1 because 9=5+4. a(10) = 1 because 10=2+8. a(11) = 3 because 11=2+9=3+8=7+4. a(12) = 2 because 12=3+9=11+1. a(13) = 1 because 13=5+8. a(14) = 2 because 14=5+9=13+1. a(15) = 2 because 15=7+8=11+4. a(16) = 1 because 16=7+9. a(17) = 1 because 17=13+4. a(18) = 2 because 18=2+16=17+1. a(19) = 2 because 19=3+16=11+8. a(20) = 2 because 20=19+1=11+9.
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..10000
Programs
-
Maple
isA001694 := proc(n) local digs,i ; digs := ifactors(n)[2] ; for i in digs do if op(2,i) = 1 then RETURN(false) ; fi ; od: RETURN(true) ; end: A133364 := proc(n) local a,p ; a := 0 ; p := 2 ; while p < n do if isA001694(n-p) then a := a+1 ; fi ; p := nextprime(p) ; od: RETURN(a) ; end: seq(A133364(n),n=3..90) ; # R. J. Mathar, Nov 09 2007
-
Mathematica
a = {}; For[n = 3, n < 100, n++, c = 0; For[j = 1, Prime[j] < n, j++, d = 1; b = FactorInteger[n - Prime[j]]; For[m = 1, m < Length[b] + 1, m++, If[b[[m, 2]] < 2, d = 0]]; If[d == 1, c++ ]]; AppendTo[a, c]]; a (* Stefan Steinerberger, Oct 29 2007 *)
Extensions
Corrected and extended by Stefan Steinerberger, Oct 29 2007 and by R. J. Mathar, Nov 09 2007
Comments