Home > Back-end >  In 2021-02-04: the first one mature cow farms. A, later every year: 1) every A mature cow gave birth
In 2021-02-04: the first one mature cow farms. A, later every year: 1) every A mature cow gave birth

Time:02-05

In 2021-02-04: the first one mature cow farms. A, later every year: 1) every A mature cow gave birth to A cow (2) every new born only cow born in the third year in A mature (3) each cows will never die, the number of cattle is N years later, please? # # f greatly architects a daily topic

CodePudding user response:

You this is not logical, no bull which come of the cow

CodePudding user response:

Recursive type: f (0)=1, f (1)=2, f=3 (2), (3)=4 f, f (n)=f (n - 1) + f (n - 3)

CodePudding user response:

reference 1/f, James 灬 Gosling response:
you this is not logical, no bull which come of cow

I think is


Replace the cow with aphids, completely copy themselves


This is the problem Fibonacci pull cutting series formula is on the second floor

CodePudding user response:

Is this the Qie pepper series of deformation (pepper that Qie sequence is 1, 2 years is not born, but this is 1 years began)
 public static int fun (int n) {
If (n<=1) return 1;//in the first year only one cow
Int a=1, b=2;
For (int I=2; iB=a + b;
A=b - a;
}
Return b;
}

CodePudding user response:

reference 4 floor qybao response:
is this the Qie pepper series of deformation (pepper that Qie sequence is 1, 2 years is not born, but this is 1 years began)
 public static int fun (int n) {
If (n<=1) return 1;//in the first year only one cow
Int a=1, b=2;
For (int I=2; iB=a + b;
A=b - a;
}
Return b;
}


Write a complete main method!

CodePudding user response:

Fibonacci leaf seems wrong, this is in the third year in a mature, also is in the interval of a year can't litter

CodePudding user response:

Recursive: f (0)=1, f (1)=2, f=3 (2), (3)=5 f, f=8 (4), f (5)=12, (6)=17, f...
F (n)=f (n - 1) + (n - 2 + 1)=f (n - 1) + (n - 1) (n 3 or higher)
Prove slightly,
  • Related