I am working on this problem and I feel like I've come so close.
Write a module that takes as input a positive integer m, prints the first m positive odd numbers and returns the square root of the sum of the numbers it printed.
This is what I have so far:
kellyrocks[m_]:=Module[{index,sum},index=0;sum=0;
If[Or[m<= 0,IntegerQ[m]==False],Return["Please enter a positive integer"]];
While[index<=m,sum=sum+index;index=2*index+1];
Return[sqrt[sum]]]
But when I try to run it I'm not getting what I should, ex:
kellyrocks[22]
sqrt[26]
I'm very new to mathematica and I'm not sure what I'm missing. I also am not sure about printing each number. Thank you in advance!