Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A123895
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A123895 Restricted growth string for the (decimal expansion of the) number n. +0
4
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 12, 11, 12, 12, 12, 12, 12, 12, 12, 10, 12, 12, 11, 12, 12, 12, 12, 12, 12, 10, 12, 12, 12, 11, 12, 12, 12, 12, 12, 10, 12, 12, 12, 12, 11, 12, 12, 12, 12, 10, 12, 12, 12, 12, 12, 11, 12, 12 (list; graph; listen)
OFFSET

0,11

COMMENT

Write n in base 10 prefixed with a 0. Read this string from left to right. Write a 0 each time you see the first distinct digit (which is 0), write a 1 each time you see the second distinct digit, write a 2 each time you see the third distinct digit and so on. Finally, delete the leading zeros.

REFERENCES

D. E. Knuth, TAOCP, Vol. 4, Section 7.2.1.5, Problems 4 and 5.

EXAMPLE

To find a(66041171): 066041171 -> 011023343 -> 11023343.

PROGRAM

(VBA program from Franklin T. Adams-Watters)

Public Function RestrictedGrowthString(ByVal x As String) As String

Dim i As Long

Dim dig As Integer

Dim pos As Long

For i = 1 To Len(x)

If Mid(x, i, 1) = "0" Then

RestrictedGrowthString = RestrictedGrowthString & "0"

Else

pos = InStr(x, Mid(x, i, 1))

If pos = i Then

dig = dig + 1

RestrictedGrowthString = RestrictedGrowthString &

Format(dig)

Else

RestrictedGrowthString = RestrictedGrowthString &

Mid(RestrictedGrowthString, pos, 1)

End If

End If

Next i

End Function

CROSSREFS

Cf. A123896, A123902.

Sequence in context: A097585 A063671 A162501 this_sequence A147519 A100830 A088475

Adjacent sequences: A123892 A123893 A123894 this_sequence A123896 A123897 A123898

KEYWORD

nonn,base

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com), Nov 20 2006

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 27 22:38 EST 2009. Contains 167602 sequences.


AT&T Labs Research