He was born in Schleswig-Holstein, then part of Denmark but later part of Germany, and later studied under Carl Friedrich Gauss. He spoke many languages and spent time in Italy and Ottoman Turkey before going to the United States in 1854.