OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..8009
EXAMPLE
For k=11, we have DigitSum(3^11) = 27 > 18 = DigitSum(3^12).
MAPLE
N:= 1000: # to get the first N terms
threen:= 3:
digsum:= 3:
count:= 0:
for n from 1 while count < N do
threen:= 3*threen;
oldsum:= digsum;
digsum:= convert(convert(threen, base, 10), `+`);
if oldsum > digsum then
count:= count+1;
A239935[count]:= n;
fi
od: # Robert Israel, Apr 18 2014
MATHEMATICA
lis = Table[Total[IntegerDigits[3^n, 10]], {n, 1, 100}];
Flatten[Position[Greater @@@ Partition[lis, 2, 1], True]]
PROG
(PARI) isok(k) = sumdigits(3^k) > sumdigits(3^(k+1)); \\ Michel Marcus, Jul 03 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Oliver Bel, Mar 29 2014
EXTENSIONS
More terms from Jon E. Schoenfield, Mar 29 2014
STATUS
approved