Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A154532
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A154532 a(n) = largest 10-digit number whose nth power contains each digit (0-9) n times +0
8
9876543210, 9994363488, 9999257781, 9999112926, 9995722269, 9999409158, 9998033316, 9993870774, 9986053188, 9964052493, 9975246786, 9966918135, 9938689137, 9998781633, 9813743148, 9970902252, 9740383767, 9829440591 (list; graph; listen)
OFFSET

1,1

COMMENT

A number with 10*n digits may have all ten digits(0-9) repeated n times. Tthe probability of this is (10n)!/((n!)^10 * 10^((10*n)-10^(10*n-1)). There are 10^10-10^(10-1/n)) numbers which are nth powers of some 10-digit numbers. So there may exist Count=(10n)!*(10^10-10^(10-1/n)))/((n!)^10 * 10^((10*n)-10^(2*n-1)) numbers with the desired property.

LINKS

Zhining Yang, Largest Ten Digit Powers

EXAMPLE

For n=18,a(n)=9829440591. That means 9829440591^18=733699864215610114780902995185639178779529420237628437612828585014749365806991221630255673403360717773074363761194987916402410826486269582245985803425461351754040398703480055853921 18th power of 9829440591 has all digit(0-9) each for 18 times

PROGRAM

(Other) VB code:

Function befit(ByVal s As String, ByVal num As Long) As Boolean 'tell if a string s contain all digit(0-9) for just num times Dim b(9) As Long, t As Long befit = True 'init If Len(s) <> 10 * num Then befit = False: Exit

Function For i = 1 To Len(s) t = Val(Mid(s, i, 1)) b(t) = b(t) + 1 If b(t) > num Then befit = False: Exit Function Next End Function

Function mypower(ByVal num As Currency, ByVal power As Long) As String 'UDF to calculate powers of a 10-digit number Dim b(), temp ReDim b(1 To 2 * power) ReDim s(1 To 2 * power) 'The last two element of the result, i.e. num it self b(2 * power - 1) = Val(Left(num, 5)) 'init b(2 * power) = Val(Right(num, 5)) 'init For i = 2 To power temp = 0 For j = 2 * power To 1 Step -1 temp = b(j) * num + temp b(j) = Format(Val(Right(temp, 5)), "00000") '100000 adic temp = Int(temp / 10 ^ 5) Next Next mypower = Join(b, "") 'The final result End Function

Private Sub Command1_Click() Dim index As Long, j As Currency, s As String For index = 2 To 20 For j = 9999999999# To Int(10 ^ (10 - 1 / index)) + 1 Step -3 'n times 0-9 must be divisible by 3 DoEvents s = mypower(j, index) 'the result If befit(s, index) Then 's contains 0-9 each for index times Open "c:\9876543210.txt" For Append As #1 'Output to a text file Print #1, j & "^" & index & "=" & s 'Print the result Close #1 End If Exit For 'Loop for next index Next End End Sub

CROSSREFS

Cf. A010784 A078255

Sequence in context: A022251 A015385 A027570 this_sequence A157745 A159473 A055619

Adjacent sequences: A154529 A154530 A154531 this_sequence A154533 A154534 A154535

KEYWORD

nonn,base

AUTHOR

Zhining Yang (northwolves(AT)163.com), Jan 11 2009

EXTENSIONS

Edited by N. J. A. Sloane (njas(AT)research.att.com), Jan 12 2008

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 24 23:16 EST 2009. Contains 167481 sequences.


AT&T Labs Research