A338495 Least number of hexagonal pyramidal numbers needed to represent n.
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, 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, 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
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Hexagonal Pyramidal Number
- Index to sequences related to pyramidal numbers
Programs
-
Maple
N:= 200: # for a(1)..a(N) V:= Vector(N): S:= {seq(n*(n+1)*(4*n-1)/6,n=1..floor((N*3/2)^(1/3)))}: V[convert(S,list)]:= 1: T:= S: for m from 2 do Tn:= select(`<=`,map(t -> op(t +~ S),T),N) minus T; if nops(Tn) = 0 then break fi; T:= T union Tn; V[convert(Tn,list)]:= m od: convert(V,list); # Robert Israel, Nov 02 2020
Comments