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.

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

Original entry on oeis.org

1, 9, 12, 13, 16, 19, 21, 49, 61, 67, 84, 106, 160, 191, 207, 250, 268, 373, 436, 783, 2321, 3133, 3786, 3805, 4842, 5128, 8167, 13599, 29431, 35308
Offset: 1

Views

Author

Pieter Post, Jun 24 2015

Keywords

Comments

Digitsum = (A007953).
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

Examples

			Digitsum(9) is 9, digitsum(9^2) is 9. (9+9)/2 = 9. So 9 is in this sequence.
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.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • Python
    def sod(n):
        kk = 0
        while n > 0:
            kk= kk+(n%10)
            n =int(n//10)
        return kk
    for c in range (2, 10**3):
        bb=0
        for a in range(1,200):
            bb=bb+sod(c**a)
            if bb==c*a:
                print (c,a)

Extensions

a(21)-a(28) from Giovanni Resta, Jun 24 2015
a(1)-a(28) checked by Robert G. Wilson v, Jul 30 2015
a(29)-a(30) from Robert G. Wilson v, Jul 30 2015