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-2 of 2 results.

A173390 n-th difference between consecutive natural noncomposite numbers = n-th difference between consecutive prime numbers.

Original entry on oeis.org

1, 3, 16, 37, 40, 47, 55, 56, 74, 103, 108, 111, 119, 130, 161, 165, 185, 188, 195, 200, 219, 240, 272, 273, 292, 340, 359, 388, 420, 427, 465, 466, 509, 521, 554, 600, 606, 622, 630, 634, 668, 683, 684, 703, 710, 711, 734, 762, 792, 814, 822, 823, 830, 831
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 17 2010

Keywords

Comments

Numbers n such that A075526(n) = A001223(n).
Essentially the same as A066875. - R. J. Mathar, Feb 21 2010

Crossrefs

Formula

A075526(a(n)) = A001223(a(n)).

A102552 a(n) = prime(n) - (prime(n+1) + prime(n-1))/2.

Original entry on oeis.org

0, -1, 1, -1, 1, -1, -1, 2, -2, 1, 1, -1, -1, 0, 2, -2, 1, 1, -2, 1, -1, -1, 2, 1, -1, 1, -1, -5, 5, -1, 2, -4, 4, -2, 0, 1, -1, 0, 2, -4, 4, -1, 1, -5, 0, 4, 1, -1, -1, 2, -4, 2, 0, 0, 2, -2, 1, 1, -4, -2, 5, 1, -1, -5, 4, -2, 4, -1, -1, -1, 1, 0, 1, -1, -1, 2, -2, -1, 4, -4, 4, -2, 1, -1, -1, 2, 1, -1, -4, 2, 2, -2, 2, -1, -3, 5, -8, 6, -2, 2, 0, 2, -2
Offset: 3

Views

Author

Yasutoshi Kohmoto, Feb 25 2005

Keywords

Examples

			a(6)=-1 because 13-(17+11)/2=-1.
		

References

  • Eric Weisstein, CRC Concise Encyclopedia of Mathematics, 1998, page 1321.

Crossrefs

Programs

  • Magma
    A102552:= func< n | (2*NthPrime(n)-NthPrime(n+1)-NthPrime(n-1))/2 >;
    [A102552(n): n in [3..120]]; // G. C. Greubel, Feb 02 2025
  • Maple
    a:=n->ithprime(n)-(ithprime(n+1)+ithprime(n-1))/2: seq(a(n),n=3..95); # Emeric Deutsch, Mar 02 2005
  • Mathematica
    f[n_] := Prime[n] - (Prime[n - 1] + Prime[n + 1])/2; Table[f[n], {n, 3, 107}] (* Robert G. Wilson v, Sep 25 2006 *)
    #[[2]]-(#[[1]]+#[[3]])/2&/@Partition[Prime[Range[2,110]],3,1] (* Harvey P. Dale, Sep 21 2013 *)
  • PARI
    a(n) = prime(n)-(prime(n+1)+prime(n-1))/2;
    vector(100,n,a(n+2)) \\ Joerg Arndt, Jan 20 2015
    
  • Python
    from sympy import sieve as p
    def A102552(n): return p[n]-(p[n+1]+p[n-1])//2 # Karl-Heinz Hofmann, May 22 2024
    

Formula

a(n) = (1/2)*(A001223(n) - A001223(n+1)).
a(n) = -A036263(n-1)/2. - T. D. Noe, Oct 06 2006 [corrected by Georg Fischer, Oct 19 2023]

Extensions

More terms from Emeric Deutsch, Mar 02 2005
Showing 1-2 of 2 results.