Synthesis, characterization and phase transitions in the inorganic-organic layered perovskite-type hybrids [(CnH2n+1NH3)2PbI4], n = 4, 5 and 6.