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.

A346147 Primes p such that p*p' mod (p+p') and floor(p*p'/(p+p')) are prime, where p' is the next prime after p.

Original entry on oeis.org

5, 11, 13, 113, 139, 157, 179, 193, 313, 359, 479, 509, 691, 773, 919, 953, 1019, 1039, 1093, 1453, 1571, 1873, 2297, 2341, 2357, 2459, 2633, 3089, 3229, 3253, 3571, 4021, 4219, 4483, 4523, 4663, 4889, 4933, 4943, 5113, 5153, 5179, 5233, 5261, 5323, 5449, 5591, 5639, 6037, 6073, 6079, 6337, 6373
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jul 06 2021

Keywords

Comments

Primes prime(k) such that A212769(k) and A160830(k) are both prime.

Examples

			a(3) = 13 is a term because 13 and 17 are consecutive primes with (13*17) mod (13+17) = 11 and floor(13*17/(13+17)) = 7 are prime.
		

Crossrefs

Programs

  • Maple
    P:= select(isprime, [2,seq(i,i=3..10^5,2)]):
    f:= proc(n) local s,t;
       s:= P[n]+P[n+1];
       t:= P[n]*P[n+1];
       if isprime(t mod s) and isprime(floor(t/s)) then return P[n] fi
    end proc:
    map(f, [$1..nops(P)-1]);
  • Mathematica
    Select[Partition[Select[Range[6400], PrimeQ], 2, 1], PrimeQ[Mod[(p = First[#] * Last[#]), (s = First[#] + Last[#])]] && PrimeQ[Quotient[p, s]] &][[;; , 1]] (* Amiram Eldar, Jul 06 2021 *)
  • PARI
    list(lim)=my(v=List(),p=2,pq); forprime(q=3,nextprime(lim\1+1/2), pq=p*q; if(isprime(pq%(p+q)) && isprime(pq\(p+q)), listput(v,p)); p=q); Vec(v) \\ Charles R Greathouse IV, Jul 06 2021
    
  • Python
    from sympy import nextprime, isprime
    p, q, A346147_list = 2,3,[]
    while len(A346147_list) < 1000:
        if isprime(p*q % (p+q)) and isprime(p*q//(p+q)):
            A346147_list.append(p)
        p, q = q,nextprime(q) # Chai Wah Wu, Jul 06 2021

A350868 a(n) is the first prime p such that the next n primes are p+2*k^2 for k=1..n.

Original entry on oeis.org

2, 3, 29, 569, 6701, 64919, 1720289, 256828391, 33090566651, 248804328761, 55130906480861, 119321483551349
Offset: 0

Views

Author

J. M. Bergot and Robert Israel, Jan 20 2022

Keywords

Comments

If p = prime(m) is a prime such that the next n primes are p+2*k^2 for k=1..n, then A212769(m+k-1) = 2*p+1 for k=1..n.
a(12) > 10^15. - Martin Ehrenstein, Jan 31 2022

Examples

			a(3) = 569 because the next 3 primes after 569 are 571 = 569 + 2*1^2, 577 = 569 + 2*2^2, 587 = 569 + 2*3^2, and 569 is the first prime that works.
		

Crossrefs

Cf. A212769.

Programs

  • Maple
    P:= select(isprime, [2,seq(i,i=3..2*10^6,2)]):
    f:= proc(n) local k;
         for k from 1 do
           if P[n+k] <> P[n]+2*k^2 then return k-1 fi
         od
    end proc:
    V:= Array(0..6):
    for n from 1 to nops(P)-21 do
      v:= H(n);
      if V[v] = 0 then V[v]:= P[n] fi;
    od:
    convert(V,list);
  • Python
    from sympy import prime, nextprime
    def A350868(n):
        if n < 2:
            return 2+n
        qlist = [prime(i)-2 for i in range(2,n+2)]
        p = prime(n+1)
        mlist = [2*k**2 for k in range(1,n+1)]
        while True:
            if qlist == mlist:
                return p-mlist[-1]
            qlist = [q-qlist[0] for q in qlist[1:]]
            r = nextprime(p)
            qlist.append(r-p+qlist[-1])
            p = r # Chai Wah Wu, Jan 24 2022

Extensions

a(7) from David A. Corneth, Jan 20 2022
a(8) from Chai Wah Wu, Jan 25 2022
a(9) from Martin Ehrenstein, Jan 26 2022
a(10)-a(11) from Martin Ehrenstein, Jan 31 2022

A345366 a(n) = (p*q+1) mod (p+q) where p=prime(n) and q=prime(n+1).

Original entry on oeis.org

2, 0, 0, 6, 0, 12, 0, 18, 44, 0, 60, 36, 0, 42, 92, 104, 0, 120, 66, 0, 144, 78, 164, 78, 96, 0, 102, 0, 108, 192, 126, 260, 0, 264, 0, 300, 312, 162, 332, 344, 0, 348, 0, 192, 0, 170, 182, 222, 0, 228, 464, 0, 468, 500, 512, 524, 0, 540, 276, 0, 552, 552, 306
Offset: 1

Views

Author

Simon Strandgaard, Jun 16 2021

Keywords

Comments

The graph of this function consists of three branches: the upper one corresponds to cases where q-p == 2 (mod 4) except the twin primes, the middle one to cases where q-p == 0 (mod 4), and the lower one (where a(n)=0) to cases where q-p = 2, the twin primes.
All terms are even.

Examples

			a(1) = ( 2* 3+1) mod ( 2+ 3) =   7 mod  5 = 2,
a(2) = ( 3* 5+1) mod ( 3+ 5) =  16 mod  8 = 0,
a(3) = ( 5* 7+1) mod ( 5+ 7) =  36 mod 12 = 0,
a(4) = ( 7*11+1) mod ( 7+11) =  78 mod 18 = 6,
a(5) = (11*13+1) mod (11+13) = 144 mod 24 = 0.
		

Crossrefs

Cf. A000040, A212769, A029707 (indices of 0's).

Programs

  • Maple
    a:= n-> ((p, q)-> irem(p*q+1, p+q))(map(ithprime, [n, n+1])[]):
    seq(a(n), n=1..63);  # Alois P. Heinz, Jul 03 2021
  • Mathematica
    Mod[#1*#2 + 1, #1 + #2] & @@@ Partition[Select[Range[300], PrimeQ], 2, 1] (* Amiram Eldar, Jun 16 2021 *)
  • PARI
    a(n)=my(p=prime(n), q=nextprime(p+1)); (p*q+1)%(p+q)
    
  • Python
    from sympy import nextprime
    def aupton(nn):
        alst, p, q = [], 2, 3
        while len(alst) < nn: alst.append((p*q+1)%(p+q)); p, q = q, nextprime(q)
        return alst
    print(aupton(62)) # Michael S. Branicky, Jun 16 2021
  • Ruby
    require 'prime'
    values = []
    Prime.first(21).each_cons(2) do |a, b|
        values << (a * b + 1) % (a + b)
    end
    p values
    

Formula

a(n) = A023523(n+1) mod A001043(n). - Michel Marcus, Jun 17 2021
Showing 1-3 of 3 results.