|
|
A300160
|
|
Quasi-narcissistic numbers: k-digit numbers n whose sum of k-th powers of their digits is equal to n +- 1.
|
|
1
|
|
|
35, 75, 528757, 629643, 688722, 715469, 31672867, 44936324, 63645890, 63645891, 71419078, 73495876, 1136483324, 310374095702, 785103993880, 785103993881, 989342580966, 23046269501054, 37434032885798, 50914873393416, 75759895149717, 4020913800954247
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
35 is in the sequence because 3^2 + 5^2 = 34 = 35 - 1.
31672867 is in the sequence because 3^8 + 1^8 + 6^8 + 7^8 + 2^8 + 8^8 + 6^8 + 7^8 = 31672868 = 31672867 + 1.
|
|
MAPLE
|
P:=proc(q) local a, k, n;
for n from 1 to q do a:=convert(n, base, 10);
a:=add((a[k])^nops(a), k=1..nops(a));
if a=n-1 or a=n+1 then print(n); fi; od; end: P(10^6);
|
|
MATHEMATICA
|
Select[Range[10^6], Abs[# - Total[IntegerDigits[#]^IntegerLength[#]]] == 1 &] (* Michael De Vlieger, Feb 28 2018 *)
|
|
PROG
|
(Python)
from itertools import combinations_with_replacement
for k in range(1, 16):
a = [i**k for i in range(10)]
for b in combinations_with_replacement(range(10), k):
y = sum(map(lambda y:a[y], b))
for x in (y-1, y+1):
if x > 0 and tuple(int(d) for d in sorted(str(x))) == b:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,fini,full
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|