

A144688


"Magic" numbers: all numbers from 0 to 9 are magic; a number >= 10 is magic if it is divisible by the number of its digits and the number obtained by deleting the final digit is also magic.


13



0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 102, 105, 108, 120, 123, 126, 129, 141, 144, 147, 162, 165, 168, 180
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


COMMENTS

Roberto Bosch Cabrera finds that there are exactly 20457 terms. (Total corrected by Zak Seidov, Feb 08 2009.)
The 20457th and largest term is the 25digit number 3608528850368400786036725.  Zak Seidov, Feb 08 2009
a(n) is also the number such that every kdigit substring ( k <= n ) taken from the left, is divisible by k.  Gaurav Kumar, Aug 28 2009
A probabilistic estimate for the number of terms with k digits for the corresponding sequence in base b is b^k/k!, giving an estimate of e^b total terms. For this sequence, the estimate is approximately 22026, compared to the actual value of 20457.  Franklin T. AdamsWatters, Jul 18 2012
Numbers such that their first digit is divisible by 1, their first two digits are divisible by 2, and so on.  Charles R Greathouse IV, May 21 2013
These numbers are also called polydivisible numbers, because so many of their digits are divisible.  Martin Renner, Mar 05 2016
The unique zeroless pandigital (A050289) term, also called penholodigital, is a(7286) = 381654729 (see Penguin reference); so, the unique pandigital term (A050278) is a(9778) = 3816547290.  Bernard Schott, Feb 07 2022


REFERENCES

Robert Bosch, Tale of a Problem Solver, Arista Publishing, Miami FL, 2016.
David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Revised Editon), Penguin Books, 1997, entry 381654729, page 185.


LINKS

Zak Seidov, The full table of n, a(n) for n=1..20457
James Grime and Brady Haran, Why 381,654,729 is awesome, Numberphile video (2013)
Wikipedia, Polydivisible number


EXAMPLE

102 has three digits, 102 is divisible by 3, and 10 is also magic, so 102 is a member.


MAPLE

P1:={seq(i, i=1..9)}:
for i from 2 to 25 do
Pi:={}:
for n from 1 to nops(P(i1)) do
for j from 0 to 9 do
if P(i1)[n]*10+j mod i = 0 then Pi:={op(Pi), P(i1)[n]*10+j}: fi:
od:
od:
od:
`union`({0}, seq(Pi, i=1..25)); # Martin Renner, Mar 05 2016


MATHEMATICA

divQ[n_]:=Divisible[n, IntegerLength[n]];
lessQ[n_]:=FromDigits[Most[IntegerDigits[n]]];
pdQ[n_]:=If[Or[n<10, And[divQ[n], divQ[lessQ[n]]]], True];
Select[Range[0, 180], pdQ[#]&] (* Ivan N. Ianakiev, Aug 23 2016 *)


PROG

(Python)
def agen(): # generator of terms
yield 0
magic, biggermagic, digits = list(range(1, 10)), [], 2
while len(magic) > 0:
yield from magic
for i in magic:
for d in range(10):
t = 10*i + d
if t%digits == 0:
biggermagic.append(t)
magic, biggermagic, digits = biggermagic, [], digits+1
print([an for an in agen()][:70]) # Michael S. Branicky, Feb 07 2022


CROSSREFS

A subsequence of A098952.
Cf. A082399, A051883, A143671, A214437.
Cf. A050278, A050289.
Sequence in context: A088235 A064223 A098952 * A164836 A005358 A032518
Adjacent sequences: A144685 A144686 A144687 * A144689 A144690 A144691


KEYWORD

base,nonn,fini,full


AUTHOR

N. J. A. Sloane, based on email from Roberto Bosch Cabrera, Feb 02 2009


STATUS

approved



