Step 1: Find the digit at the first place.
The first place holds the square of a prime digit that sits at the third place.
A single digit can only be the square of the primes 2 or 3, since \(5^2=25\) and \(7^2=49\) need two digits.
So the third place is 2 or 3, and the first place is 4 or 9.
Step 2: Use the consecutive-number clue.
The digits at the 4th, 6th, 2nd and 1st places, read in that order, form four consecutive numbers.
Call the smallest of these \(n\), so 4th place \(=n\), 6th place \(=n+1\), 2nd place \(=n+2\), 1st place \(=n+3\).
Step 3: Test first place \(=4\).
If the first place is 4, then \(n+3=4\), so \(n=1\), giving 4th place 1, 6th place 2, 2nd place 3.
But the third place must also be 2 here, which repeats the digit 2 at the 6th place.
Since all six digits must be distinct, this case is rejected.
Step 4: Test first place \(=9\).
If the first place is 9, then \(n+3=9\), so \(n=6\), giving 4th place 6, 6th place 7, 2nd place 8.
The third place is 3, since \(3^2=9\). The digits so far are 9, 8, 3, 6, 7, all distinct, so this case works.
Step 5: Fix the fifth place using the odd-digit clue.
All odd digits except 1, that is 3, 5, 7 and 9, must appear somewhere in the code.
The digits 3, 7 and 9 are already placed, so the missing odd digit 5 must go in the only open slot, the fifth place.
Final Answer:
The code reads 9, 8, 3, 6, 5, 7 and the digits sum to \(9+8+3+6+5+7=38\). \[ \boxed{38} \]