fork download
  1. #include <stdio.h>
  2. int rec(int n){
  3. if(n==0){
  4. return 3;
  5. }else if(n==1){
  6. return 0;
  7. }else if(n==2){
  8. return 2;
  9. }else{
  10. return rec(n-2)+rec(n-3);
  11. }
  12. }
  13. int main(void) {
  14. int n = 50;
  15. for(int i = 1; i <= n; i++){
  16. if(rec(i)%i==0){
  17. printf("%d, ",i);
  18. }
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0.02s 5320KB
stdin
Standard input is empty
stdout
1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47,