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.

A283001 a(n) = (A004186(n) - n)/9.

Original entry on oeis.org

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

Views

Author

David A. Corneth, Feb 26 2017

Keywords

Comments

A004186(n) is the number formed when the digits of n are sorted nonincreasingly.
Is this the same as A037887 or A037851? - R. J. Mathar, Mar 06 2017

Examples

			a(141) = (411 - 141)/9 = 30.
		

Crossrefs

Programs

  • Mathematica
    s[n_]:= FromDigits@ Reverse@ Sort@ IntegerDigits@ n; a[n_]:=(s[n]-n)/9; Table[a[n],{n,0,89}] (* Indranil Ghosh, Feb 26 2017 *)
  • PARI
    a(n) = my(d = digits(n), v=vecsort(d,,4)-d); sum(i=1,#v,v[i]*10^(#v-i)) / 9
    
  • Python
    def A283001(n): return (int("".join(sorted(str(n),reverse=True)))-n)/9 # Indranil Ghosh, Feb 26 2017

Formula

a(10*n) = 10*a(n).