A261433 k-digit integers equal to the sum of the k-th powers of the tens' complements of their digits.
5, 378, 91882, 3762938, 46478818, 564426414
Offset: 1
Examples
(10 - 5)^1 = 5, (10 - 3)^3 + (10 - 7)^3 + (10 - 8)^3 = 343 + 27 + 8 = 378, (10 - 9)^5 + (10 - 1)^5 + (10 - 8)^5 + (10 - 8)^5 + (10 - 2)^5 = 1 + 59049 + 32 + 32 + 32768 = 91882, etc.
Links
- Geoffrey Campbell, Related to Narcissistic numbers: the Shy numbers, Number Theory group on LinkedIn.com
- Marco Cecchi, Python program based on partitions.
Programs
-
Maple
with(numtheory): P:=proc(q) local a,b,c,k,n; for n from 1 to q do a:=ilog10(n)+1; b:=0; c:=n; for k from 1 to a do b:=b+(10-(c mod 10))^a; c:=trunc(c/10); od; if b=n then print(n); fi; od; end: P(10^9);
-
Mathematica
Select[Range[10^5], # == Total[(10 - IntegerDigits@ #)^ IntegerLength[#]] &] (* Giovanni Resta, Aug 20 2015 *)
-
PARI
isok(n) = (d = digits(n)) && (sum(k=1, #d, (10-d[k])^#d) == n); \\ Michel Marcus, Aug 24 2015
-
Python
from itertools import combinations_with_replacement A261433_list = [] for k in range(1,10): a, k10 = tuple([i**k for i in range(10,0,-1)]), 10**k for b in combinations_with_replacement(range(1,10),k): x = sum(list(map(lambda y:a[y],b))) if x < k10 and tuple(int(d) for d in sorted(str(x))) == b: A261433_list.append(x) A261433_list = sorted(A261433_list) # Chai Wah Wu, Aug 25 2015, updated Apr 06, 2018
Extensions
a(4)-a(6) found by Aleksander Zujev
Comments