|
|
A062010
|
|
Let n = Sum_i d_i*10^i (0 <= d_i <= 9) be the decimal expansion of n. Then n is in the sequence if Sum_i d_i*b^i divides n for some base b >= 2 in the range max d_i < b < 10.
|
|
2
|
|
|
1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 20, 21, 30, 40, 100, 102, 112, 120, 200, 204, 210, 300, 306, 312, 400, 414, 420, 516, 522, 624, 630, 1000, 1010, 1102, 1120, 1232, 1320, 1344, 1422, 2000, 2223, 2240, 2301, 2310, 3000, 3430, 4000, 10000, 10100, 10101, 10356
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
In other words, a positive number n is in the sequence if when interpreted as a legal number in a smaller base than 10, the result divides n.
The old definition was "Numbers that, when expressed in a smaller base, become a factor of themselves."
|
|
LINKS
|
|
|
EXAMPLE
|
In base 7, 102 is 51, which divides 102, so 102 is in the sequence.
8 is in the sequence because 8 in base 9 is 8, which does divide 8.
But 9 is not in the sequence because there are no bases b between 9 and 10. Likewise all numbers with a 9 in their decimal expansion are excluded.
|
|
MATHEMATICA
|
dtn[L_, b_] := Fold[b#1+#2&, 0, L]; f[n_] := f[n]=Table[dtn[ IntegerDigits[ n, b], 10], {b, 2, 9}]; g[n_] := MemberQ[Flatten[ Map[ f, Divisors[ n]]], n]; Select[Range[20000], g]
rdnQ[n_]:=AnyTrue[n/FromDigits[IntegerDigits[n], Range[ Max[ IntegerDigits[ n]]+1, 9]], IntegerQ]; Select[Range[11000], rdnQ] (* The program uses the AnyTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 16 2016 *)
|
|
PROG
|
(Haskell)
import Data.List (unfoldr)
a062010 n = a062010_list !! (n-1)
a062010_list = filter f [1..] where
f x = any (== 0) $ map (mod x) lower where
lower = map bas [1 + a054055 x .. 9]
bas b = foldl (\v d -> b*v + d) 0 bas10
bas10 = reverse $ unfoldr dig x where
dig n = if n== 0 then Nothing else Just $ swap $ divMod n 10
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nice,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|