OFFSET
1,2
COMMENTS
If n = y*10^d+z is in the sequence, where 1<=y<=9 and z < 10^d, then z | y*10^d. - Robert Israel, Oct 17 2018
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000 (first 788 terms from Reinhard Zumkeller)
EXAMPLE
9375 is in the sequence because :
. 5 | 9375 ;
. 75 | 9375 ;
. 375 | 9375 ;
. 9375 | 9375 .
MAPLE
with(numtheory):T:=array(1..5):for n from 1 to 10000 do:ind:=0:l:=length(n):n0:=n:s:=0:for m from 0 to l-1 do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v : s:=s + u*10 ^m:if irem(n, 10)<>0 and irem(n, s)=0 then ind:=ind+1:else fi:od:if ind=l then printf(`%d, `, n):else fi:od:
# Alternative:
filter:= proc(x)
if x mod 10 = 0 then return false fi;
andmap(t -> type(x/(x mod 10^t), integer), [$1..ilog10(x)])
end proc:
Res:= $1..9:
for d from 1 to 6 do
for y from 1 to 9 do
for z in sort(convert(select(`<`, numtheory:-divisors(y*10^d), 10^d), list)) do
if filter(y*10^d+z) then
Res:= Res, y*10^d+z;
fi
od od od:
Res; # Robert Israel, Oct 17 2018
PROG
(Haskell)
import Data.List (tails)
a178158 n = a178158_list !! (n-1)
a178158_list = filter (\suff -> all ((== 0) . (mod suff))
(map read $ tail $ init $ tails $ show suff :: [Integer])) a067251_list
-- Reinhard Zumkeller, Mar 26 2012
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Dec 17 2010
STATUS
approved