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.

Previous Showing 11-20 of 20 results.

A238881 Number of odd primes p < 2*n with prime(n*(p+1)/2) + n*(p+1)/2 prime.

Original entry on oeis.org

0, 1, 1, 0, 0, 2, 1, 3, 1, 2, 2, 5, 2, 3, 2, 4, 3, 5, 2, 3, 2, 4, 1, 8, 4, 4, 4, 3, 2, 5, 2, 4, 4, 4, 4, 8, 2, 4, 2, 5, 4, 6, 3, 2, 6, 6, 3, 11, 6, 10, 4, 8, 2, 11, 4, 7, 4, 7, 2, 12, 4, 6, 2, 6, 3, 8, 3, 5, 8, 12, 6, 12, 4, 15, 8, 11, 5, 12, 2, 11
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 06 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 5, and a(n) = 1 only for n = 2, 3, 7, 9, 23. Moreover, for any r = 1,-1 and n > 5*(2+r) there is a positive integer k < n such that 2*k+r and prime(k*n)+k*n are both prime.
(ii) If n > 1 is not equal to 13, then prime(k*n) - k*n is prime for some k = 1, ..., n.
This conjecture implies that there are infinitely many positive integers m with prime(m) + m (or prime(m) - m) prime.

Examples

			a(7) = 1 since 11 and prime(7*(11+1)/2) + 7*(11+1)/2 = prime(42) + 42 = 181 + 42 = 223 are both prime.
a(23) = 1 since 7 and prime(23*(7+1)/2) + 23*(7+1)/2 = prime(92) + 92 = 479 + 92 = 571 are both prime.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28--Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169--187. (See Conjecture 3.21(i) and note that the typo 2k+1 there should be 2k-1.)

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=PrimeQ[Prime[n]+n]
    p[k_,n_]:=PQ[(Prime[k]+1)/2*n]
    a[n_]:=Sum[If[p[k,n],1,0],{k,2,PrimePi[2n-1]}]
    Table[a[n],{n,1,80}]
  • PARI
    a(n) = {my(nb = 0); forprime(p=3, 2*n, if (isprime(prime(n*(p+1)/2) + n*(p+1)/2), nb++);); nb;} \\ Michel Marcus, Sep 21 2015

A231326 Primes p such that p - 2*k is also prime, where p is k-th prime.

Original entry on oeis.org

17, 19, 23, 37, 47, 67, 71, 73, 83, 89, 97, 113, 131, 137, 139, 149, 151, 157, 167, 179, 181, 197, 199, 223, 233, 263, 307, 331, 353, 379, 397, 419, 421, 439, 443, 457, 461, 463, 503, 557, 587, 613, 631, 641, 643, 659, 661, 677, 701, 719, 743, 761, 773, 839, 863
Offset: 1

Views

Author

K. D. Bajpai, Nov 07 2013

Keywords

Examples

			a(2)= 19 which is 8th prime. prime(8)-2*8= 19-16= 3 which is also prime.
a(6)= 67 which is 19th prime. prime(19)-2*19= 67-38= 29 which is also prime.
		

Crossrefs

Cf. A061068 (primes: prime(m) plus its subscript).
Cf. A064402 (numbers n: prime(n)+n is prime).
Cf. A227420 (primes: p - pi(p) is also prime).
Cf. A231232 (primes: prime(k)+2*k is also prime).

Programs

  • Maple
    KD := proc() local a,b; a:= ithprime(n); b := a-2*n; if isprime(b) then RETURN (a); fi;end: seq(KD(),n=1..500);
  • Mathematica
    TK = Select[Table[{Prime[n], Prime[n] - 2*n}, {n, 200}], PrimeQ[#[[2]]] &]; Transpose[TK][[1]]

A231506 Primes p such that p + 3*k and p - 3*k, both are primes, where p is k-th prime.

Original entry on oeis.org

7, 13, 19, 53, 71, 101, 107, 139, 173, 199, 223, 229, 281, 293, 397, 463, 557, 569, 673, 787, 809, 839, 953, 1013, 1283, 1451, 1559, 1657, 1861, 1871, 1877, 1949, 1987, 1997, 2213, 2311, 2347, 2357, 2377, 2503, 2543, 2551, 2593, 2633, 2837, 2851, 2939, 2999, 3041
Offset: 1

Views

Author

K. D. Bajpai, Nov 09 2013

Keywords

Examples

			a(7)= 107 which is 28th prime. prime(28)-3*28= 107-84= 23: prime(28)+3*28= 107+84= 191: 23 and 191 both are primes.
a(9)= 173 which is 40th prime. prime(40)-3*40= 173-120= 53: prime(40)+3*40= 173+120= 293: 53 and 293 both are primes.
		

Crossrefs

Cf. A061068 (primes: prime(m) plus its subscript).
Cf. A064402 (numbers n: prime(n)+n is prime).
Cf. A231232 (primes p : p+2*k is also primes).
Cf. A231383 (primes p : p+3*k is also primes).

Programs

  • Maple
    KD := proc() local a,b,d;  a:= ithprime(n); b:= abs(a-3*n);d:=(a+3*n); if isprime(b) and  isprime(d) then RETURN (a); fi; end: seq(KD(), n=1..500);

A233539 a(n) = |{0 < k < n-2: m - 1, m + 1, prime(m) - m and prime(m) + m are all prime with m = phi(k) + phi(n-k)/2}|, where phi(.) is Euler's totient function.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 2, 4, 2, 4, 4, 2, 4, 3, 5, 1, 4, 2, 3, 1, 2, 2, 2, 1, 1, 0, 0, 1, 4, 0, 1, 2, 0, 5, 2, 4, 4, 1, 3, 3, 3, 2, 3, 8, 2, 2, 3, 5, 5, 4, 3, 5, 3, 4, 3, 1, 3, 8, 4, 5, 4, 2, 6, 0, 12, 2, 4, 1, 5, 0, 4, 1, 4, 3, 3, 2, 5, 4, 7, 5, 3, 11, 1, 5, 4, 3, 4, 6, 2, 2, 5, 5, 6, 4, 4
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 13 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 794.
(ii) For any integer n > 59, there is a positive integer k < n such that m = phi(k) + phi(n-k)/4 is an integer with prime(m) - m and prime(m) + m both prime.
Clearly, part (i) of the conjecture implies that there are infinitely many positive integers m with m - 1, m + 1, prime(m) - m and prime(m) + m all prime.

Examples

			a(21) = 1 since phi(6) + phi(15)/2 = 6 with 6 - 1 = 5, 6 + 1 = 7, prime(6) - 6 = 7 and prime(6) + 6 = 19 all prime.
a(25) = 1 since phi(17) + phi(8)/2 = 18 with 18 - 1 = 17, 18 + 1 = 19, prime(18) - 18 = 43 and prime(18) + 18 = 79 all prime.
		

Crossrefs

Programs

  • Mathematica
    q[n_]:=PrimeQ[n-1]&&PrimeQ[n+1]&&PrimeQ[Prime[n]-n]&&PrimeQ[Prime[n]+n]
    f[n_,k_]:=EulerPhi[k]+EulerPhi[n-k]/2
    a[n_]:=Sum[If[q[f[n,k]],1,0],{k,1,n-3}]
    Table[a[n],{n,1,100}]

A231432 Primes p such that abs(p - 3*k) is also prime, where p is the k-th prime.

Original entry on oeis.org

3, 7, 13, 19, 31, 41, 47, 53, 61, 71, 79, 89, 101, 107, 113, 139, 151, 173, 193, 199, 223, 229, 239, 251, 271, 281, 293, 349, 373, 397, 433, 457, 463, 521, 541, 557, 569, 593, 601, 613, 619, 641, 647, 673, 683, 743, 787, 809, 839, 911, 941, 953, 971, 1013, 1049
Offset: 1

Views

Author

K. D. Bajpai, Nov 09 2013

Keywords

Examples

			The first prime, 2, is not a term since |2-3*1| = 1.
The second prime, 3, is a term, since |3-2*3| = 3 is a prime.
a(11) = 79 which is the 22nd prime, prime(22)-3*22 = 79-66 = 13 which is also prime.
a(15) = 113 which is the 30th prime, prime(30)-3*30 = 113-90 = 23 which is also prime.
		

Crossrefs

Cf. A061068 (primes: prime(m) plus its subscript).
Cf. A064402 (numbers n: prime(n)+n is prime).
Cf. A231232 (primes p : p+2*k is also prime).
Cf. A231383 (primes p : p+3*k is also prime).

Programs

  • Maple
    KD := proc() local a, b;  a:= ithprime(n); b:= abs(a-3*n); if isprime(b) then RETURN (a); fi; end: seq(KD(), n=1..500);
  • Mathematica
    KD = Select[Table[{Prime[n], Prime[n] - 3*n}, {n, 200}], PrimeQ[#[[2]]] &]; Transpose[KD][[1]]
    Select[Table[{k,Prime[k]},{k,200}],PrimeQ[Abs[#[[2]]-3#[[1]]]]&][[;;,2]] (* Harvey P. Dale, Jul 14 2024 *)
  • PARI
    k=0;forprime(p=2,1e3,if(isprime(abs(p-k++*3)), print1(p", "))) \\ Charles R Greathouse IV, Mar 11 2014

A254867 Numbers n such that prime(n) + n and prime(n) + n^2 are prime.

Original entry on oeis.org

1, 2, 4, 22, 66, 96, 106, 144, 180, 222, 324, 378, 466, 492, 604, 742, 760, 778, 784, 960, 984, 990, 994, 1050, 1150, 1162, 1186, 1248, 1302, 1308, 1356, 1360, 1380, 1744, 1830, 1866, 1870, 1956, 2052, 2070, 2112, 2182, 2212, 2380, 2470, 2556, 2586, 2638, 2676, 2760, 2766
Offset: 1

Views

Author

Zak Seidov, Feb 09 2015

Keywords

Examples

			a(4) = 22 = A064402(6): prime(22) = 79, 79 + {22, 22^2} = {101, 563} both prime.
		

Crossrefs

Subsequence of A064402. Cf. A000040, A014688, A061067, A061068.

Programs

  • Maple
    A254867:=n->`if`(isprime(ithprime(n)+n) and isprime(ithprime(n)+n^2), n, NULL): seq(A254867(n), n=1..10^4); # Wesley Ivan Hurt, Jan 16 2017
  • Mathematica
    Select[Range[1000], PrimeQ[Prime[#] + #] && PrimeQ[Prime[#] + #^2] &] (* Alonso del Arte, Feb 09 2015 *)
    Select[Range[3000],AllTrue[Prime[#]+{#,#^2},PrimeQ]&] (* Harvey P. Dale, Jan 17 2023 *)

A261832 Numbers n such that prime(n)^3 + n is prime.

Original entry on oeis.org

2, 4, 6, 24, 32, 34, 36, 84, 86, 88, 112, 172, 182, 200, 212, 240, 258, 290, 306, 320, 336, 360, 366, 396, 404, 406, 434, 480, 494, 504, 528, 536, 556, 558, 580, 612, 636, 718, 722, 732, 794, 906, 960, 966, 992, 994, 1008, 1020, 1116, 1132, 1176, 1184, 1186, 1212
Offset: 1

Views

Author

K. D. Bajpai, Sep 02 2015

Keywords

Examples

			6 is in the list because prime(6)^3 + 6 = 13^3 + 6 = 2197 + 6 = 2203, which is prime.
24 is in the list because prime (24)^3 + 24 = 89^3 + 24 = 704969 + 24 = 704993, which is prime.
		

Crossrefs

Programs

  • Magma
    [n : n in [1..2000] | IsPrime(NthPrime(n)^3 +n)];
  • Maple
    select(n -> isprime(ithprime(n)^3 + n), [seq(n,n=1..2000)]);
  • Mathematica
    Select[Range[2000], PrimeQ[Prime[#]^3 + #] &]
  • PARI
    for(n = 1,2000, if(isprime(prime(n)^3 + n), print1(n,", ")));
    

A381792 Numbers k such that k + prime(k) is prime and k + semiprime(k) is semiprime.

Original entry on oeis.org

4, 6, 18, 24, 34, 72, 96, 98, 116, 130, 150, 172, 200, 206, 270, 290, 350, 356, 362, 386, 410, 420, 450, 504, 508, 554, 576, 618, 666, 682, 720, 738, 754, 782, 784, 808, 820, 832, 858, 892, 960, 962, 984, 1016, 1050, 1102, 1110, 1154, 1162, 1168, 1176, 1184, 1206, 1256, 1284, 1296, 1302, 1360
Offset: 1

Views

Author

Zak Seidov and Robert Israel, Mar 07 2025

Keywords

Comments

All terms are even.

Examples

			a(3) = 18 is a term because the 18-th prime and 18-th semiprime are 61 and 51 respectively, 18 + 61 = 79 is prime and 18 + 51 = 69 = 3 * 23 is semiprime.
		

Crossrefs

Intersection of A064402 and A100915.

Programs

  • Maple
    N:= 100: # for a(1) .. a(N)
    with(priqueue):
    initialize(pq);
    insert([-4,2,2],pq);
    p:= 1:
    R:= NULL: count:= 0:
    for n from 1 while count < N do
      p:= nextprime(p);
      t:= extract(pq);
      if n::even and isprime(n + p) and numtheory:-bigomega(n - t[1])=2 then R:= R, n; count:= count+1 fi;
      q:= nextprime(t[3]);
      if t[2] = t[3] then insert([-q^2,q,q],pq) fi;
      insert([-t[2]*q,t[2],q],pq);
    od:
    R;
  • Mathematica
    lim=1360;i=1;Do[Until[PrimeOmega[i]==2,i++];Sp[n]=i,{n,lim}];Select[Range[lim],PrimeQ[#+Prime[#]]&&PrimeOmega[#+Sp[#]]==2&] (* James C. McMahon, Mar 09 2025 *)

Formula

A001222(a(n) + A000040(a(n))) = 1 and A001222(a(n) + A001358(a(n))) = 2.

A187766 Even numbers k such that prime(k) -+ k are both composite.

Original entry on oeis.org

12, 20, 36, 38, 40, 46, 52, 56, 58, 60, 62, 64, 74, 78, 80, 86, 88, 112, 118, 120, 122, 124, 128, 132, 134, 136, 138, 140, 142, 146, 156, 160, 162, 164, 166, 170, 176, 182, 184, 186, 188, 190, 194, 198, 208, 210, 212, 216
Offset: 1

Views

Author

Zak Seidov, Jan 04 2013

Keywords

Comments

Even numbers not in A064269 and not in A064402.
Interestingly, prime(12) = 37 and both 37 - 12 = 25 and 37 + 12 = 49 are squares. Is there another such n?

Crossrefs

Programs

  • Mathematica
    Select[2*Range[200],!PrimeQ[Prime[#]+#]&&!PrimeQ[Prime[#]-#]&] (* Harvey P. Dale, Dec 24 2013 *)
  • PARI
    {forstep(i=2,220,2,p=prime(i);if(!isprime(p-i)&&!isprime(p+i),print1(i", ")))}

A381630 a(n) is the least k such that the sum of k and the k-th number with n prime factors (counted with multiplicity) has n prime factors (counted with multiplicity).

Original entry on oeis.org

1, 4, 8, 14, 16, 16, 96, 80, 304, 448, 640, 1984, 544, 2048, 3584, 20480, 9216, 49152, 65536, 524288, 1245184, 3309568, 204800, 1179648, 28311552, 2426880, 29360128, 6291456, 27787264, 125829120, 67108864, 327155712, 1073741824
Offset: 1

Views

Author

Robert Israel, Mar 07 2025

Keywords

Examples

			a(3) = 8 because the 8th number with 3 prime factors (the 8th triprime) is 42 = 2*3*7, 8 + 42 = 50 = 2 * 5^2 also has 3 prime factors, and 8 is the smallest number that works.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) uses priqueue; local pq,k,t,i,q;
        initialize(pq);
        insert([-2^n,2$n],pq);
        for k from 1 do
           t:= extract(pq);
           if numtheory:-bigomega(k-t[1])=n then return k fi;
           q:= nextprime(t[-1]);
           for i from 1 to n while t[-i] = t[-1] do
             insert([t[1]*(q/t[-1])^i,op(t[2..n+1-i]),q$i],pq);
           od
        od
    end proc:
    map(f, [$1..30]); # Robert Israel, Mar 07 2025

Extensions

a(32) from Jinyuan Wang, Mar 09 2025
a(33) from Jinyuan Wang, Mar 21 2025
Previous Showing 11-20 of 20 results.