login
Numbers n for which there exists a k>=2 such that n equals the average of digitsum(n^p) for p from 1 to k.
1

%I #33 Aug 05 2015 04:37:05

%S 1,9,12,13,16,19,21,49,61,67,84,106,160,191,207,250,268,373,436,783,

%T 2321,3133,3786,3805,4842,5128,8167,13599,29431,35308

%N Numbers n for which there exists a k>=2 such that n equals the average of digitsum(n^p) for p from 1 to k.

%C Digitsum = (A007953).

%C The 'k's are 2, 2, 4, 3, 4, 5, 7, 12, 15, 16, 19, 21, 57, 37, 38, 79, 48, 63, 72, 119, 306, 397, 469, 472, 582, 613, 927, 1461, 2926, 3449, ..., . - _Robert G. Wilson v_, Jul 30 2015

%e Digitsum(9) is 9, digitsum(9^2) is 9. (9+9)/2 = 9. So 9 is in this sequence.

%e 12^1 = 12, 12^2 = 144, 12^3 = 1728 and 12^4 = 20736. Digitsum(12) = 3, digitsum(144) = 9, digitsum(1728) = 18, digitsum(20736) = 18, (3+9+18+18)/4 = 12. So 12 is in this sequence.

%t fQ[n_] := If[ IntegerQ@ Log10@ n, False, Block[{pwr = 2, s = Plus @@ IntegerDigits@ n}, While[s = s + Plus @@ IntegerDigits[n^pwr]; s < n*pwr, pwr++]; If[s == n*pwr, True, False]]]; k = 1; lst = {1}; While[k < 100001, If[fQ@ k, AppendTo[lst, k]]; k++]; lst (* _Robert G. Wilson v_, Jul 30 2015 *)

%o (Python)

%o def sod(n):

%o ....kk = 0

%o ....while n > 0:

%o ........kk= kk+(n%10)

%o ........n =int(n//10)

%o ....return kk

%o for c in range (2, 10**4):

%o ....bb=0

%o ....for a in range(1,200):

%o ........bb=bb+sod(c**a,10)

%o ........if bb==c*a:

%o ............print (c,a)

%Y Cf. A007953, A061910, A061209, A061210.

%K nonn,base,more

%O 1,2

%A _Pieter Post_, Jun 24 2015

%E a(21)-a(28) from _Giovanni Resta_, Jun 24 2015

%E a(1)-a(28) checked by _Robert G. Wilson v_, Jul 30 2015

%E a(29)-a(30) from _Robert G. Wilson v_, Jul 30 2015