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!)
A018855 Smallest triangular number that begins with n. 4

%I #14 May 13 2018 11:12:04

%S 1,21,3,45,55,6,78,820,91,10,1128,120,136,1431,15,1653,171,1830,190,

%T 2016,21,2211,231,2415,253,2628,276,28,2926,300,3160,325,3321,3403,

%U 351,36,378,3828,3916,406,4186,4278,435,4465,45,465,4753,4851,496,5050,5151,528

%N Smallest triangular number that begins with n.

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

%p f:= proc(n) local d,t;

%p for d from 0 do

%p t:= ceil((sqrt(8*n*10^d+1)+1)/2);

%p if (2*t-1)^2 < 8*(n+1)*10^d+1 then

%p return t*(t-1)/2 fi

%p od

%p end proc:

%p map(f, [$1..100]); # _Robert Israel_, Feb 27 2017

%t Do[k = Ceiling[ Sqrt[n]]; While[ FromDigits[ Take[ IntegerDigits[ k(k + 1)/2], Floor[ Log[10, n] + 1]]] != n, k++ ]; Print[ k(k + 1)/2], {n, 1, 50} ]

%t With[{tr=Accumulate[Range[150]]},Table[SelectFirst[tr,Take[ IntegerDigits[ #], Length[ IntegerDigits[ n]]] == IntegerDigits[n]&],{n,60}]]//Quiet (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, May 13 2018 *)

%Y Cf. A018801.

%K base,easy,nonn,look

%O 1,2

%A _David W. Wilson_

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 July 9 01:55 EDT 2024. Contains 374171 sequences. (Running on oeis4.)