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.
%I A350300 #24 Jan 09 2025 18:55:40 %S A350300 13,16,19,28,18,27,23,29,31,34,38,44,46,47,55,56,62,65,64,73,35,80, %T A350300 109,127,52,70,112,118,121,127,136,181,97,108,117,130,144,153,88,144, %U A350300 153,160,139,152,153,154,161,173,176,178,181,184,187,189,189,198 %N A350300 Irregular triangle read by rows: The n-th row lists the "n-th power friends", numbers k such that digsum(digsum(k^n)^n) = k but digsum(k^n) is not k. %C A350300 Two numbers x and y with x < y are said to be "n-th power friends" if digsum(x^n)=y and digsum(y^n)=x. This sequence lists both x and y; A350301 lists just the x's and A350302 lists just the y's. %C A350300 The name "n-th power friends" comes from "The Man Who Counted", where the n=2 case is discussed: %C A350300 "The digits of the number 256 add up to 13. The square of 13 is 169. The digits of 169 add up to 16. As a result, the numbers 13 and 16 have a curious relation, which we could call a quadratic friendship" (p. 33). %C A350300 There are finitely many such k for a particular n since digsum(digsum(k^n)^n) <= 9n log_10(9n log_10(k)). There are no such k for n=1 since either k is a single digit or else digsum(k) < k. %D A350300 M. Tahan, The Man Who Counted: A Collection of Mathematical Adventures, W. W. Norton & Company, 1993. %e A350300 Triangle begins: %e A350300 13, 16; %e A350300 19, 28; %e A350300 18, 27; %e A350300 23, 29, 31, 34; %e A350300 ; %e A350300 38, 44, 46, 47, 55, 56, 62, 65; %e A350300 64, 73; %e A350300 35, 80; %e A350300 ; %e A350300 ; %e A350300 109, 127; %e A350300 52, 70, 112, 118, 121, 127, 136, 181; %e A350300 97, 108, 117, 130; %e A350300 144, 153; %e A350300 88, 144, 153, 160; %e A350300 ... %e A350300 18 and 27 are in row n=4 since 18^4 = 104976 and 1 + 0 + 4 + 9 + 7 + 6 = 27, and 27^4 = 531441 and 5 + 3 + 1 + 4 + 4 + 1 = 18. %o A350300 (Python) %o A350300 from math import log %o A350300 n = 1 %o A350300 while n <= 50: %o A350300 k = 2 %o A350300 while 9*n*log(9*n*log(k,10),10) >= k: %o A350300 s1 = sum(int(d) for d in str(k**n)) %o A350300 s2 = sum(int(d) for d in str(s1**n)) %o A350300 if k != s1 and k == s2: %o A350300 print(k) %o A350300 k += 1 %o A350300 n += 1 %Y A350300 Cf. A007953, A350301, A350302. %K A350300 nonn,base,tabf %O A350300 2,1 %A A350300 _Daniel Carter_, Dec 23 2021