%I #20 Dec 07 2019 12:18:27
%S 0,1,2,4,6,9,11,14,16,21,23,26,28,33,35,38,40,45,50,52,55,57,62,64,67,
%T 69,74,79,81,84,86,91,93,96,98,103,108,110,115,120,122,125,127,132,
%U 134,137,139,144,149,151,154,156,161,163,166,168,173,178,180,185,190
%N Numbers n such that there are no triangular numbers strictly between n^2 and n^2 + n.
%C For n>2, a(n+1) - a(n) = either 2 or 3 or 5 (conjecture; checked up to a(n) = 2^32).
%H Jens Kruse Andersen, <a href="/A242137/b242137.txt">Table of n, a(n) for n = 1..10000</a>
%t triQ[n_] := IntegerQ@ Sqrt[8n + 1]; fQ[n_] := Union[ triQ@# & /@ Range[n^2 + 1, n^2 + n - 1]] == {False}; Join[{0, 1}, Select[ Range@ 200, fQ]] (* _Robert G. Wilson v_, Jan 22 2016 *)
%o (Python)
%o t = prev = 0
%o for n in range(1000000):
%o sq = n*n
%o ob = sq + n
%o s = 0
%o while 1:
%o tn = t*(t+1)/2
%o if tn > sq:
%o if tn < ob:
%o s = 1
%o break
%o t+=1
%o t-=1
%o if s==0:
%o print str(n)+',',
%o #d = n-prev
%o #if d!=2 and d!=3 and d!=5: print n,d
%o #prev = n
%o (PARI) isokt(n) = for (k=n^2+1, n^2+n-1, if (ispolygonal(k, 3), return (0))); return(1); \\ _Michel Marcus_, Aug 16 2014
%Y Cf. A000217, A000290, A002378.
%K nonn
%O 1,3
%A _Alex Ratushnyak_, Aug 16 2014
|