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.

A182128 Number of iterations of the map n -> (sum of the decimal digits of n)^3 before reaching the last number of the cycle.

This page as a plain text file.
%I A182128 #16 Jan 30 2022 02:44:25
%S A182128 0,0,2,3,3,2,3,3,1,2,1,2,3,3,2,3,3,1,2,2,2,3,3,2,3,3,1,2,2,2,3,3,2,3,
%T A182128 3,1,2,2,2,2,3,2,3,3,1,2,2,2,2,3,2,3,3,1,2,2,2,2,3,2,3,3,1,2,2,2,2,3,
%U A182128 2,2,3,1,2,2,2,2,3,2,2,3,1,2,2,2,2,3,2
%N A182128 Number of iterations of the map n -> (sum of the decimal digits of n)^3 before reaching the last number of the cycle.
%C A182128 a(n) is the number of times that the cube of the sum of the digits must be calculated before reaching the last number of the cycle.
%e A182128 0 is in the sequence twice because 0 -> 0 and 1 -> 1;
%e A182128 a(3) = 3:
%e A182128     3 ->       3^3 = 27;
%e A182128    27 ->   (2+7)^3 = 729;
%e A182128   729 -> (7+2+9)^3 = 18^3 = 5832 is the end of the map because 5832 -> (5+8+3+2)^3 = 18^3 is already in the trajectory. Hence we obtain the map: 3 -> 27 -> 729 -> 5832 with 3 iterations.
%p A182128 A182128 := proc(n)
%p A182128         local traj ,c;
%p A182128         traj := n ;
%p A182128         c := [n] ;
%p A182128         while true do
%p A182128                 traj := A118880(traj) ;
%p A182128                 if member(traj,c) then
%p A182128                         return nops(c)-1 ;
%p A182128                 end if;
%p A182128                 c := [op(c),traj] ;
%p A182128         end do:
%p A182128 end proc:
%p A182128 seq(A182128(n),n=0..80) ; # _R. J. Mathar_, Jul 08 2012
%Y A182128 Cf. A177148, A178481, A118880.
%K A182128 nonn,base
%O A182128 0,3
%A A182128 _Michel Lagneau_, Apr 13 2012