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