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.

A257768 Numbers m such that for some power k, m is the sum of d + d^k as d runs through the digits of m.

This page as a plain text file.
%I A257768 #49 Sep 21 2022 09:33:11
%S A257768 12,18,30,90,666,870,960,1998,7816,42648,119394,302034,360522,1741752,
%T A257768 12051036,909341082,931186956,1136424308,1145082306,8390370196,
%U A257768 49388550660,52927388760,100552730520,41845367362266,51671446297908,245917854035004,607628544623816,858683110606660,4023730658941192
%N A257768 Numbers m such that for some power k, m is the sum of d + d^k as d runs through the digits of m.
%C A257768 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.
%e A257768 666 = (6+6+6) + (6^3 + 6^3 + 6^3).
%e A257768 7816 = (7+8+1+6) + (7^4 + 8^4 + 1^4 + 6^4).
%e A257768 360522 = (3+6+0+5+2+2) + (3^7 + 6^7 + 0^7 + 5^7 + 2^7 + 2^7).
%p A257768 mmax:= 10:  # to get all terms < 10^mmax
%p A257768 Res:= NULL:
%p A257768 score:= (c,p) -> add(c[i+1]*(i+i^p), i=0..9):
%p A257768 for m from 2 to mmax do
%p A257768 comps:= convert(map(`-`,combinat:-composition(10+m,10),[1$10]),list):
%p A257768 for c in comps do
%p A257768   cL:= [seq(i$c[i+1], i=0..9)];
%p A257768   if max(c[3..-1]) = 0 then slim:= 0 else slim:= 10^m fi;
%p A257768   for p from 1 do
%p A257768     s:= score(c,p);
%p A257768     L:= sort(convert(s,base,10));
%p A257768     if L = cL then Res:= Res,s; break fi;
%p A257768     if s >= slim then break fi;
%p A257768   od:
%p A257768 od:
%p A257768 od:
%p A257768 sort([Res]); # _Robert Israel_, May 08 2015
%o A257768 (Python)
%o A257768 # WARNING: this prints numbers in the sequence, but not in increasing order.
%o A257768 def moda(n,a):
%o A257768     kk = 0
%o A257768     while n > 0:
%o A257768         kk= kk+(n%10)**a
%o A257768         n = n//10
%o A257768     return kk
%o A257768 def sod(n):
%o A257768     kk = 0
%o A257768     while n > 0:
%o A257768         kk += n % 10
%o A257768         n = n//10
%o A257768     return kk
%o A257768 for a in range (1, 10):
%o A257768     for c in range (10, 10**6):
%o A257768         if c == moda(c,a)+sod(c):
%o A257768             print(c, end=",")
%Y A257768 Cf. A115518, A130680, A111434.
%K A257768 base,nonn
%O A257768 1,1
%A A257768 _Pieter Post_, May 07 2015
%E A257768 a(14)-a(29) from _Giovanni Resta_, May 08 2015