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.

A272233 Number of steps before n1(i) = n2(i) when n1(i) = n1(i-1) + digsum(n2(i-1)), n2(i) = n2(i-1) + digsum(n1(i-1)) and n1(1) = 10^(n-1), n2(1) = 0.

Original entry on oeis.org

1, 12, 57, 22820, 754504
Offset: 0

Views

Author

Anthony Sand, Apr 23 2016

Keywords

Comments

The sequence takes two different numbers, n1 and n2, and simultaneously adds the digit sum of n1 to n2 and the digit sum of n2 to n1. This process continues until n1 = n2. The two numbers are initialized with n1 = 10^(n-1) and n2 = 0.
a(5) > 10^12. - Lars Blomberg, Jul 19 2017

Examples

			10 > 0, 10 > 1, 11 > 2, 13 > 4, 17 > 8, 25 > 16, 32 > 23, 37 > 28, 47 > 38, 58 > 49, 71 > 62, 79 > 70, 86 = 86
		

Crossrefs

Programs

  • PARI
    {digsum(num) = d=digits(num,b); return(sum(i=1,#d,d[i]));} {doubledigsum() = b=10; nmx=5; for(n=1,nmx, n1=b^(a-1); n2=0; c=0; until(n1==n2, s1=digsum(n1); s2=digsum(n2); n1+=s2; n2+=s1; c++); print1(c,", "); ); }

Formula

n1(i) = n1(i-1) + digsum(n2(i-1)), n2(i) = n2(i-1) + digsum(n1(i-1))