#include <stdio.h> int rec(int n){ if(n==0) return 3; else if(n==1) return 0; else if(n==2) return 2; else return rec(n-2) + rec(n-3);} int main(void) { int n=50; for(int i=1;i<=n;i++){ if(rec(i)%i==0){ printf("%d,",i); } } return 0;}
Standard input is empty
1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!