OFFSET
1,1
LINKS
Wikipedia, Alkane
FORMULA
a(n,m) = If[n == m == 1, 4, If[n == 1 && m >1, 6, If[Mod[m, 2] == 1 && n == Floor[m/2] + 1, 2, 4]]]
EXAMPLE
{4},->Ch4
{6}, ->CH3CH3
{6, 2}, ->CH3CH2CH3
{6, 4}, ->CH3CH2CH2CH3
{6, 4, 2}, ->CH3CH2CH2CH2CH3
{6, 4, 4}, ->CH3CH2CH2CH2CH2CH3
{6, 4, 4, 2}, ->CH3CH2CH2CH2CH2CH2CH3
{6, 4, 4, 4}, ->CH3CH2CH2CH2CH2CH2CH2CH3
MATHEMATICA
f[n_, m_] = If[n == m ==1, 4, If[n == 1 && m > 1, 6, If[Mod[m, 2] == 1 && n == Floor[m/2] + 1, 2, 4]]]; Table[Table[f[n, m], {n, 1, If[m == 1, 1, If[Mod[m, 2] == 0, Floor[m/2], Floor[m/2] + 1]]}], {m, 1, 20}]; Flatten[%]
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Roger L. Bagula, Jul 13 2007
STATUS
approved