Infosys
Company
Programming
Functions
f(1)=1,where f(x+y)=f(x)+f(y)+8xy-2.then f(7)=?
Read Solution (Total 6)
-
- f(1)=1
f(2)= f(1+1)= 1+1+8-2= 8
f(3) = f(2+1)= 8+1+ (8*2*1)-2 = 23
f(6)= f(3+3)= 23+23+ (8*3*3)-2= 116
f(7) = f(6+1)= 116+1+(8*6*1)-2= 163
thus ans is 163 - 9 years agoHelpfull: Yes(12) No(1)
- f(7)=f(1+6)=f(1)+f(6)+8*1*6-2
=f(6)+47
similarly,f(6)=f(5)+39;
f(5)=f(4)+31;
f(4)=f(3)+23;
f(3)=f(2)+15;
f(2)=f(1)+8
therefore f(7)=f(6)+f(5)+f(4)+f(3)+f(2)+f(1)+47
=39+31+23+15+8+1
so the Ans: f(7) = 164
- 9 years agoHelpfull: Yes(5) No(2)
- f(1)=1
f(x+y)=f(x)+f(y)+8xy-2
f(1+1)=f(1)+f(1)+8*1*1-2
f(2) =1+1+8-2=8
f(2+1)=f(2)+f(1)+8*2*1-2
f(3) =8+1+16-2=23
f(2+2)=f(2)+f(2)+8*2*2-2
f(4) =8+8+32-2=46
f(3+4)=f(3)+f(4)+8*3*4-2
f(2) =23+46+96-2=163 ans. - 9 years agoHelpfull: Yes(1) No(0)
- 163
f(2)=f(1+1)
f(3)=f(2+1)...
and so onn
f(7)=f(6+1)=163 - 9 years agoHelpfull: Yes(0) No(0)
- ans:163
f(7)=f(1+6) substitute then f(6) the F(5)......f(2) - 9 years agoHelpfull: Yes(0) No(0)
- f(7)=f(3+4)=f(3)+f(4)+94
and we know f(1)=1
f(3)=f(2)+f(1)+14, f(2)=f(1)+f(1)+6=8
f(3)=8+1+14=23
f(4)=f(3)+f(1)+22=23+1+22=46
f(7)=f(3)+f(4)+94
23+46+94=163 - 5 years agoHelpfull: Yes(0) No(0)
Infosys Other Question