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 A338495 #8 Feb 16 2025 08:34:00 %S A338495 1,2,3,4,5,6,1,2,3,4,5,6,7,2,3,4,5,6,7,8,3,1,2,3,4,5,6,4,2,3,4,5,6,7, %T A338495 5,3,4,5,6,7,8,6,4,2,3,4,5,6,7,1,2,3,4,5,6,7,2,3,4,5,6,7,8,3,4,3,4,5, %U A338495 6,7,4,2,3,4,5,6,7,5,3,4,5,6,7,8,6,4,5,4,5,6,7,7,5,3,1,2,3,4,5,2,3 %N A338495 Least number of hexagonal pyramidal numbers needed to represent n. %H A338495 Robert Israel, <a href="/A338495/b338495.txt">Table of n, a(n) for n = 1..10000</a> %H A338495 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HexagonalPyramidalNumber.html">Hexagonal Pyramidal Number</a> %H A338495 <a href="/index/Ps#pyramidal_numbers">Index to sequences related to pyramidal numbers</a> %p A338495 N:= 200: # for a(1)..a(N) %p A338495 V:= Vector(N): %p A338495 S:= {seq(n*(n+1)*(4*n-1)/6,n=1..floor((N*3/2)^(1/3)))}: %p A338495 V[convert(S,list)]:= 1: %p A338495 T:= S: %p A338495 for m from 2 do %p A338495 Tn:= select(`<=`,map(t -> op(t +~ S),T),N) minus T; %p A338495 if nops(Tn) = 0 then break fi; %p A338495 T:= T union Tn; %p A338495 V[convert(Tn,list)]:= m %p A338495 od: %p A338495 convert(V,list); # _Robert Israel_, Nov 02 2020 %Y A338495 Cf. A002412, A104246, A234533, A338479, A338493, A338494. %K A338495 nonn %O A338495 1,2 %A A338495 _Ilya Gutkovskiy_, Oct 30 2020