Pergunta de entrevista da empresa PTC

Write a program to print the series.