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-2 of 2 results.

A270172 Number of steps required to reach a single-digit number when successively increasing all digits of n by 1 simultaneously and removing leading zeros (9 becomes 0).

Original entry on oeis.org

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

Views

Author

Felix Fröhlich, Mar 12 2016

Keywords

Examples

			For n = 11: Successively increasing the digits of n yields the sequence s(t) (starting with t = 0): 11, 22, 33, 44, 55, 66, 77, 88, 99, 0. s(9) = 0, so a(11) = 9.
For n = 15: The sequence s(t) (again starting with t = 0): 15, 26, 37, 48, 59, 60, 71, 82, 93, 4. s(9) = 4, so a(15) = 9.
		

Crossrefs

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    increasedigits(n) = my(d=digits(n)); for(k=1, #d, d[k]++; if(d[k]==10, d[k]=0)); eva(d)
    a(n) = my(x=n, i=0); while(#Str(x) > 1, x=increasedigits(x); i++); i

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

Original entry on oeis.org

0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 9, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 13, 12, 11, 10, 9, 8, 7
Offset: 0

Views

Author

Felix Fröhlich, Mar 13 2016

Keywords

Crossrefs

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    increasedigits(n) = my(d=digits(n)); for(k=1, #d, d[k]++; if(d[k]==10, d[k]=0)); eva(d)
    a270172(n) = my(x=n, i=0); while(#Str(x) > 1, x=increasedigits(x); i++); i
    a(n) = a270172(10*n)
Showing 1-2 of 2 results.