cp's OEIS Frontend

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.

A176747 Triangular numbers and numbers which cannot be represented as a sum of two earlier members of the sequence.

This page as a plain text file.
%I A176747 #15 Sep 26 2022 06:17:12
%S A176747 0,1,3,5,6,10,14,15,21,23,28,32,36,40,45,52,55,66,74,78,82,86,91,105,
%T A176747 113,117,120,124,136,153,155,166,171,184,190,197,201,209,210,217,228,
%U A176747 231,247,253,276,278,300,311,325,349,351,378,390,406,435,439,465,474,496,516,518
%N A176747 Triangular numbers and numbers which cannot be represented as a sum of two earlier members of the sequence.
%e A176747 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.
%e A176747 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.
%p A176747 isA000217 := proc(n) issqr(8*n+1) ; end proc:
%p A176747 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;
%p A176747 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:
%p A176747 seq(A176747(n),n=0..60) ; # _R. J. Mathar_, Nov 01 2010
%p A176747 # Alternative:
%p A176747 A176747_list := proc(upto) local P, k, issum, istri; P := [];
%p A176747 issum := k -> ormap(p -> member(k - p, P), P);
%p A176747 istri := k -> issqr(8*k + 1);
%p A176747 for k from 0 to upto do
%p A176747     if istri(k) or not issum(k) then P := [op(P), k] fi od;
%p A176747 P end: print(A176747_list(518));  # _Peter Luschny_, Jul 20 2022
%t A176747 A176747list[upto_] := Module[{P = {}, issum, istri},
%t A176747 issum[k_] := AnyTrue[P, MemberQ[P, k-#]&];
%t A176747 istri[k_] := IntegerQ@Sqrt[8k+1];
%t A176747 For[k = 0, k <= upto, k++,
%t A176747    If[istri[k] || !issum[k], AppendTo[P, k]]];
%t A176747 P];
%t A176747 A176747list[518] (* _Jean-François Alcover_, Sep 26 2022, after _Peter Luschny_ *)
%Y A176747 Cf. A000217, A176744, A176745, A176746.
%K A176747 nonn
%O A176747 0,3
%A A176747 _Vladimir Shevelev_, Apr 25 2010
%E A176747 Definition rephrased, sequence extended beyond 55 by _R. J. Mathar_, Nov 01 2010