The association between mathematics and programming in an educational context is not new. Today, programming has been introduced into curricula worldwide for younger children. In the Swedish case, primary school teachers are expected to integrate programming in mathematics education from autumn 2018. However, Swedish teachers' knowledge of programming and programming didactics is limited. Meanwhile, there is little research on K-9 programming education. This has led to the dilemma that the mathematics teachers have limited support in didactic knowledge and good examples. This study reports on a teacher professional development project in programming. More specifically, teachers used Lesson Study to plan, execute, and evaluate lessons that integrated programming into various school subjects in elementary school. This study analyzed the didactic strategies developed in 10 lesson studies, as well as mapped the opportunities and challenges of pupils' learning in the mathematics subject. The result was the identification of three didactic strategies, which were analog programming, robot programming and block programming, as well as 11 didactic methods applied within these strategies. The paper contributes with examples of the didactic methods that teachers have developed and evaluated using lesson study. The paper further provides insights on how teachers can take progression into account by applying the three didactic strategies. At last but not least, the study shows a great need for teachers to develop computational thinking abilities.