login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Jens Kruse Andersen, Table of n, a(n) for n = 1..10000

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

P(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

Cf. A000040, A002262, A000217.

Sequence in context: A326044 A011414 A155746 * A084511 A084521 A214923

Adjacent sequences:  A243108 A243109 A243110 * A243112 A243113 A243114

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 16 09:13 EDT 2020. Contains 335784 sequences. (Running on oeis4.)