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

A039734 a(n)=the prime q

Original entry on oeis.org

2, 3, 5, 7, 7, 11, 11, 13, 17, 17, 19, 23, 23, 29, 29, 31, 31, 37, 37, 37, 41, 43, 47, 53, 53, 53, 59, 59, 59, 67, 67, 71, 71, 79, 79, 79, 83, 89, 89, 97, 97, 97, 97, 101, 101, 107, 113, 127, 127, 127, 127, 127, 127, 131, 137, 137, 137
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sort[Prime@Range@n, Mod[Prime[n], #1] > Mod[Prime[n], #2] &][[1]], {n, 2, 58}] (* Ivan Neretin, Feb 23 2018 *)
  • PARI
    a(n) = {theq = 0; modmax = 0; pr = prime(n); forprime(q = 2, pr-1, mq = pr % q; if (mq > modmax, modmax = mq; theq = q);); theq;} \\ Michel Marcus, Oct 02 2013

A079952 Number of primes less than prime(n)/2.

Original entry on oeis.org

0, 0, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 13, 14, 15, 15, 15, 16, 16, 16, 18, 18, 19, 19, 21, 21, 21, 22, 23, 23, 24, 24, 24, 24, 25, 25, 27, 29, 30, 30, 30, 30, 30, 30, 31, 32, 32, 32, 33, 34, 34, 34, 36, 36, 36, 37, 38, 39, 40
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 19 2003

Keywords

Comments

Previous name: Number of primes p such that prime(n) mod 2*p < prime(n).
Same as A055930, except for a(2). [Noticed by R. J. Mathar, Dec 15 2008, proved by Andrey Zabolotskiy, Oct 26 2017]

Examples

			n = 6: prime(6) = 13 and 2, 3, 5 are less than 13/2, therefore a(6) = 3.
		

Crossrefs

Programs

Formula

A079950(n, a(n) + 1) = prime(n).
Where defined, that is for n > 2, prime(a(n)) = A055377(prime(n)). - Peter Munn, Sep 18 2017
0 with partial sums of A217564. - David A. Corneth, Oct 26 2017 (found earlier by Peter Munn).

Extensions

New name from Peter Munn, Sep 18 2017

A079950 Triangle of n-th prime modulo twice primes less n-th prime.

Original entry on oeis.org

2, 3, 3, 1, 5, 5, 3, 1, 7, 7, 3, 5, 1, 11, 11, 1, 1, 3, 13, 13, 13, 1, 5, 7, 3, 17, 17, 17, 3, 1, 9, 5, 19, 19, 19, 19, 3, 5, 3, 9, 1, 23, 23, 23, 23, 1, 5, 9, 1, 7, 3, 29, 29, 29, 29, 3, 1, 1, 3, 9, 5, 31, 31, 31, 31, 31, 1, 1, 7, 9, 15, 11, 3, 37, 37, 37, 37, 37, 1, 5, 1, 13, 19, 15, 7, 3, 41
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 19 2003

Keywords

Comments

The right border of the triangle are the primes: T(n,n)=A000040(n); T(n,1)=A039702(n), T(n,2)=A039704(n) for n>1, T(n,3)=A007652(n) for n>2, T(n,4)=A039712(n) for n>3;

Examples

			Triangle begins:
  2;
  3, 3;
  1, 5, 5;
  3, 1, 7,  7;
  3, 5, 1, 11, 11;
  1, 1, 3, 13, 13, 13;
  1, 5, 7,  3, 17, 17, 17;
  ...
		

Crossrefs

Programs

  • Maple
    A079950 := proc(n,k)
        modp(ithprime(n),2*ithprime(k)) ;
    end proc:
    seq(seq(A079950(n,k),k=1..n),n=1..12) ; # R. J. Mathar, Sep 28 2017
  • PARI
    T(n,k) = prime(n) % (2*prime(k));
    tabl(nn) = for (n=1, nn, for (k=1, n, print1(T(n,k), ", ")); print); \\ Michel Marcus, Sep 21 2017

Formula

T(n, k) = prime(n) mod 2*prime(k), 1<=k<=n.

A055377 a(n) = largest prime <= n/2.

Original entry on oeis.org

2, 2, 3, 3, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 19, 19, 19, 19, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 29, 29, 29, 29, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 37, 37, 37, 37, 37
Offset: 4

Views

Author

Labos Elemer, Jun 22 2000; David W. Wilson, Jun 10 2005

Keywords

Comments

Also largest prime factor of any composite <= n. E.g., a(15) = 7 since 7 is the largest prime factor of {4,6,8,9,10,12,14,15}, the composites <= 15.
Also largest prime dividing A025527(n) = n!/lcm[1,...,n]. [Comment from Ray Chandler, Apr 26 2007: Primes > n/2 don't appear as factors of A025527(n) since they appear once in n! and again in the denominator lcm[1,...,n]. Primes <= n/2 appear more times in the numerator than the denominator so they appear in the fraction.]
a(n) is the largest prime factor whose exponent in the factorization of n! is greater than 1. - Michel Marcus, Nov 11 2018

Examples

			n = 10, n! = 3628800, lcm[1,...,10] = 2520, A025527(10) = 1440 = 32*9*5 so a(7) = 5 (offset = 3).
		

Crossrefs

Programs

Formula

a(n) = Max(gpf((n+2) mod k): 1 < k < (n+2) and k not prime), with gpf=A006530 (greatest prime factor). - Reinhard Zumkeller, Mar 27 2004
Where defined, that is for n > 2, a(A000040(n)) = A000040(A079952(n)). - Peter Munn, Sep 18 2017

Extensions

More terms from James Sellers, Jul 04 2000
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, May 14 2007

A336298 Greatest prime < prime(n)/2.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 11, 13, 13, 17, 19, 19, 23, 23, 29, 29, 31, 31, 31, 37, 41, 43, 47, 47, 47, 53, 53, 53, 61, 61, 67, 67, 73, 73, 73, 79, 83, 83, 89, 89, 89, 89, 97, 97, 103, 109, 113, 113, 113, 113, 113, 113, 127, 131, 131, 131, 137, 139, 139, 139, 151, 151
Offset: 3

Views

Author

Clark Kimberling, Nov 16 2020

Keywords

Comments

The n-th prime appears A102820(n) times. - Flávio V. Fernandes, Apr 08 2021
A080191 lists the distinct terms of this sequence. - Flávio V. Fernandes, Jun 19 2021

Examples

			Prime(3)/2 = 2.5, so a(3) = 2.
		

Crossrefs

Programs

  • Mathematica
    z = 120; t = Table[NextPrime[Prime[n]/2], {n, 3, z}]; (* A039734, A079953 *)
    u = NextPrime[t, -1]  (* A336298 *)
    t - u (* A336299 *)
    Table[NextPrime[Prime[n]/2, -1], {n, 3, 80}] (* Wesley Ivan Hurt, Nov 26 2020 *)
  • PARI
    a(n) = precprime(prime(n)/2); \\ Michel Marcus, Nov 16 2020
    
  • Python
    from sympy import prime, prevprime
    def A336298(n):
        return prevprime(prime(n)//2+1) # Chai Wah Wu, Nov 26 2020

Formula

a(n) = A151799(A000040(n)/2) for n >= 3. - Wesley Ivan Hurt, Nov 26 2020

A336299 (Least prime > prime(n)/2) - (greatest prime < prime(n)/2).

Original entry on oeis.org

1, 2, 2, 2, 4, 4, 2, 4, 4, 2, 4, 4, 6, 6, 2, 2, 6, 6, 6, 4, 2, 4, 6, 6, 6, 6, 6, 6, 6, 6, 4, 4, 6, 6, 6, 4, 6, 6, 8, 8, 8, 8, 4, 4, 4, 4, 14, 14, 14, 14, 14, 14, 4, 6, 6, 6, 2, 10, 10, 10, 6, 6, 6, 6, 4, 6, 6, 6, 6, 2, 10, 10, 10, 2, 4, 2, 12, 12, 12, 12, 12
Offset: 3

Views

Author

Clark Kimberling, Nov 16 2020

Keywords

Examples

			Prime(3)/2 = 2.5, so that a(3) = 3 - 2 = 1.
Prime(4)/2 = 3.5, so that a(4) = 5 - 3 = 2.
		

Crossrefs

Programs

  • Mathematica
    z = 120; t = Table[NextPrime[Prime[n]/2], {n, 3, z}]; (* cf. A039734, A079953 *)
    u = NextPrime[t, -1]  (* A336298 *)
    t - u  (* A336299 *)
  • PARI
    a(n) = my(x=prime(n)/2); nextprime(x) - precprime(x); \\ Michel Marcus, Nov 18 2020
Showing 1-6 of 6 results.