OFFSET
1,1
COMMENTS
The power k of most terms in this sequence is equal to or one more or one less than the number of digits in the term. One exception is 302034: 302034 = 3^9 + 0^9 + 2^9 + 0^9 + 3^9 + 4^9 + 3+0+2+0+3+4.
EXAMPLE
666 = (6+6+6) + (6^3 + 6^3 + 6^3).
7816 = (7+8+1+6) + (7^4 + 8^4 + 1^4 + 6^4).
360522 = (3+6+0+5+2+2) + (3^7 + 6^7 + 0^7 + 5^7 + 2^7 + 2^7).
MAPLE
mmax:= 10: # to get all terms < 10^mmax
Res:= NULL:
score:= (c, p) -> add(c[i+1]*(i+i^p), i=0..9):
for m from 2 to mmax do
comps:= convert(map(`-`, combinat:-composition(10+m, 10), [1$10]), list):
for c in comps do
cL:= [seq(i$c[i+1], i=0..9)];
if max(c[3..-1]) = 0 then slim:= 0 else slim:= 10^m fi;
for p from 1 do
s:= score(c, p);
L:= sort(convert(s, base, 10));
if L = cL then Res:= Res, s; break fi;
if s >= slim then break fi;
od:
od:
od:
sort([Res]); # Robert Israel, May 08 2015
PROG
(Python)
# WARNING: this prints numbers in the sequence, but not in increasing order.
def moda(n, a):
kk = 0
while n > 0:
kk= kk+(n%10)**a
n = n//10
return kk
def sod(n):
kk = 0
while n > 0:
kk += n % 10
n = n//10
return kk
for a in range (1, 10):
for c in range (10, 10**6):
if c == moda(c, a)+sod(c):
print(c, end=", ")
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Pieter Post, May 07 2015
EXTENSIONS
a(14)-a(29) from Giovanni Resta, May 08 2015
STATUS
approved