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-10 of 11 results. Next

A130572 Inverse permutation to A130571.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 12, 21, 22, 24, 25, 26, 27, 28, 29, 30, 23, 31, 32, 33, 35, 36, 37, 38, 39, 40, 34, 41, 42, 43, 44, 46, 47, 48, 49, 50, 45, 51, 52, 53, 54, 55, 57, 58, 59, 60, 56, 61, 62, 63, 64, 65, 66, 68, 69, 70, 67, 71, 72
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 05 2007

Keywords

Comments

A130574(n) = a(a(n)); a(A130575(n)) = A130575(n);

A130575 Fixed points of the permutations A130571, A130572, A130573 and A130574.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 21, 22, 31, 32, 33, 41, 42, 43, 44, 51, 52, 53, 54, 55, 61, 62, 63, 64, 65, 66, 71, 72, 73, 74, 75, 76, 77, 81, 82, 83, 84, 85, 86, 87, 88, 101, 211, 212, 310, 311, 312, 313, 410, 411, 412, 413, 414, 510, 511, 512, 513, 514, 515, 610
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 05 2007

Keywords

Comments

A130571(a(n))=a(n), A130572(a(n))=a(n), A130573(a(n))=a(n) and A130574(a(n))=a(n).

A130573 A130571(A130571(n)).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 19, 20, 12, 13, 14, 15, 16, 17, 18, 21, 22, 29, 30, 23, 24, 25, 26, 27, 28, 31, 32, 33, 39, 40, 34, 35, 36, 37, 38, 41, 42, 43, 44, 49, 50, 45, 46, 47, 48, 51, 52, 53, 54, 55, 59, 60, 56, 57, 58, 61, 62, 63, 64, 65, 66, 69, 70, 67, 68, 71, 72
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 05 2007

Keywords

Comments

Permutation of the natural numbers with inverse A130574;
a(A130575(n)) = A130575(n).

A130576 Record values in A130571.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 22, 30, 31, 32, 33, 40, 41, 42, 43, 44, 50, 51, 52, 53, 54, 55, 60, 61, 62, 63, 64, 65, 66, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 100, 101, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 05 2007

Keywords

Comments

a(n)=A130571(A130577(n)); A130571(i)A130577(i);
for n<=54 the sequence coincides with A009996, A032873, A032907, A072543 and A084383.

A130577 Where record values occur in A130571.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 22, 23, 31, 32, 33, 34, 41, 42, 43, 44, 45, 51, 52, 53, 54, 55, 56, 61, 62, 63, 64, 65, 66, 67, 71, 72, 73, 74, 75, 76, 77, 78, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 101, 102, 113, 114, 125, 136, 147, 158, 169, 180, 191, 202, 211
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 05 2007

Keywords

Crossrefs

Formula

A130576(n) = A130571(a(n)).
A130571(i) < A130576(n) for i

Extensions

Definition corrected by Chai Wah Wu, Sep 16 2021

A000030 Initial digit of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Comments

When n - a(n)*10^[log_10 n] >= 10^[(log_10 n) - 1], where [] denotes floor, or when n < 100 and 10|n, n is the concatenation of a(n) and A217657(n). - Reinhard Zumkeller, Oct 10 2012, improved by M. F. Hasler, Nov 17 2018, and corrected by Glen Whitney, Jul 01 2022
Equivalent definition: The initial a(0) = 0 is followed by each digit in S = {1,...,9} once. Thereafter, repeat 10 times each digit in S. Then, repeat 100 times each digit in S, etc.

Examples

			23 begins with a 2, so a(23) = 2.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a000030 = until (< 10) (`div` 10) -- Reinhard Zumkeller, Feb 20 2012, Feb 11 2011
    
  • Magma
    [Intseq(n)[#Intseq(n)]: n in [1..100]]; // Vincenzo Librandi, Nov 17 2018
    
  • Maple
    A000030 := proc(n)
        if n = 0 then
            0;
        else
            convert(n,base,10) ;
            %[-1] ;
        end if;
    end proc:
    seq(A000030(n),n=0..200) ;# N. J. A. Sloane, Feb 10 2017
  • Mathematica
    Join[{0},First[IntegerDigits[#]]&/@Range[90]] (* Harvey P. Dale, Mar 01 2011 *)
    Table[Floor[n/10^(Floor[Log10[n]])], {n, 1, 50}] (* G. C. Greubel, May 16 2017 *)
    Table[NumberDigit[n,IntegerLength[n]-1],{n,0,100}] (* Harvey P. Dale, Aug 29 2021 *)
  • PARI
    a(n)=if(n<10,n,a(n\10)) \\ Mainly for illustration.
    
  • PARI
    A000030(n)=n\10^logint(n+!n,10) \\ Twice as fast as a(n)=digits(n)[1]. Before digits() was added in PARI v.2.6.0 (2013), one could use, e.g., Vecsmall(Str(n))[1]-48. - M. F. Hasler, Nov 17 2018
    
  • Python
    def a(n): return int(str(n)[0])
    print([a(n) for n in range(85)]) # Michael S. Branicky, Jul 01 2022

Formula

a(n) = [n / 10^([log_10(n)])] where [] denotes floor and log_10(n) is the logarithm is base 10. - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 07 2001
a(n) = k for k*10^j <= n < (k+1)*10^j for some j. - M. F. Hasler, Mar 23 2015

A239083 The sequence S = a(1), a(2), ... is defined by a(1)=1, if d,e,f are consecutive digits then we do not have d < e < f, and S is always extended with the smallest integer not yet present in S.

Original entry on oeis.org

1, 2, 10, 3, 11, 4, 12, 13, 14, 15, 5, 6, 16, 17, 7, 8, 18, 19, 9, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 200, 201, 121, 122, 130, 202
Offset: 1

Author

Michel Marcus and N. J. A. Sloane, Mar 10 2014

Keywords

Comments

More than the usual number of terms are given in order to show that the pattern breaks after 120.
Computed by Lars Blomberg.
This is the first (Sa) of a family of 25 similar sequences. For others see
The sequence So (see link) has d > e = f in the definition. It does not have its own entry in the OEIS because it begins with the numbers 1 through 99. Using x-y to indicate the numbers from x through y, the sequence So begins like this:
1-99,101-109,120,110-112,121,201,113,122-130,114,131,202,132-140,115,141,
203,142-150,116,151,204,152-160,117,161,205,162-170,118,171,206, 172-180,
119,181,207,182-191, 208,192-199,209, 210,212-219,230, 220-223,231, 224,232,
301, 225,233-240,226,241,227,242, ...
Likewise, the sequence Sw is omitted for a similar reason. It has d = e > f in the definition, and begins 1-89,99,999,9999,99999,999999,9999999,..., continuing with strings of 9's.
Again, the sequences Sx and Sy are omitted because they are too close to A130571.
Sx (which has d = e >= f) begins
1-11,20,12-19,21,22,30,23-29,31-33,40,34-39,41-44,50,45-49,51-55,60,56-59,
61-66, 70,67-69,71-77,80,78,79,81-88,90,89,100,91-98,101,120,102-109,
112-119,121,122,300, 123-133,400,134-144,500,145-155,600,156-166,700,
167-177,800,178-188,900,189-198,200-202, ...
and Sy (d = e = f) begins
1-11,20,12-19,21,22,30,23-29,31-33,40,34-39,41-44,50,45-49,51-55,60,56-59,
61-66, 70,67-69,71-77,80,78,79,81-88,90,89,91-110,112-221,223-332,334-443,
445-554,556-665, 667-776,778-887,889-899,1001,900-989,1002,990-998,1003-1010,...
The sequences Sd, Si, Sl, Sq are omitted because they do not have enough terms to warrant their own entries.

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Sep 28 2013

Crossrefs

The sequences in this family are given in A239083-A239086, A239136-A239139, A239087-A239090, A239215-A239218, A239235.

Programs

  • Mathematica
    a[1]=1;a[n_]:=a[n]=Block[{k=1},While[MemberQ[s=Array[a,n-1],k]||Or@@(#<#2<#3&@@@Partition[Flatten[IntegerDigits/@Join[s[[-2;;]],{k}]],3,1]),k++];k];Array[a,126] (* Giorgos Kalogeropoulos, May 13 2022 *)
  • Python
    is_ok = lambda s: not any(s[i-2] < s[i-1] < s[i] for i in range(2, len(s)))
    terms, appears, digits = [1],{1},'1'
    for i in range(100):
        t = 1
        while not(t not in appears and is_ok(digits + str(t))):
            t += 1
        terms.append(t); appears.add(t); digits = digits + str(t)
        digits = digits[-2:]
    print(terms) # Gleb Ivanov, Dec 04 2021

A184992 a(n) is the least positive integer not occurring earlier that shares a digit with a(n-1); a(1)=1.

Original entry on oeis.org

1, 10, 11, 12, 2, 20, 21, 13, 3, 23, 22, 24, 4, 14, 15, 5, 25, 26, 6, 16, 17, 7, 27, 28, 8, 18, 19, 9, 29, 32, 30, 31, 33, 34, 35, 36, 37, 38, 39, 43, 40, 41, 42, 44, 45, 46, 47, 48, 49, 54, 50, 51, 52, 53, 55, 56, 57, 58, 59, 65, 60, 61, 62, 63, 64, 66, 67, 68, 69, 76, 70, 71, 72, 73
Offset: 1

Author

Eric Angelini, Dec 22 2011

Keywords

Comments

A permutation of the positive integers.

Crossrefs

a(n) = A107353(n) for n>=3. - Alois P. Heinz, Dec 22 2011
Cf. A227118 (inverse); A067581.

Programs

  • Haskell
    import Data.List (delete, intersect); import Data.Function (on)
    a184992 n = a184992_list !! (n-1)
    a184992_list = 1 : f 1 [2..] where
       f u vs = v : f v (delete v vs)
         where v : _ = filter (not . null . (intersect `on` show) u) vs
    -- Reinhard Zumkeller, Jul 01 2013
    
  • Mathematica
    FromDigits /@ Nest[Function[a, Append[a, Block[{k = 2, d}, While[Nand[FreeQ[a, #], IntersectingQ[a[[-1]], #]] &@ Set[d, IntegerDigits@ k], k++]; d]]], {{1}}, 73] (* Michael De Vlieger, Mar 17 2018 *)
  • PARI
    A184992(n,show=0)={my(a=1,u=2^1);for(k=2,n,show && print1(a",");a=Set(Vec(Str(a))); for(j=2,9e9,bittest(u,j) && next;setintersect(Set(Vec(Str(j))),a) || next; u+=2^a=j; break));a}  \\ M. F. Hasler, Dec 22 2011
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        an, aset, mink = 1, {1}, 1
        while True:
            yield an
            digset = set(str(an))
            an = next(k for k in count(mink) if k not in aset and set(str(k))&digset)
            aset.add(an)
            while mink in aset: mink += 1
    print(list(islice(agen(), 74))) # Michael S. Branicky, Oct 03 2024

A162501 Lexicographically earliest permutation of the natural numbers such that in decimal representation the initial digit for each term is equal to the last nonzero digit of its predecessor; a(1)=1.

Original entry on oeis.org

1, 10, 11, 12, 2, 20, 21, 13, 3, 30, 31, 14, 4, 40, 41, 15, 5, 50, 51, 16, 6, 60, 61, 17, 7, 70, 71, 18, 8, 80, 81, 19, 9, 90, 91, 100, 101, 102, 22, 23, 32, 24, 42, 25, 52, 26, 62, 27, 72, 28, 82, 29, 92, 200, 201, 103, 33, 34, 43, 35, 53, 36, 63, 37, 73, 38, 83, 39, 93, 300, 301
Offset: 1

Author

Reinhard Zumkeller, Jul 05 2009

Keywords

Comments

A000030(a(n+1)) = A065881(a(n));
inverse of A162502: a(A162502(n)) = A162502(a(n)) = n;
a(a(n)) = A162503(n).

Crossrefs

A353888 a(n) is the least positive integer not occurring earlier in the sequence that contains at least one digit not in a(n-1); a(1)=1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 11, 21, 23, 24, 25, 26, 27, 28, 29, 30, 22, 31, 32, 34, 35, 36, 37, 38, 39, 40, 33, 41, 42, 43, 45, 46, 47, 48, 49, 50, 44, 51, 52, 53, 54, 56, 57, 58, 59, 60, 55, 61, 62, 63, 64, 65, 67, 68
Offset: 1

Author

Sergio Pimentel, May 09 2022

Keywords

Comments

The sequence is finite. 1023456789 should be the last number in the sequence, although many smaller numbers should fail to appear. How many terms are in the complete sequence?
The last term is a(1023445778) = 1023456789, the least missing number is 1000000010. - Rémy Sigrist, Jun 03 2022
At that point, the least missing numbers containing the digits 2..9 are 1020001000, 1023001300, 1023401000, 1023450200, 1023456024, 1023456710, 1023456781, 1023456789, resp. - Michael S. Branicky, Aug 26 2022

Examples

			a(11)=12 since a(10)=10 and 12 is the smallest number not occurring earlier in the sequence that contains a digit (2) that is not in 10.
		

Crossrefs

Programs

  • PARI
    isok(k, prev) = {my(d=digits(k)); for (i=1, #d, if (!vecsearch(prev, d[i]), return(1));); return(0);}
    find(va, n) = {my(k=1, prev=Set(digits(va[n-1]))); while (vecsearch(Set(va), k) || !isok(k, prev), k++); k;}
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = find(va, n);); va;} \\ Michel Marcus, May 11 2022
    (C++) See Links section.
    
  • Python
    from itertools import count, islice
    def agen():  # generator of terms
        an, aset, mu, mink = 0, set(), [10, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1
        while set(str(an)) != set("0123456789"):
            notin = set("0123456789") - set(str(an))
            an = min(mu[i] for i in range(10) if str(i) in notin)
            yield an; aset.add(an)
            for i in range(10):  # update min unused containing digit i
                while mu[i] in aset or str(i) not in str(mu[i]): mu[i] += 1
            for k in range(mink, min(mu)): aset.discard(k)
            mink = min(mu)
    print(list(islice(agen(), 67))) # Michael S. Branicky, Aug 26 2022
Showing 1-10 of 11 results. Next