OFFSET
1,3
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
EXAMPLE
a(10^ 1) = 9
a(10^ 2) = 411
a(10^ 3) = 6216
a(10^ 4) = 73474
a(10^ 5) = 813826
a(10^ 6) = 8512170
a(10^ 7) = 88368780
a(10^ 8) = 911960211
a(10^ 9) = 9237655227
a(10^10) = 93323313303
MAPLE
for i from 1 to 10 do A[i]:= i-1 od:
count:= 10:
for i from 1 to 9 do P[i]:= [seq([j], j=0..i)]; od:
for d from 2 to 4 do
for x from 1 to 9 do
for p in P[x] do
count:= count+1;
A[count]:= add(p[k]*10^(k-1), k=1..d-1) + x*10^(d-1);
od:
P[x]:= [seq(seq([op(v), t], v=P[x]), t=0..x)];
od
od:
seq(A[i], i=1..count); # Robert Israel, Feb 01 2015
MATHEMATICA
Select[Range[0, 250], Max[IntegerDigits[#]]==First[IntegerDigits[#]]&] (* Harvey P. Dale, Apr 28 2016 *)
PROG
(Haskell)
a072543 n = a072543_list !! (n-1)
a072543_list = [x | x <- [0..], a054055 x == a000030 x]
-- Reinhard Zumkeller, Apr 25 2012
(PARI) is(n)=n=digits(n); !#n || n[1]==vecmax(n) \\ Charles R Greathouse IV, Jan 02 2014
(PARI) a(n)={d = 0; r = 1; s = 0; i = 0; if(n == 1, 0, n-=2; while(n > sum(i=0, 9, (i+1)^d), n-=sum(i=0, 9, (i+1)^d); n++; d++); while(n >= (r+1)^d, n -= (r+1)^d; r++); s = r * 10^d; while(n, s += 10^i*(n%(r+1)); n \= (r+1); i++)); s } \\ David A. Corneth, Jan 31 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Reinhard Zumkeller, Aug 04 2002
EXTENSIONS
Offset corrected by Reinhard Zumkeller, Apr 25 2012
STATUS
approved