login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A060712 Smallest number whose digit sum is 3^n. 2
1, 3, 9, 999, 999999999, 999999999999999999999999999, 999999999999999999999999999999999999999999999999999999999999999999999999999999999 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
MATHEMATICA
Do[ a = {}; While[ Apply[ Plus, a ] + 9 < 3^n, a = Append[ a, 9 ] ]; If[ Apply[ Plus, a ] != 3^n, a = Prepend[ a, 3^n - Apply[ Plus, a ] ] ]; Print[ FromDigits[ a ] ], {n, 1, 6} ]
Join[{1, 3}, Table[FromDigits[PadRight[{}, 3^(n-2), 9]], {n, 2, 6}]] (* Harvey P. Dale, Jun 10 2015 *)
PROG
(PARI) { for (n=0, 8, s=3^n; x=s\9; d=s - 9*x; write("b060712.txt", n, " ", (d+1)*10^x - 1); ) } \\ Harry J. Smith, Jul 10 2009
CROSSREFS
Sequence in context: A137043 A112726 A112725 * A122463 A072005 A060377
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Apr 21 2001
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 06:14 EDT 2024. Contains 371918 sequences. (Running on oeis4.)