login
A305706
a(n) = smallest m such that the sum of digits of n^m is greater than n, or 0 if no such m exists.
2
0, 0, 2, 2, 2, 2, 2, 2, 2, 3, 0, 4, 3, 2, 2, 3, 3, 2, 4, 3, 14, 4, 5, 4, 4, 5, 4, 5, 6, 6, 14, 5, 6, 5, 6, 6, 6, 5, 5, 6, 14, 7, 6, 8, 6, 7, 6, 8, 7, 7, 16, 6, 6, 8, 7, 8, 7, 7, 9, 7, 15, 8, 8, 7, 8, 8, 9, 8, 8, 8, 18, 12, 9, 9, 8, 9, 9, 9, 9, 9, 18, 10, 11, 11, 10, 11, 11, 10, 9, 10, 17, 11, 11, 10, 11, 10, 12, 12, 10, 11, 0
OFFSET
0,3
COMMENTS
a(n) = smallest m such that A007953(n^m) > n, or 0 if no such m exists.
If n is a term of A178501, then a(n) = 0. - Felix Fröhlich, Jun 10 2018
LINKS
MATHEMATICA
myLen::usage = "myLen[n] gives the smallest m > 1 such that Total[IntegerDigits[n^m]] > n.";
myLen[n_Integer] := Module[{m = 2}, If[Total[IntegerDigits[n]] < 2, 0, While[Total[IntegerDigits[n^m]] <= n, m++]; m]];
Table[myLen[n], {n, 0, 100}] (* Vincenzo Librandi, Nov 19 2025 *)
PROG
(PARI) a(n) = if(sumdigits(n) < 2, return(0), my(m=2); while(1, if(sumdigits(n^m) > n, return(m)); m++)) \\ Felix Fröhlich, Jun 10 2018
(Magma) a := function(n) if &+Intseq(n) lt 2 then return 0; end if; m := 2; while &+Intseq(n^m) le n do m +:= 1; end while; return m; end function;
[ a(n) : n in [0..100] ]; // Vincenzo Librandi, Nov 18 2025
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Max Alekseyev, Jun 08 2018
STATUS
approved