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.

A009996 Numbers with digits in nonincreasing order.

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, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 110, 111, 200, 210, 211
Offset: 1

Views

Author

Keywords

Comments

Base-10 representation Sum_{i=0..m} d(i)*10^i has d(m) >= d(m-1) >= ... >= d(1) >= d(0).
These numbers might be called "Nialpdromes".
A004186(a(n)) = a(n). - Reinhard Zumkeller, Oct 31 2007

Examples

			As 10000 = C(10+6,10) - 6 + C(7+6,1+6) + C(5+5,1+5) + C(4+4,1+4) + C(3+3,1+3) + C(1+2,1+2) + C(0+1,1+1), C(0+0,1+0), a(10000) = 7543100.
		

Crossrefs

Differs from A032873 and A032907.

Programs

  • Mathematica
    Select[Range[0,211], GreaterEqual@@IntegerDigits[#]&] (* Ray Chandler, Oct 25 2011 *)
  • PARI
    is(n)=my(d=digits(n)); for(i=2,#d,if(d[i]>d[i-1],return(0))); 1 \\ Charles R Greathouse IV, Jan 02 2014
    
  • PARI
    \\ This program is optimized for fast calculation of a(n) for large n.
    a(n)={my(q,m=10,i,r=0);n--;while(binomial(m+1,10)<=n+m-9,m++);n-=binomial(m,10);n+=m-9;q=m-9;i=q;while(n>0,m=i;while(binomial(m+1,i)<=n,m++);r=10*r+m+1-i;n-=binomial(m,i);i--;);z=q-#digits(r);r*=10^z;r} \\ David A. Corneth, Jun 01 2014
    
  • PARI
    \\recursive--feed an element a(n)>0 and it gives a(n+1).
    nxt(n)={my(r,d=digits(n),y,t); if(d[#d]!=9,y=1; while(y-#d-1&&d[y]==9,y++); t=#d; forstep(i=t,y+1,-1,if(d[i-1]!=d[i],t=i-1;break)); if(t!=#d,d[t+1]++; for(i=t+2,#d,d[i]=0),d[y]++; for(i=y+1,#d,d[i]=0));r=d ,d=vector(#d+1); d[1]=1;for(i=2,#d,d[i]=0); r=d); sum(i=1,#r,10^(#r-i)*r[i])} \\ David A. Corneth, Jun 01 2014
    
  • Python
    from itertools import count, islice, combinations_with_replacement as mc
    def agen(): # generator of terms
        yield 0
        for d in count(1):
            ni = (int("".join(m)) for m in mc("9876543210", d) if m[0]!="0")
            yield from sorted(ni)
    print(list(islice(agen(), 70))) # Michael S. Branicky, Jun 24 2022

Formula

Binomial(n+k,k) = (n+k)!/(n!*k!). d(i) is the i-th digit of a(n). q is the number of digits of a(n). Find the highest m such that C(10 + m, 10) - m + 1 <= n. a(n) has m+1 digits. Set n = n - C(10+m,10). Find the highest d(m+1), then d(m), then ..., then d(1) each iteration such that C(d(m+1)+m+1,1+m+1)<=n. Then set n = n-C(d(m+1)+m+1,m+2). If n = 0 then stop. All remaining digits are 0.

Extensions

Corrected by Rick L. Shepherd, Jun 06 2002

A032907 Numbers whose base-10 representation Sum_{i=0..m} d(i)*10^i has d(0) <= d(1) >= d(2) <= ...

Original entry on oeis.org

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, 91, 92, 93, 94, 95, 96, 97, 98, 99, 110, 111, 120
Offset: 1

Views

Author

Keywords

Crossrefs

Differs from A032873 and A009996.

Programs

  • PARI
    is(n)=my(d=digits(n));r=1;forstep(i=#d,2,-1,if((-1)^(#d-i)*d[i]>(-1)^(#d-i)*d[i-1],r=0;break));r \\ David A. Corneth, Feb 01 2015

A072543 Numbers whose largest decimal digit is also the initial digit.

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, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 110, 111, 200, 201
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 04 2002

Keywords

Comments

A054055(a(n)) = A000030(a(n));
the sequence differs from A009996, A032873 and A032907: a(66)=101 is not in A009996, a(67)=110 is not in A032873 and a(65)=100 is not in A032907.

Examples

			a(10^ 1) = 9
a(10^ 2) = 411
a(10^ 3) = 6216
a(10^ 4) = 73474
a(10^ 5) = 813826
a(10^ 6) = 8512170
a(10^ 7) = 88368780
a(10^ 8) = 911960211
a(10^ 9) = 9237655227
a(10^10) = 93323313303
		

Crossrefs

Cf. A072544.

Programs

  • Haskell
    a072543 n = a072543_list !! (n-1)
    a072543_list = [x | x <- [0..], a054055 x == a000030 x]
    -- Reinhard Zumkeller, Apr 25 2012
    
  • Maple
    for i from 1 to 10 do A[i]:= i-1 od:
    count:= 10:
    for i from 1 to 9 do P[i]:= [seq([j],j=0..i)]; od:
    for d from 2 to 4 do
      for x from 1 to 9 do
        for p in P[x] do
          count:= count+1;
          A[count]:= add(p[k]*10^(k-1),k=1..d-1) + x*10^(d-1);
        od:
        P[x]:= [seq(seq([op(v),t], v=P[x]),t=0..x)];
      od
    od:
    seq(A[i],i=1..count); # Robert Israel, Feb 01 2015
  • Mathematica
    Select[Range[0,250],Max[IntegerDigits[#]]==First[IntegerDigits[#]]&] (* Harvey P. Dale, Apr 28 2016 *)
  • PARI
    is(n)=n=digits(n); !#n || n[1]==vecmax(n) \\ Charles R Greathouse IV, Jan 02 2014
    
  • PARI
    a(n)={d = 0; r = 1; s = 0; i = 0; if(n == 1, 0, n-=2; while(n > sum(i=0, 9,(i+1)^d), n-=sum(i=0, 9, (i+1)^d); n++; d++); while(n >= (r+1)^d, n -= (r+1)^d; r++);s = r * 10^d; while(n, s += 10^i*(n%(r+1)); n \= (r+1); i++));s } \\ David A. Corneth, Jan 31 2015

Extensions

Offset corrected by Reinhard Zumkeller, Apr 25 2012

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.
Showing 1-4 of 4 results.