OFFSET
0,3
EXAMPLE
5 is the smallest number which is not represented as sum of 2 numbers of the set {0,1,3}. Therefore 5 is in the sequence.
14 is the smallest number which is not represented as sum of 2 numbers of the set {0,1,3,5,6,10}. Therefore 14 is in the sequence.
MAPLE
isA000217 := proc(n) issqr(8*n+1) ; end proc:
A176747 := proc(n) option remember; if n <=1 then n; else for a from procname(n-1)+1 do if isA000217(a) then return a; end if;
isrep := false; for i from 1 to n-1 do for j from i to n-1 do if procname(i)+procname(j) = a then isrep := true; end if; end do: end do: if not isrep then return a; end if; end do: end if; end proc:
seq(A176747(n), n=0..60) ; # R. J. Mathar, Nov 01 2010
# Alternative:
A176747_list := proc(upto) local P, k, issum, istri; P := [];
issum := k -> ormap(p -> member(k - p, P), P);
istri := k -> issqr(8*k + 1);
for k from 0 to upto do
if istri(k) or not issum(k) then P := [op(P), k] fi od;
P end: print(A176747_list(518)); # Peter Luschny, Jul 20 2022
MATHEMATICA
A176747list[upto_] := Module[{P = {}, issum, istri},
issum[k_] := AnyTrue[P, MemberQ[P, k-#]&];
istri[k_] := IntegerQ@Sqrt[8k+1];
For[k = 0, k <= upto, k++,
If[istri[k] || !issum[k], AppendTo[P, k]]];
P];
A176747list[518] (* Jean-François Alcover, Sep 26 2022, after Peter Luschny *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Apr 25 2010
EXTENSIONS
Definition rephrased, sequence extended beyond 55 by R. J. Mathar, Nov 01 2010
STATUS
approved