OFFSET
1,1
EXAMPLE
a(12) = 48 as 12 divides 48 as well as 84.
MAPLE
np := proc(N::posint, i::posint) local d, e; description "if 'N' is not palindromic and 'i' divides both 'N' and its reverse then returns 'true', else 'false'"; d := convert(N, base, 10); e := sum(d[j]*10^(nops(d)-j), j=1..nops(d)); if N=e then return false else if N mod i=0 and e mod i=0 then return true else return false fi; fi; end proc; nps := proc(J::posint, K::posint) local f, F, FU, i; description "returns the sequence of smallest numbers that satisfy 'np' (or number is 0 if the sequence position is divisible by 10) starting at sequence position 'J' and checking numbers up to 'K'; to get a sequence from 1 to the maximum position allowable by 'K', set 'J=1'."; f := (i, M)->`if`(i mod 10=0, 0, min(seq(`if`(np(N, i)=true, N, NULL), N=i..M))); i := J; while f(i, K)<>infinity do F(i) := `if`(i mod 10=0, 0, f(i, K)); i := i+1 od; FU := [seq(F(ii), ii=J..i-1)]; return FU, `if`(FU=[], printf("no numbers found; try raising 'K'."), printf("the sequence from positions %d to %d.", J, i-1)); end proc;
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Mar 22 2002
EXTENSIONS
More terms from Francois Jooste (phukraut(AT)hotmail.com), Mar 06 2003
STATUS
approved