cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A075403 Smallest k such that the difference between the k-th triangular number and the following prime is equal to n.

Original entry on oeis.org

2, 1, 5, 28, 10, 48, 13, 15, 65, 160, 58, 80, 106, 32, 162, 91, 94, 188, 70, 127, 62, 304, 201, 120, 394, 103, 141, 244, 382, 455, 301, 380, 521, 700, 625, 212, 721, 611, 681, 979, 277, 815, 1201, 1275, 569, 4588, 558, 2331, 5113, 1704, 1337, 2551, 2101
Offset: 0

Views

Author

Amarnath Murthy, Sep 23 2002

Keywords

Comments

Index of the first occurrence of n in A075402.

Crossrefs

Cf. A075402.

Programs

  • PARI
    for(n=1,100,f=0:for(k=1,50000,if(nextprime(k*(k+1)/2)-k*(k+1)/2==n,f=k:break)):print1(f","))

Extensions

Corrected and extended by Ralf Stephan, Mar 19 2003

A375752 a(n) is the difference between T=n*(n+1)/2 and the largest prime not exceeding T.

Original entry on oeis.org

0, 1, 3, 2, 2, 5, 5, 2, 2, 5, 5, 2, 2, 7, 5, 2, 4, 9, 11, 2, 2, 5, 7, 8, 2, 5, 5, 2, 2, 5, 5, 4, 2, 11, 5, 2, 2, 7, 9, 2, 16, 5, 7, 2, 12, 5, 5, 2, 16, 5, 5, 2, 2, 9, 13, 16, 2, 11, 7, 2, 2, 5, 11, 2, 4, 5, 5, 4, 8, 5, 7, 2, 8, 7, 9, 2, 2, 23, 11, 2, 12, 17, 11, 12, 2
Offset: 2

Views

Author

Hugo Pfoertner, Aug 26 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[T=n(n+1)/2;T-If[PrimeQ[T],T,NextPrime[T,-1]],{n,2,86}] (* James C. McMahon, Sep 27 2024 *)
  • PARI
    a(n) = my(t=n*(n+1)/2); t - precprime(t)
    
  • Python
    from sympy import prevprime
    def A375752(n): return (t:=n*(n+1)//2) - prevprime(t) # Karl-Heinz Hofmann, Aug 27 2024

Formula

a(n) = A000217(n) - A065384(n). - Michel Marcus, Aug 27 2024

A375754 a(n) is the difference between the next greater square of a prime and n*(n+1)/2.

Original entry on oeis.org

4, 3, 1, 3, 15, 10, 4, 21, 13, 4, 66, 55, 43, 30, 16, 1, 33, 16, 118, 99, 79, 58, 36, 13, 61, 36, 10, 151, 123, 94, 64, 33, 1, 280, 246, 211, 175, 138, 100, 61, 21, 100, 58, 15, 379, 334, 288, 241, 193, 144, 94, 43, 303, 250, 196, 141, 85, 28, 138, 79, 19, 318, 256
Offset: 0

Views

Author

Hugo Pfoertner, Aug 26 2024

Keywords

Examples

			a(0) = A001248(1) - A000217(0) = 2^2 - 0 = 4,
a(1) = A001248(1) - A000217(1) = 2^2 - 1 = 3,
a(2) = A001248(1) - A000217(2) = 2^2 - 3 = 1,
a(3) = A001248(2) - A000217(3) = 3^2 - 6 = 3.
		

Crossrefs

Programs

  • Mathematica
    NextPrime[Sqrt[#]]^2-#&/@Accumulate[Range[0,70]] (* Harvey P. Dale, Feb 16 2025 *)
  • PARI
    a375754(n) = my(t=n*(n+1)/2, s=sqrtint(t), p=nextprime(s)); if(p^2-t < 0, p=nextprime(p+1)); p^2-t
Showing 1-3 of 3 results.