A308403 Number of ways to write n as 6^i + 3^j + A008347(k), where i, j and k > 0 are nonnegative integers.
0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 2, 4, 3, 3, 4, 3, 2, 4, 2, 4, 5, 1, 3, 3, 2, 5, 4, 3, 6, 2, 4, 4, 4, 7, 4, 3, 3, 6, 7, 7, 3, 5, 3, 6, 7, 5, 7, 4, 4, 4, 5, 6, 7, 4, 4, 6, 6, 6, 6, 3, 6, 6, 6, 8, 7, 5, 3, 4, 6, 8, 4, 3, 4, 3, 6, 6, 4, 5, 6, 4, 6, 6, 9, 7, 4, 5, 8, 9, 6, 5, 5, 7, 5, 6, 2, 7, 6, 5
Offset: 1
Keywords
Examples
a(3) = 1 with 3 - (6^0 + 3^0) = 1 = A008347(2). a(4) = 1 with 4 - (6^0 + 3^0) = 2 = A008347(1). a(24) = 1 with 24 - (6^0 + 3^0) = 22 = A008347(13). a(234) = 1 with 234 - (6^1 + 3^3) = 201 = A008347(90). a(1134) = 1 with 1134 - (6^2 + 3^0) = 1097 = A008347(322). a(4330) = 1 with 4330 - (6^3 + 3^0) = 4113 = A008347(1016). a(5619) = 1 with 5619 - (6^1 + 3^3) = 5586 = A008347(1379). a(6128) = 1 with 6128 - (6^0 + 3^0) = 6126 = A008347(1499). a(16161) = 1 with 16161 - (6^3 + 3^0) = 15944 = A008347(3445). a(133544) = 1 with 133544 - (6^0 + 3^8) = 126982 = A008347(22579).
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, On functions taking only prime values, J. Number Theory 133(2013), no.8, 2794-2812.
Programs
-
Mathematica
Pow[n_]:=Pow[n]=n>0&&IntegerQ[Log[3,n]]; s[0]=0;s[n_]:=s[n]=Prime[n]-s[n-1]; tab={};Do[r=0;Do[If[s[k]>=n,Goto[bb]];Do[If[Pow[n-s[k]-6^m],r=r+1],{m,0,Log[6,n-s[k]]}];Label[bb],{k,1,2n-1}];tab=Append[tab,r],{n,1,100}];Print[tab]
Comments