cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A123925 Index of first occurrence of A123902(n) in A123896.

Original entry on oeis.org

0, 1, 4, 10, 15, 11, 12, 13, 45, 32, 47, 88, 34, 40, 97, 48, 56, 38, 35, 39, 63, 62, 36, 100, 283, 245, 201, 266, 101, 102, 103, 104, 143, 225, 284, 142, 105, 149, 150, 151, 212, 258, 109, 107, 236, 106, 247, 145, 205, 243, 138, 179, 110, 165, 264, 119, 162, 123
Offset: 0

Views

Author

Keywords

Comments

First number whose square has A123902(n) as its restricted growth string.

Crossrefs

A125099 Numbers in A125098 that are not in A123902.

Original entry on oeis.org

10, 11, 101, 102, 110, 111, 120, 1000, 1001, 1002, 1010, 1011, 1020, 1021, 1022, 1100, 1101, 1110, 1111, 1112, 1120, 1121, 1202, 1210, 1211, 1212, 1220, 1221, 1230, 10001, 10002, 10010, 10011, 10020, 10021, 10022, 10100, 10101, 10110, 10111, 10112
Offset: 1

Views

Author

Keywords

Comments

Numbers that are not the restricted growth string for any square (but are the restricted growth string for some integer).

Crossrefs

A123895 Restricted growth string for the (decimal expansion of the) number n.

Original entry on oeis.org

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
Offset: 0

Views

Author

N. J. A. Sloane, Nov 20 2006

Keywords

Comments

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 0's.

Examples

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

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5, p. 432, Problems 4 and 5.

Crossrefs

Programs

  • Maple
    read("transforms"):
    A123895 := proc(n)
        local dgs,Lmap,idx,dig,pos,Lredu ;
        dgs := [op(convert(n,base,10)) ,0];
        Lmap := [] ;
        for idx from -1 to -nops(dgs) by -1 do
            dig := op(idx,dgs) ;
            if not member(dig,Lmap) then
                Lmap := [op(Lmap),dig] ;
            end if;
        end do:
        Lredu := [] ;
        for idx from -1 to -nops(dgs) by -1 do
            member(op(idx,dgs),Lmap,'pos') ;
            Lredu := [op(Lredu),pos-1] ;
        end do:
        digcatL(Lredu) ;
    end proc:
    seq(A123895(n),n=0..60) ; # R. J. Mathar, Dec 09 2015
  • Mathematica
    f[n_] := Block[{d = Prepend[IntegerDigits@ n, 0], a, b, w}, b = DeleteDuplicates@ d; a = Range[0, Length@ b]; w = FromDigits@ Flatten[Part[a, FirstPosition[b, #]] & /@ d]; w]; Table[f@ n, {n, 0, 67}] (* Michael De Vlieger, Dec 09 2015, Version 10 *)
  • VBA
    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
    ' Franklin T. Adams-Watters

A125098 Values occurring in A123895.

Original entry on oeis.org

0, 1, 10, 11, 12, 100, 101, 102, 110, 111, 112, 120, 121, 122, 123, 1000, 1001, 1002, 1010, 1011, 1012, 1020, 1021, 1022, 1023, 1100, 1101, 1102, 1110, 1111, 1112, 1120, 1121, 1122, 1123, 1200, 1201, 1202, 1203, 1210, 1211, 1212, 1213, 1220, 1221, 1222
Offset: 0

Views

Author

Keywords

Comments

Also, numbers n such that A123895(n) = n. Each digit is either 0, has occurred before, or is one more than the largest preceding digit. The number of k-digit numbers in this sequence is A005493(k-1) for 2<=k<=9. The initial 0 prevents a match for k=1; later values fall short because there are no digits beyond 9 available in decimal.

Crossrefs

Programs

  • Maple
    bag := {} ;
    for i from 0 to 99999 do
        bag := bag union {A123895(i)} ;
    end do:
    sort(convert(bag,list)) ; # R. J. Mathar, Dec 10 2015
  • Mathematica
    f[n_] := Block[{d = Prepend[IntegerDigits@ n, 0], a, b, w}, b = DeleteDuplicates@ d; a = Range[0, Length@ b]; w = FromDigits@ Flatten[Part[a, FirstPosition[b, #]] & /@ d]; w]; Union@ Table[f@n, {n, 0, 10^4}] (* Michael De Vlieger, Dec 09 2015, Version 10 *)
Showing 1-4 of 4 results.