A081328 Greatest 3-smooth number m such that n-m is also 3-smooth, a(n)=0 if no such 3-smooth number exists.
0, 1, 2, 3, 4, 4, 6, 6, 8, 9, 9, 9, 12, 12, 12, 12, 16, 16, 18, 18, 18, 18, 0, 18, 24, 24, 24, 27, 27, 27, 27, 24, 32, 32, 32, 32, 36, 36, 36, 36, 32, 36, 27, 36, 36, 0, 0, 36, 48, 48, 48, 48, 0, 48, 54, 54, 54, 54, 32, 54, 0, 54, 54, 48, 64, 64, 64, 64, 0, 64, 0, 64, 72, 72, 72, 72, 0
Offset: 1
Keywords
Examples
a(32) = 24 = 3*2^3, as 32 = 2^3 + 24.
Programs
-
Mathematica
smooth3Q[n_] := n == 2^IntegerExponent[n, 2]*3^IntegerExponent[n, 3]; a[n_] := Module[{m}, For[m = n, m >= 1, m--, If[smooth3Q[m], If[smooth3Q[n - m], Return[m]]]]; 0]; Array[a, 77] (* Jean-François Alcover, Oct 17 2021 *)