The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A360019 Lexicographically earliest increasing sequence of positive numbers in which no nonempty subsequence of consecutive terms sums to a triangular number. 1
2, 5, 7, 11, 12, 14, 16, 17, 18, 19, 20, 22, 25, 26, 30, 31, 34, 35, 37, 42, 46, 49, 52, 54, 59, 63, 64, 68, 72, 73, 77, 80, 81, 84, 85, 87, 92, 93, 94, 98, 100, 101, 108, 113, 115, 117, 118, 121, 122, 123, 125, 129, 130, 132, 133, 134, 141, 142, 143, 146, 149 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
The sequence cannot contain any triangular numbers.
LINKS
EXAMPLE
a(0) = 2 by the definition of the sequence. The next number > a(0) is 3, but it is a triangular number, so we try 4, but 2 + 4 = 6 is a triangular number. Then we try 5; {5, 2 + 5} are not triangular numbers, thus a(1) = 5. a(2) cannot be 6, so we try 7; {7, 5 + 7, 2 + 5 + 7} are not triangular numbers, thus a(2) = 7.
MAPLE
q:= proc(n) option remember; issqr(8*n+1) end:
s:= proc(i, j) option remember; `if`(i>j, 0, a(j)+s(i, j-1)) end:
a:= proc(n) option remember; local k; for k from 1+a(n-1) while
ormap(q, [k+s(i, n-1)$i=0..n]) do od; k
end: a(-1):=-1:
seq(a(n), n=0..60); # Alois P. Heinz, Jan 21 2023
MATHEMATICA
triQ[n_] := IntegerQ @ Sqrt[8*n + 1]; a[0] = 2; a[n_] := a[n] = Module[{k = a[n - 1] + 1, t = Accumulate @ Table[a[i], {i, n - 1, 0, -1}]}, While[triQ[k] || AnyTrue[t + k, triQ], k++]; k]; Array[a, 61, 0] (* Amiram Eldar, Jan 21 2023 *)
CROSSREFS
Sequence in context: A155085 A077665 A025062 * A175034 A030498 A355774
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Jan 21 2023
EXTENSIONS
More terms from Jon E. Schoenfield, Jan 21 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 21 19:35 EDT 2024. Contains 372738 sequences. (Running on oeis4.)