Algebras with ternary law of composition combining Z_2 and Z_3 gradings