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.

A236338 Number of iterations of A235600 to reach 1 when starting with n, or -1 if 1 is never reached. (A235600(x) = x/sum_of_digits(x) if this is an integer, otherwise A235600(x) = x.)

This page as a plain text file.
%I A236338 #23 Dec 23 2024 15:57:14
%S A236338 0,1,1,1,1,1,1,1,1,-1,-1,2,-1,-1,-1,-1,-1,2,-1,-1,2,-1,-1,2,-1,-1,2,
%T A236338 -1,-1,-1,-1,-1,-1,-1,-1,2,-1,-1,-1,-1,-1,2,-1,-1,2,-1,-1,2,-1,-1,-1,
%U A236338 -1,-1,2,-1,-1,-1,-1,-1,-1,-1,-1,2,-1,-1,-1,-1,-1
%N A236338 Number of iterations of A235600 to reach 1 when starting with n, or -1 if 1 is never reached. (A235600(x) = x/sum_of_digits(x) if this is an integer, otherwise A235600(x) = x.)
%C A236338 Based on an idea from N. J. A. Sloane, cf. link.
%C A236338 Numbers n = 10^k and also numbers not divisible by their digital sum A007953, are fixed points of A235600, therefore a(n) = -1 for these, except for a(1) = 0, cf. Example.
%C A236338 A235601(k) is the smallest n for which a(n) = k.
%H A236338 N. J. A. Sloane, in reply to D. W. Wilson, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2014-January/012295.html">Re: As much as I hate "base" sequences...</a>, SeqFan list, Jan 18 2014
%H A236338 David W. Wilson, Ray Chandler, Alonso Del Arte, M. F. Hasler, Hans Havermann, Alex Meiburg, N. J. A. Sloane, Hugo Van Der Sanden, and Allan Wechsler, <a href="/A235601/a235601.txt">As much as I hate "base" sequences...</a>, Copies of various posts to the Sequence Fans Mailing List, Circa January 2014. Assembled by _N. J. A. Sloane_, Dec 23 2024
%e A236338 a(1) = 0 since no iteration of A235600 is needed to reach 1.
%e A236338 a(n) = 1 for 1 <= n <= 9, since these n are equal to (thus divisible by) their sum of digits A007953(n), and 1 is reached upon the first iteration of A235600 (which consists of dividing n by its sum of digits).
%e A236338 a(10) = -1 since A007953(10) = 1 and therefore application of A235600 yields a constant sequence that never reaches 1.
%e A236338 a(11) = -1 since 11 is not divisible by A007953(11) = 2 and therefore application of A235600 yields a constant sequence that never reaches 1.
%e A236338 a(12) = 2 since A235600(12) = 12/(1+2) = 4 and A235600(4) = 4/4 = 1, reached after 2 iterations.
%o A236338 (PARI) A236338 = n -> for(i=0,999,n==1&&return(i);if(n%sumdigits(n)||n==n\=sumdigits(n),return(-1)))
%Y A236338 Cf. A005349, A007953, A114440, A235600, A235601.
%K A236338 sign,base
%O A236338 1,12
%A A236338 _M. F. Hasler_, Jan 22 2014