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

A265759 Numerators of primes-only best approximates (POBAs) to 1; see Comments.

Original entry on oeis.org

3, 2, 5, 13, 11, 19, 17, 31, 29, 43, 41, 61, 59, 73, 71, 103, 101, 109, 107, 139, 137, 151, 149, 181, 179, 193, 191, 199, 197, 229, 227, 241, 239, 271, 269, 283, 281, 313, 311, 349, 347, 421, 419, 433, 431, 463, 461, 523, 521, 571, 569, 601, 599, 619, 617
Offset: 1

Views

Author

Clark Kimberling, Dec 15 2015

Keywords

Comments

Suppose that x > 0. A fraction p/q of primes is a primes-only best approximate (POBA), and we write "p/q in B(x)", if 0 < |x - p/q| < |x - u/v| for all primes u and v such that v < q. Note that for some choices of x, there are values of q for which there are two POBAs. In these cases, the greater is placed first; e.g., B(3) = (7/2, 5/2, 17/5, 13/5, 23/7, 19/7, ...).
See A265772 and A265774 for definitions of lower POBA and upper POBA. In the following guide, for example, A001359/A006512 represents (conjecturally in some cases) the Lower POBAs p(n)/q(n) to 1, where p = A001359 and q = A006512 except for first terms in some cases. Every POBA is either a lower POBA or an upper POBA.
x Lower POBA Upper POBA POBA

Examples

			The POBAs for 1 start with 3/2, 2/3, 5/7, 13/11, 11/13, 19/17, 17/19, 31/29, 29/31, 43/41, 41/43, 61/59, 59/61. For example, if p and q are primes and q > 13, then 11/13 is closer to 1 than p/q is.
		

Crossrefs

Programs

  • Mathematica
    x = 1; z = 200; p[k_] := p[k] = Prime[k];
    t = Table[Max[Table[NextPrime[x*p[k], -1]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tL = Select[d, # > 0 &] (* lower POBA *)
    t = Table[Min[Table[NextPrime[x*p[k]]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tU = Select[d, # > 0 &] (* upper POBA *)
    v = Sort[Union[tL, tU], Abs[#1 - x] > Abs[#2 - x] &];
    b = Denominator[v]; s = Select[Range[Length[b]], b[[#]] == Min[Drop[b, # - 1]] &];
    y = Table[v[[s[[n]]]], {n, 1, Length[s]}] (* POBA, A265759/A265760 *)
    Numerator[tL]   (* A001359 *)
    Denominator[tL] (* A006512 *)
    Numerator[tU]   (* A006512 *)
    Denominator[tU] (* A001359 *)
    Numerator[y]    (* A265759 *)
    Denominator[y]  (* A265760 *)

A087713 Greatest prime factor of the product of the neighbors of the n-th prime.

Original entry on oeis.org

3, 2, 3, 3, 5, 7, 3, 5, 11, 7, 5, 19, 7, 11, 23, 13, 29, 31, 17, 7, 37, 13, 41, 11, 7, 17, 17, 53, 11, 19, 7, 13, 23, 23, 37, 19, 79, 41, 83, 43, 89, 13, 19, 97, 11, 11, 53, 37, 113, 23, 29, 17, 11, 7, 43, 131, 67, 17, 139, 47, 71, 73, 17, 31, 157, 79, 83, 13, 173, 29, 59
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 28 2003

Keywords

Comments

Apparently a(n) = A024710(n) for n>4. - Georg Fischer, Oct 06 2018
Conjecture: The record values are A120628 \ {2}. - Jason Yuen, Jan 19 2025

Examples

			a(10) = A006530(prime(10)^2 - 1) = A006530(29*29-1) = A006530(840) = A006530(7*5*3*2^3) = 7.
		

Crossrefs

Programs

  • Haskell
    a087713 = a006530 . a084920  -- Reinhard Zumkeller, Aug 27 2013
    
  • Mathematica
    FactorInteger[#][[-1,1]]&/@((#-1)(#+1)&/@Prime[Range[80]]) (* Harvey P. Dale, Oct 26 2019 *)
  • PARI
    a(n) = my(p=prime(n)); vecmax(factor((p-1)*(p+1))[, 1]); \\ Michel Marcus, Jan 20 2025
    
  • Python
    from sympy import prime, primefactors
    def A087713(n): p = prime(n); return max(primefactors(p*p-1))  # Ya-Ping Lu, Mar 07 2025

Formula

a(n) = A006530((A000040(n)-1)*(A000040(n)+1)) = A006530(A006093(n)*A008864(n)) = A006530(A084920(n)).
a(n) <= (prime(n)+1)/2, n > 1. - Ya-Ping Lu, Apr 10 2025

Extensions

Definition clarified by Harvey P. Dale, Oct 26 2019

A333197 Nonprime numbers k such that each nonprime divisor of k is 1 away from a prime number.

Original entry on oeis.org

1, 4, 6, 8, 10, 12, 14, 16, 20, 22, 24, 28, 32, 38, 40, 44, 46, 48, 58, 62, 74, 80, 82, 88, 96, 106, 148, 158, 164, 166, 178, 194, 212, 226, 262, 278, 314, 316, 332, 346, 358, 382, 388, 398, 422, 458, 466, 478, 502, 524, 542, 556, 562, 586, 614, 632, 662, 674
Offset: 1

Views

Author

Michel Lagneau, Mar 11 2020

Keywords

Comments

Let {d(i), i = 1..q} be the set of the q nonprime divisors of a number m. The sequence lists the nonprime numbers such that |d(i) - p(i)| = 1 for all i, where p(i) is prime.
Conjecture: except for a(n) = 4, 8, 16 and 32, a(n) is of the form 2^i*p^j with p = 3, 5, 7, 11, 19, 23, 29, 31, ... ({A120628} minus {2}).
Consequence: 2 * A120628(k) is in the sequence for k >= 1.
Note that all nonprime divisors of a term of the sequence must be 1 or even. Thus a term of the sequence can have at most one odd prime divisor, i.e., it is a power of 2 or 2^i*p where p is an odd prime. In the latter case, since 2*p is a nonprime divisor, p must be in A120628. - Robert Israel, Apr 12 2020

Examples

			48 is in the sequence because the nonprime divisors of 48 are {1, 4, 6, 8, 12, 16, 24, 48} and:
|1 - 2| = 1,
|4 - 5| = 1 (or |4 - 3| = 1),
|6 - 7| = 1 (or |6 - 5| = 1),
|8 - 7| = 1,
|12 - 13| = 1 (or |12 - 11| = 1),
|16 - 17| = 1,
|24 - 23| = 1,
|48 - 47| = 1.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for n from 1 to 50 do:
    if type(n,prime)=false
      then
    d:=divisors(n):n0:=nops(d):it:=0:
      for k from 1 to n0 do :
       if nextprime(d[k])- d[k]= 1
          or
          d[k] - prevprime(d[k])= 1
          or
          isprime(d[k])
           then
           it:=it+1:
           eles
        fi:
       od:
       if it=n0
       then
       printf(`%d, `,n):
         else fi:
      fi:
    od:
    # Alternative:
    N:= 1000: # for terms <= N
    P,NP:= selectremove(isprime, [$1..N]):
    P:= convert(P,set):
    P1:= P union map(`+`,P,1) union map(`-`,P,1):
    filter:= proc(n) numtheory:-divisors(n) subset P1 end proc:
    select(filter, NP); # Robert Israel, Apr 12 2020
  • Mathematica
    seqQ[n_] := !PrimeQ[n] &&  AllTrue[Divisors[n], AnyTrue[# + {-1,0,1}, PrimeQ] &]; Select[Range[700], seqQ] (* Amiram Eldar, Mar 11 2020 *)
  • PARI
    isok(m) = !isprime(m) && (sumdiv(m, d, !isprime(d) && (isprime(d+1) || ((d>1) && isprime(d-1)))) == sumdiv(m, d, !isprime(d))); \\ Michel Marcus, Mar 11 2020

A334026 Primes p such that 2*p and 4*p are 1 away from a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 37, 41, 53, 79, 83, 97, 131, 139, 173, 199, 281, 293, 307, 431, 499, 577, 593, 619, 683, 727, 743, 911, 997, 1013, 1297, 1429, 1481, 1511, 1811, 1901, 1931, 2003, 2029, 2141, 2273, 2351, 2693, 3037, 3067, 3109, 3491, 3499, 3739, 3769, 3863, 3911, 4211, 4373, 4447, 4481, 4567, 4871
Offset: 1

Views

Author

Robert Israel, Apr 12 2020

Keywords

Comments

Primes p such that at least one of 2*p-1 and 2*p+1 is prime, and at least one of 4*p-1 and 4*p+1 is prime.
Primes p such that either 2*p-1 and 4*p+1 are prime, or 2*p+1 and 4*p-1 are prime.
Primes p such that 4*p is in A333197.

Examples

			a(3) = 5 is a member because 5, 2*5+1=11 and 4*5-1=19 are primes.
		

Crossrefs

Programs

  • Maple
    filter:= proc(t) isprime(t) and (isprime(2*t+1) or isprime(2*t-1)) and (isprime(4*t+1) or isprime(4*t-1)) end proc:
    select(filter, [2,seq(i,i=3..10000,2)]);
  • Mathematica
    Select[Prime[Range[700]],AnyTrue[2#+{1,-1},PrimeQ]&&AnyTrue[4#+{1,-1},PrimeQ] &] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 17 2021 *)

A276983 Semiprimes n such that n-1 or n+1 is prime.

Original entry on oeis.org

4, 6, 10, 14, 22, 38, 46, 58, 62, 74, 82, 106, 158, 166, 178, 194, 226, 262, 278, 314, 346, 358, 382, 398, 422, 458, 466, 478, 502, 542, 562, 586, 614, 662, 674, 718, 734, 758, 838, 862, 878, 886, 982, 998, 1018, 1094, 1154, 1186, 1202, 1214, 1238, 1282, 1306, 1318, 1322
Offset: 1

Views

Author

Gary E. Davis, Sep 24 2016

Keywords

Comments

Union of A077065 and A077068.

Examples

			a(3) = 10 = 2*5 is a product of 2 primes and 10+1 = 11 is prime.
a(4) = 14 = 2*7 is a product of 2 primes and 14-1 = 13 is prime.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(t/2) and (isprime(t-1) or isprime(t+1)), [seq(i,i=2..10000,2)]); # Robert Israel, Sep 30 2016
  • Mathematica
    func[n_] := PrimeOmega[n] == 2 && (PrimeQ[n + 1] || PrimeQ[n - 1])
    Select[Range[1000], func[#] &]
  • PARI
    isok(n) = (bigomega(n)==2) && (isprime(n-1) || isprime(n+1)); \\ Michel Marcus, Sep 24 2016
    
  • PARI
    lista(nn) = forprime(p=2, nn, if(isprime(2*p+1) || isprime(2*p-1), print1(2*p, ", "))); \\ Altug Alkan, Sep 30 2016
    
  • Python
    from sympy import isprime, primerange
    def aupto(N): return [t for t in (2*p for p in primerange(2, N//2+1)) if isprime(t-1) or isprime(t+1)]
    print(aupto(1322)) # Michael S. Branicky, Aug 21 2022

Formula

a(n) = 2*A120628(n).
Showing 1-5 of 5 results.