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!)
A243111 Difference between the smallest triangular number >= n-th prime and the n-th prime. 1
1, 0, 1, 3, 4, 2, 4, 2, 5, 7, 5, 8, 4, 2, 8, 2, 7, 5, 11, 7, 5, 12, 8, 2, 8, 4, 2, 13, 11, 7, 9, 5, 16, 14, 4, 2, 14, 8, 4, 17, 11, 9, 19, 17, 13, 11, 20, 8, 4, 2, 20, 14, 12, 2, 19, 13, 7, 5, 23, 19, 17, 7, 18, 14, 12, 8, 20, 14, 4, 2, 25, 19, 11, 5, 27, 23, 17, 9, 5, 26, 16, 14, 4, 2, 26 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
EXAMPLE
x, 0 , x , x , x
0 0 0 0 0 0 x x x x
0 0 0 0 0 0 0 0 x
0 0 0 0 0 0 0 0
0 0 0 0 0
prime(n) = 2,3,5,7,11,...
x -> we need respectively 1, 0, 1, 3 and 4 numbers to complete the whole triangle.
MATHEMATICA
Module[{upto=100, tnos}, tnos=Accumulate[Range[Ceiling[(Sqrt[8*Prime[upto]+ 1]- 1)/2]]]; Table[SelectFirst[tnos, #>=Prime[n]&]-Prime[n], {n, upto}]] (* Harvey P. Dale, Jan 15 2015 *)
PROG
(PARI)
a(n)=k=1; while(k*(k+1)/2<prime(n), k++); return(k*(k+1)/2-prime(n))
vector(100, n, a(n)) \\ Derek Orr, Aug 21 2014
CROSSREFS
Sequence in context: A326044 A011414 A155746 * A084511 A084521 A214923
KEYWORD
nonn,easy
AUTHOR
Odimar Fabeny, Aug 20 2014
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 April 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)