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 A038465 #16 Apr 04 2025 12:34:04 %S A038465 13,31,37,39,85,91,93,109,111,117,247,253,255,271,273,279,325,327,333, %T A038465 351,733,739,741,757,759,765,811,813,819,837,973,975,981,999,1053, %U A038465 2191,2197,2199,2215,2217,2223,2269,2271,2277,2295,2431,2433,2439,2457,2511,2917 %N A038465 Sums of 3 distinct powers of 3. %H A038465 Amiram Eldar, <a href="/A038465/b038465.txt">Table of n, a(n) for n = 1..10000</a> %t A038465 Total/@Subsets[3^Range[0,10],{3}]//Union (* _Harvey P. Dale_, Jul 10 2017 *) %o A038465 (Python) %o A038465 from math import comb, isqrt %o A038465 from sympy import integer_nthroot %o A038465 def A038465(n): return 3**((r:=n-1-comb((m:=integer_nthroot(6*n,3)[0])+(t:=(n>comb(m+2,3)))+1,3))-comb((k:=isqrt(b:=r+1<<1))+(b>k*(k+1)),2))+3**((a:=isqrt(s:=n-comb(m-(t^1)+2,3)<<1))+((s<<2)>(a<<2)*(a+1)+1))+3**(m+t+1) # _Chai Wah Wu_, Apr 04 2025 %Y A038465 Base 3 interpretation of A038445. %Y A038465 Cf. A000244, A038464, A038466, A038467, A038468, A038469. %K A038465 nonn,easy %O A038465 1,1 %A A038465 _Olivier Gérard_ %E A038465 Offset corrected by _Amiram Eldar_, Jul 13 2022