A342826 Numbers k such that d(1)^0 + d(2)^1 + ... + d(p)^(p-1) = d(1)^(p-1) + d(2)^(p-2) + ... + d(p)^0, where d(i), i=1..p, are the digits of k.
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 404, 414, 424, 434, 444, 454, 464
Offset: 1
Examples
1863 is in this sequence because 1^0 + 8^1 + 6^2 + 3^3 = 1^3 + 8^2 + 6^1 + 3^0 = 72.
Links
- R. J. Mathar, Table of n, a(n) for n = 1..1137 (replacing older b-file which did not contain a(101))
- Carole Dubois, Scatterplot of terms of A178354, A342826 vs Sum of powers in definition.
Programs
-
Maple
isA342826 := proc(n) local dgs ; dgs := convert(n,base,10) ; if add(op(i,dgs)^(i-1),i=1..nops(dgs)) = add(op(-i,dgs)^(i-1),i=1..nops(dgs)) then true; else false; end if; end proc: A342826 := proc(n) option remember ; if n =1 then 1; else for a from procname(n-1)+ 1 do if isA342826(a) then return a; end if; end do: end if; end proc: # R. J. Mathar, Sep 27 2021
-
Mathematica
Select[Range[500],Mod[#,10]!=0&&Total[IntegerDigits[#]^Range[0,IntegerLength[ #]-1]]==Total[IntegerDigits[#]^Range[IntegerLength[#]-1,0,-1]]&] (* Harvey P. Dale, Jan 18 2023 *)
-
Python
def digpow(s): return sum(int(d)**i for i, d in enumerate(s)) 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(464)) # Michael S. Branicky, Mar 23 2021
Comments