OFFSET
1,2
COMMENTS
A179309 is included in this sequence.
All palindromes are in this sequence. - Harvey P. Dale, Mar 03 2013
LINKS
Carole Dubois, Table of n, a(n) for n = 1..34794
Carole Dubois, Scatterplot of a(n) vs Sum of powers in definition.
EXAMPLE
14603 is in the sequence because :
1 + 4^2 + 6^3 + 0^4 + 3^5 = 3 + 0^2 + 6^3 + 4^4 + 1^5 = 476.
MAPLE
with(numtheory):for n from 1 to 50000 do:l:=length(n):n0:=n:s1:=0:s2:=0:for
m from 1 to l do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v :s1:=s1+u^(l-m+1):s2:=s2+u^m:od:
if s1=s2 then printf(`%d, `, n):else fi:od:
MATHEMATICA
drQ[n_]:=Module[{id=IntegerDigits[n], len}, len=Length[id]; Total[ id^Range[ len]] == Total[id^Range[len, 1, -1]]]; Select[Range[500], drQ] (* Harvey P. Dale, Aug 04 2018 *)
PROG
(PARI) isok(m) = my(d=digits(m), p=#d); sum(k=1, p, d[k]^k) == sum(k=1, p, d[k]^(p-k+1)); \\ Michel Marcus, Mar 22 2021
(Python)
def digpow(s): return sum(int(d)**i for i, d in enumerate(s, start=1))
def aupto(limit):
alst = []
for k in range(1, limit+1):
s = str(k)
if digpow(s) == digpow(s[::-1]): alst.append(k)
return alst
print(aupto(454)) # Michael S. Branicky, Mar 23 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Dec 21 2010
STATUS
approved