OFFSET
0,2
FORMULA
{k + R(k)}/2 where k uses only odd digits 1, 3, 5, 7 and 9.
MAPLE
reversal := proc(n) local i, len, new, temp:
new := 0: temp := n: len := floor(log[10](n+.1))+1:
for i from 1 to len do
new := new+irem(temp, 10)*10^(len-i):
temp := floor(temp/10):
od:
RETURN(new):
end:
allodd := proc(n) local i, flag, len, temp:
temp := n: flag := 1: if n=0 then flag := 0 fi: len := floor(log[10](n+.1))+1:
for i from 1 to len do
if irem(temp, 10) mod 2 = 1 then temp := floor(temp/10) else flag := 0 fi:
od:
RETURN(flag):
end:
for n from 1 to 501 by 2 do
if allodd(n) = 1 then printf(`%d, `, (n+reversal(n))/2) fi:
od: # James A. Sellers, May 28 2002
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, May 20 2002
EXTENSIONS
More terms from James A. Sellers, May 28 2002
STATUS
approved