It took me a minute to figure out exactly what you want; you want to search a log file for "pid+fixed value", right?
Your first line is close to what you want. "$(( ))" is the bash arithmetic operator, and as long as you're adding integers you don't need to use expr or anything like it. I would also turn it around a little, like so.
Code:
value="23416" # The pid you want to search
const="27000" # The constant you want to add
grep "$((value+const))" ~casper/home/users/logs
Notes:
You don't need to use $ in front of the variable inside the arithmetic operator. The values will be expanded automatically.
Be sure to use double quotes around your grep expression. Single quotes will not allow the operator to work.
-----
Edit: waitaminutehere. Reading again more closely, are you perhaps saying you want to search a
directory for filenames? For filenames you need to use find instead. Or perhaps grep through the output of ls.
Code:
find /logdrectory -name "*$((value+const))*"
ls /logdirectory | grep "$((value+const))"