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