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.

A347189 Positive integers that can be expressed as the sum of powers of their digits (from right to left) with consecutive natural exponents.

This page as a plain text file.
%I A347189 #30 Sep 16 2022 04:05:00
%S A347189 1,2,3,4,5,6,7,8,9,24,332,1676,121374,4975929,134116265,1086588775,
%T A347189 3492159897,8652650287,8652650482
%N A347189 Positive integers that can be expressed as the sum of powers of their digits (from right to left) with consecutive natural exponents.
%C A347189 Any number > 9 consisting of just one digit (A014181) can't be in the list. (Provable using the Carmichael function.)
%e A347189 24 = 4^2 + 2^3 is a term.
%e A347189 332 = 2^3 + 3^4 + 3^5 is another term.
%o A347189 (Python)
%o A347189 liste = []
%o A347189 for ex in range(0, 20):
%o A347189     for t in range(1, 10000):
%o A347189         n = t
%o A347189         pot = ex
%o A347189         ergebnis = 0
%o A347189         while n > 0:
%o A347189             pot = pot + 1
%o A347189             rest = n % 10
%o A347189             n = (n - rest) // 10
%o A347189             zw = 1
%o A347189             for i in range(pot):
%o A347189                 zw = zw * rest
%o A347189             ergebnis = ergebnis + zw
%o A347189         if (int(ergebnis) == t) and (t not in liste):
%o A347189             liste.append(t)
%o A347189 liste.sort()
%o A347189 print(liste)
%o A347189 (Python)
%o A347189 def powsum(digits, startexp):
%o A347189     return sum(digits[i]**(startexp+i) for i in range(len(digits)))
%o A347189 def ok(n):
%o A347189     if n < 10: return True
%o A347189     s = str(n)
%o A347189     if set(s) <= {'0', '1'}: return False
%o A347189     digits, startexp = list(map(int, s))[::-1], 1
%o A347189     while powsum(digits, startexp) < n: startexp += 1
%o A347189     return n == powsum(digits, startexp)
%o A347189 print(list(filter(ok, range(2*10**5)))) # _Michael S. Branicky_, Aug 29 2021
%Y A347189 Cf. A023052, A032799, A014181.
%K A347189 nonn,base,more
%O A347189 1,2
%A A347189 _Reiner Moewald_, Aug 21 2021
%E A347189 a(15)-a(19) from _Michael S. Branicky_, Aug 31 2021