login
a(1) = 1, a(n) = smallest positive number such that the concatenation of a(n-1) and a(n) is a triangular number not obtained earlier.
2

%I #12 Jan 11 2019 19:50:59

%S 1,5,5,28,50,50,403,651,511,566,16,53,56,1,20,16,110,26,28,203,203,

%T 841,753,378,885,115,440,391,6,6,30,81,28,441,330,891,1,36,55,65,55,

%U 278,631,90,3,6,66,70,3,25,3,51,51,360,46,5,95,91,80,200,661,825,6,105,85

%N a(1) = 1, a(n) = smallest positive number such that the concatenation of a(n-1) and a(n) is a triangular number not obtained earlier.

%C From _Robert Israel_, Dec 30 2018: (Start)

%C All terms end in 0, 1, 3, 5, 6 or 8.

%C Triangular numbers that cannot be obtained as concatenation of a(n-1) and a(n) include 1, 3, 6, 10, 21, 28, 45, 78, 91. (End)

%H Robert Israel, <a href="/A081847/b081847.txt">Table of n, a(n) for n = 1..10000</a>

%e a(2) = 5 and a(3) = 28 and 528 is a triangular number.

%p Seen:= {}:

%p A[1]:= 1:

%p maxb:= 1:

%p for n from 2 to 100 do

%p found:= false;

%p for d from 1 while not found do

%p r:= A[n-1]*10^d;

%p x0:= r + 10^(d-1);

%p for m from ceil((sqrt(1+8*x0)-1)/2) do

%p x:= m*(m+1)/2;

%p if x >= r + 10^d then break fi;

%p if not member(x,Seen) then

%p A[n]:= x - r;

%p Seen:= Seen union {x};

%p found:= true;

%p break

%p fi

%p od od od:

%p seq(A[n],n=1..100); # _Robert Israel_, Dec 31 2018

%K base,nonn

%O 1,2

%A _Amarnath Murthy_, Apr 10 2003

%E More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 20 2003

%E Edited by _Robert Israel_, Dec 30 2018