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-10 of 29 results. Next

A086153 Special prime numbers arranged in a triangle: n-th row contains m primes p (where m = pi(2n + A020483(n)) - pi(A020483(n))) with following properties.

Original entry on oeis.org

3, 7, 3, 23, 5, 89, 23, 3, 139, 19, 7, 3, 199, 47, 17, 5, 113, 83, 23, 17, 3, 1831, 211, 43, 13, 7, 3, 523, 109, 79, 19, 11, 5, 887, 317, 107, 47, 17, 11, 3, 1129, 619, 109, 79, 19, 7, 1669, 199, 113, 73, 43, 13, 5, 2477, 1373, 197, 113, 71, 41, 11, 3, 2971, 1123, 199, 109
Offset: 1

Views

Author

Labos Elemer, Aug 08 2003

Keywords

Comments

1: q = p + 2n is also a prime, although not necessarily the next after p;
2: the k-th position of the n-th row gives is a prime p such that the number of further primes between p and q = p + 2n (not counting p and q) is k-1;
3: the primes p are the smallest with these properties.
Thus each row only contains primes. The first term in the n-th row is A000230(n). The last one in the same row is A020483(n). The length of the n-th row is pi(2n + A020483(n)) - pi(A020483(n)).
From Martin Raab, Aug 29 2021: (Start)
T(n,k) is zero if there is no admissible pattern with k+1 primes for the interval of length 2n under the given properties.
T(38,16) > 2^48. It requires a pattern of 17 primes with a difference of 76 between the first and the last prime. Admissible patterns of this kind exist, but solutions with 17 primes are rather hard to find. (End)
The next unknown values are T(43,19) and T(44,19), which require intervals of 20 primes with a diameter of 86 and 88, respectively. - Brian Kehrig, Jun 25 2024

Examples

			The table begins as follows:
    3;
    7,  3;
   23,  5;
   89, 23,  3;
  139, 19,  7,  3;
  199, 47, 17,  5;
  113, 83, 23, 17,  3;
  ...
For example, suppose n = 50: d = 2n = 100; the 50th row consists of 25 terms as follows: {396733, 58789, 142993, 38461, 37699, 7351, 5881, 1327, 2557, 1879, 1621, 1117, 463, 457, 283, 331, 211, 127, 73, 67, 31, ?, ?, 7, 3};
A000230(50)=396733, A020483(50)=3; between 143093 and 142993 two primes {143053,143063} occur because 142993 is the 3rd (from 2+1) entry in the 50th row.
The length of 50th row is pi(100+3) - pi(3) = pi(103) - pi(3) = 27 - 2 = 25, number of primes between 103 and 3 is 24 (not counting 103 and 3).
		

Crossrefs

Programs

  • Mathematica
    (* Program to generate the 19th row *) cp[x_, y_] := Count[Table[PrimeQ[i], {i, x, y}], True] {d=38, k=0, mxc=Ceiling[d/3]; vg=PrimePi[30593]} t=Table[0, {mxc}]; t1=Table[0, {mxc}]; Do[s=cp[1+Prime[n], Prime[n]+d-1]; np=d+Prime[n]; If[PrimeQ[np]&&s<(1+mxc)&&t[[s+1]]==0, t[[s+1]]=n; t1[[s+1]]=Prime[n]], {n, 1, 5000}]; {t, t1}
  • PARI
    {z=concat(vector(13),binary(8683781)); for(n=1, 37, p1=3; while(!isprime(p1+2*n), p1=nextprime(p1+2)); p2=p1+2*n; k=primepi(p2)-primepi(p1); r=vector(k); r[k]=p1; i1=1; i2=0; s=vecsort(r); while(s[1+z[n]]==0, while(i1*i2==0, p1+=2; p2+=2; i2=isprime(p2); k=k-i1+i2; i1=isprime(p1)); if(!r[k], r[k]=p1; s=vecsort(r)); i2=0); print("row "n": "r))} \\ Martin Raab, Oct 21 2021

A086155 a(n) is the number of primes between the primes p = A020483(n) and q = 2n + A020483(n).

Original entry on oeis.org

0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 5, 6, 7, 8, 7, 8, 9, 9, 10, 11, 11, 12, 11, 12, 13, 12, 13, 14, 15, 14, 15, 16, 16, 17, 18, 17, 18, 19, 19, 20, 19, 20, 21, 19, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 23, 24, 25, 25, 26, 27, 28, 28, 29, 28, 29, 30, 31, 29, 30, 30, 31, 32, 33, 32
Offset: 1

Views

Author

Labos Elemer, Aug 08 2003

Keywords

Comments

a(n) + 1 = 1 + A086154(n) provides the length of the n-th row arising in table of A086153; a(n) <= n/2 holds if n > 22.

Examples

			n=50: d=2n=100, p=A020483(50)=3 because by definition, 3 is
the least prime so that p and p+100=103 are both primes;
a(50) here corresponds to the number of primes between
{p,p+100} = {3,103} not counting borders of interval;
thus a(50)=24, size of {5,7,...,97,101}.
		

Crossrefs

Programs

  • Mathematica
    Table[fl=1; Do[s0=Prime[k]; s=2*n+Prime[k]; If[PrimeQ[s]&&Equal[fl,1], Print[PrimePi[s]-k-1]; fl=0],{k,1,200}],{n,1,25}]

Formula

a(n) = Pi(A020483(n)) - Pi(2n + A020483(n)) - 1.

A007921 Numbers that are not the difference of two primes.

Original entry on oeis.org

7, 13, 19, 23, 25, 31, 33, 37, 43, 47, 49, 53, 55, 61, 63, 67, 73, 75, 79, 83, 85, 89, 91, 93, 97, 103, 109, 113, 115, 117, 119, 121, 123, 127, 131, 133, 139, 141, 143, 145, 151, 153, 157, 159, 163, 167, 169, 173, 175, 181, 183, 185, 187, 193
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Conjecturally, odd numbers k such that k+2 is composite.
Is this the same as A068780(2n-1) - 1? - J. Stauduhar, Aug 23 2012
A092953(a(n)) = 0. - Reinhard Zumkeller, Nov 10 2012
It seems that the sequence contains the squares of all primes except for 2 and 3. - Ivan N. Ianakiev, Aug 29 2013 [It does: For every prime p > 3, note that p^2 == 1 (mod 3), so p^2 cannot be q - r where q and r are primes. (If it were, then since p^2 is odd, q and r could not both be odd primes; r would have to be the even prime, 2, which would mean that p^2 = q - 2, so q = p^2 + 2 == 0 (mod 3), i.e., 3 would divide q, so q would not be prime -- a contradiction.) - Jon E. Schoenfield, May 03 2024]
Integers d such that A123556(d) = 1, that is, integers d such that the largest possible arithmetic progression (AP) of primes with common difference d has only one element. For each such d, the unique element of all the first largest APs with 1 element is A342309(d) = 2. - Bernard Schott, Jan 08 2023
If it exists, the least even term is > 10^12 (see 1st comment in A020483). - Bernard Schott, Jan 09 2023

References

  • F. Smarandache, Properties of Numbers, 1972. (See Smarandache odd sieve.)

Crossrefs

Cf. A048859.
Complement of A030173. Cf. A001223.
Cf. also A005408, A010051.
Largest AP of prime numbers with k elements: this sequence (k=1), A359408 (k=2), A206037 (k=3), A359409 (k=4), A206039 (k=5), A359410 (k=6), A206041 (k=7), A206042 (k=8), A206043 (k=9), A206044 (k=10), A206045 (k=11).

Programs

  • Haskell
    a007921 n = a007921_list !! (n-1)
    a007921_list = filter ((== 0) . a010051' . (+ 2)) [1, 3 ..]
    -- Reinhard Zumkeller, Jul 03 2015
    
  • Maple
    filter :=  d -> irem(d, 2) <> 0 and not isprime(2+d) : select(filter, [`$`(1 .. 200)]); # Bernard Schott, Jan 08 2023
  • Mathematica
    Lim=200;nn=10;seq:=Complement[Range[Lim],Union[Flatten[Differences/@Subsets[Prime[Range[nn]],{2}]]]];Until[AllTrue[seq,OddQ],nn++];seq (* James C. McMahon, May 04 2024 *)
  • PARI
    is(n)=n%2 && !isprime(n+2) \\ On Polignac's conjecture; Charles R Greathouse IV, Jun 28 2013
    
  • Python
    from sympy import isprime
    print([n for n in range(1, 200) if n%2 and not isprime(n + 2)]) # Indranil Ghosh, Jun 15 2017, after Charles R Greathouse IV

A073703 Smallest prime p such that also p+prime(n)*2 is a prime.

Original entry on oeis.org

3, 5, 3, 3, 7, 3, 3, 3, 7, 3, 5, 5, 7, 3, 3, 3, 13, 5, 3, 7, 3, 5, 7, 3, 3, 31, 5, 13, 5, 3, 3, 7, 3, 3, 13, 5, 3, 5, 3, 3, 31, 5, 7, 3, 3, 3, 11, 3, 3, 3, 13, 13, 5, 7, 7, 31, 3, 5, 3, 7, 3, 7, 3, 19, 5, 7, 11, 3, 7, 3, 3, 43, 5, 5, 3, 3, 19, 3, 7, 3, 19, 11, 19, 11, 3, 43, 13, 5, 7, 3, 3, 13, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 04 2002

Keywords

Comments

If Polignac's conjecture (1849) is correct, the sequence is defined for all n (as is A020483).
Also: least k-prime(n) such that k-prime(n) and k+prime(n) are both primes. - Pierre CAMI, Aug 27 2004

Examples

			n=5: prime(5)=11; 2+11*2=24, 3+11*2=25 and 5+11*2=27 are not prime, but 7+11*2=29 is prime, therefore a(5)=7.
		

Crossrefs

Programs

  • Haskell
    a073703 n = head [p | p <- a000040_list, a010051 (p + 2 * a000040 n) == 1]
    -- Reinhard Zumkeller, Oct 29 2013
  • Mathematica
    f[n_] := Block[{k = Prime[n], p = Prime[n]}, While[ !PrimeQ[k - p] || !PrimeQ[k + p], k++ ]; k - p]; Table[ f[n], {n, 95}] (* Robert G. Wilson v, Aug 28 2004 *)
  • PARI
    forprime(q=2,500,forprime(p=2,default(primelimit),if(isprime(2*q+p),print1(p", ");next(2)));error("Not enough precomputed primes")) \\ Charles R Greathouse IV, Aug 21 2011
    

Extensions

Merged with Pierre CAMI's submission of Aug 2004 - R. J. Mathar, Jul 29 2008

A106564 Perfect squares which are not the difference of two primes.

Original entry on oeis.org

25, 49, 121, 169, 289, 361, 529, 625, 729, 841, 961, 1225, 1369, 1681, 1849, 2209, 2401, 2601, 2809, 3025, 3481, 3721, 3969, 4225, 4489, 4761, 5041, 5329, 5625, 5929, 6241, 6889, 7225, 7569, 7921, 8281, 8649, 9025, 9409, 10201, 10609, 11449, 11881
Offset: 1

Views

Author

Alexandre Wajnberg, May 09 2005

Keywords

Comments

Squares in A269345; see also the Mathematica code. - Waldemar Puszkarz, Feb 27 2016
It is conjectured (see A020483) that every even number is a difference of primes, and this is known to be true for even numbers < 10^11. If so,this sequence consists of the odd squares n such that n+2 is composite. - Robert Israel, Feb 28 2016

Examples

			a(2)=49 because it is the second perfect square which is impossible to obtain subtracting a prime from another one.
64 is not in the sequence because 64=67-3 (difference of two primes).
		

Crossrefs

Programs

  • Magma
    [n^2: n in [1..150]| not IsPrime(n^2+2) and n mod 2 eq 1]; // Vincenzo Librandi, Feb 28 2016
  • Maple
    remove(t -> isprime(t+2), [seq(i^2, i=1..1000, 2)]); # Robert Israel, Feb 28 2016
  • Mathematica
    With[{lst=Union[(#[[2]]-#[[1]])&/@Subsets[Prime[Range[2000]], {2}]]}, Select[Range[140]^2, !MemberQ[lst,#]&]] (* Harvey P. Dale, Jan 04 2011 *)
    Select[Range[1,174,2]^2, !PrimeQ[#+2]&]
    Select[Select[Range[30000], OddQ[#]&& !PrimeQ[#]&& !PrimeQ[#+2]&], IntegerQ[Sqrt[#]]&] (* Waldemar Puszkarz, Feb 27 2016 *)
  • PARI
    for(n=1, 174, n%2==1&&!isprime(n^2+2)&&print1(n^2, ", ")) \\ Waldemar Puszkarz, Feb 27 2016
    

Formula

n^2 - A106546 with 0's removed.

Extensions

Extended by Ray Chandler, May 12 2005

A087711 a(n) = smallest number k such that both k-n and k+n are primes.

Original entry on oeis.org

2, 4, 5, 8, 7, 8, 11, 10, 11, 14, 13, 18, 17, 16, 17, 22, 21, 20, 23, 22, 23, 26, 25, 30, 29, 28, 33, 32, 31, 32, 37, 36, 35, 38, 37, 38, 43, 42, 41, 44, 43, 48, 47, 46, 57, 52, 51, 50, 53, 52, 53, 56, 55, 56, 59, 58, 75, 70, 69, 72, 67, 66, 65, 68, 67, 72, 71, 70, 71, 80, 81, 78
Offset: 0

Views

Author

Zak Seidov, Sep 28 2003

Keywords

Comments

Let b(n), c(n) and d(n) be respectively, smallest number m such that phi(m-n) + sigma(m+n) = 2n, smallest number m such that phi(m+n) + sigma(m-n) = 2n and smallest number m such that phi(m-n) + sigma(m+n) = phi(m+n) + sigma(m-n), we conjecture that for each positive integer n, a(n)=b(n)=c(n)=d(n). Namely we conjecture that for each positive integer n, a(n) < A244446(n), a(n) < A244447(n) and a(n) < A244448(n). - Jahangeer Kholdi and Farideh Firoozbakht, Sep 05 2014

Examples

			n=10: k=13 because 13-10 and 13+10 are both prime and 13 is the smallest k such that k +/- 10 are both prime
4-1=3, prime, 4+1=5, prime; 5-2=3, 5+2=7; 8-3=5, 8+3=11; 9-4=5, 9+4=13, ...
		

Crossrefs

Programs

  • Magma
    distance:=function(n); k:=n+2; while not IsPrime(k-n) or not IsPrime(k+n) do k:=k+1; end while; return k; end function; [ distance(n): n in [1..71] ]; /* Klaus Brockhaus, Apr 08 2007 */
    
  • Maple
    Primes:= select(isprime,{seq(2*i+1,i=1..10^3)}):
    a[0]:= 2:
    for n from 1 do
      Q:= Primes intersect map(t -> t-2*n,Primes);
      if nops(Q) = 0 then break fi;
      a[n]:= min(Q) + n;
    od:
    seq(a[i],i=0..n-1); # Robert Israel, Sep 08 2014
  • Mathematica
    s = ""; k = 0; For[i = 3, i < 22^2, If[PrimeQ[i - k] && PrimeQ[i + k], s = s <> ToString[i] <> ","; k++ ]; i++ ]; Print[s] (* Vladimir Joseph Stephan Orlovsky, Apr 03 2008 *)
    snk[n_]:=Module[{k=n+1},While[!PrimeQ[k+n]||!PrimeQ[k-n],k++];k]; Array[ snk,80,0] (* Harvey P. Dale, Dec 13 2020 *)
  • PARI
    a(n)=my(k);while(!isprime(k-n) || !isprime(k+n),k++);return(k) \\ Edward Jiang, Sep 05 2014

Formula

a(n) = A020483(n)+n for n >= 1. - Robert Israel, Sep 08 2014

Extensions

Entries checked by Klaus Brockhaus, Apr 08 2007

A015886 a(n) = smallest number k such that sigma(k + n) = sigma(k) + n, or -1 if no such number exists.

Original entry on oeis.org

1, 2, 3, 2, 3, 2, 5, 74, 3, 2, 3, 2, 5, 4418, 3, 2, 3, 2, 5, 6, 3, 2, 7
Offset: 0

Views

Author

Keywords

Comments

There are solutions to sigma(k)+n=sigma(k+n) whenever n is the difference between two primes (A030173), e.g. k and k+n are primes. There are other values of n that have solutions (see example).
a(23) > 4292000000, if it exists. - Jud McCranie, Jan 05 2000
The sequence begins: 1, 2, 3, 2, 3, 2, 5, 74, 3, 2, 3, 2, 5, 4418, 3, 2, 3, 2, 5, 6, 3, 2, 7, ?, 5, ?, 3, 2, 3, 2, 7, ?, 5, 18, 3, 2, 5, 44, 3, 2, 3, 2, 5, ?, 3, 2, 7, ?, 5, 3315, 3, 2, 7, ?, 5, ?, 3, 2, 3, 2, 7, ?, 5, ?, 3, 2, 5, ?, 3, 2, 3, 2, 7, 18, 5, ?, 3, 2, 5, ?, 3, 2, 7, ?, 5, ?, 3, 2, 13, ?, 7, ?, 5, 32, 3, 2, 5 where the other missing terms (designated by "?") are > 10^9, if they exist. - Jud McCranie, Jan 08 2000
The "other" values of n are the odd n such that n+2 is not prime. For these n, in order for sigma(k) or sigma(n+k) to be odd, either k or n+k must be a square or twice a square. Examples: for n=7, n+k=9^2; for n=13, k=2*47^2 and for n=19, n+k=5^2. Using this idea, it is easy to show that if a(23) exists it is greater than 10^12. - T. D. Noe, Sep 24 2007

Examples

			sigma(74+7) = 121 = sigma(74)+7, so a(7) = 74.
		

Crossrefs

Programs

  • Mathematica
    Table[k=1; While[DivisorSigma[1,k+n] != DivisorSigma[1,k]+n, k++ ]; k, {n,0,22}] (* T. D. Noe, Sep 24 2007 *)
  • PARI
    a(n) = {my(k=1); while(sigma(k+n) != sigma(k) + n, k++); k;} \\ Michel Marcus, May 23 2018

Formula

a(2n) = A020483(n) = A054906(n) - T. D. Noe, Sep 24 2007

A020484 Least prime p such that there exists a prime q with p-2n = q.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a020484 n = head [q | p <- a000040_list, let q = p + 2*n, a010051' q == 1]
    -- Reinhard Zumkeller, Nov 29 2014

Extensions

Minor edits by N. J. A. Sloane, Jul 13 2010

A054906 Smallest number x such that sigma(x+2n) = sigma(x)+2n (first definition).

Original entry on oeis.org

3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 7, 5, 3, 3, 7, 5, 3, 5, 3, 3, 5, 3, 7, 5, 3, 7, 5, 3, 3, 7, 5, 3, 5, 3, 3, 7, 5, 3, 5, 3, 7, 5, 3, 13, 7, 5, 3, 5, 3, 3, 5, 3, 3, 5, 3, 19, 13, 11, 13, 7, 5, 3, 5, 3, 7, 5, 3, 3, 11, 11, 7, 5, 3, 3, 7, 5, 3, 7, 5, 3, 5, 3, 7, 5, 3, 7, 5, 3, 3, 11, 11, 7, 5, 3, 3, 5, 3, 3, 13
Offset: 1

Views

Author

Labos Elemer, May 23 2000

Keywords

Comments

Least (prime) solutions for phi(x+2n)=phi(x)+2n seems to be identical to this sequence, while prime solutions are indeed identical to this sequence.
2nd definition = smallest number x such that phi(x+2n)=phi(x)+2n.
3rd definition = smallest primes p such that p+2n=q prime (A020483).
The 3 definitions are identical or conjectured to be identical.
The definitions are not identical if we do not take the smallest numbers. These smallest solutions are believed to be always prime numbers.
Duplicate of A020483, assuming that the 3rd definition is also correct. - R. J. Mathar, Apr 26 2015
If it can be proved that all these definitions are identical, then this entry should be merged with A020483. - N. J. A. Sloane, Feb 06 2017

Examples

			n-th primes 2,3,5,7,11,13, are solutions to sigma(x+2n)=2n+sigma(x) at 2n=2,6,22,116,88.
		

References

  • Sivaramakrishnan,R.(1989):Classical Theory of Arithmetical Functions. Marcel Dekker,Inc., New York.

Crossrefs

Programs

  • Maple
    A054906 := proc(n)
        local x;
        for x from 0 do
            if numtheory[sigma](x+2*n) = numtheory[sigma](x)+2*n then
                return x;
            end if;
        end do:
    end proc:
    seq(A054906(n),n=1..40); # R. J. Mathar, Sep 23 2016
  • Mathematica
    Table[x = 1; While[DivisorSigma[1, x + 2 n] != DivisorSigma[1, x] + 2 n, x++]; x, {n, 100}] (* Michael De Vlieger, Feb 05 2017 *)
  • PARI
    a(n) = my(x = 1); while(sigma(x+2*n) != sigma(x)+2*n, x++); x; \\ Michel Marcus, Dec 17 2013

Formula

Minimal solutions to A000203(x+2n)=A000203(x)+2n or to A000010(x+2n)=A000010(x)+2n or to p+2n=q; p, q primes, a(n)=p.
a(n) <= A054905(n). - R. J. Mathar, Apr 28 2015

A101042 a(n) is the smallest positive d such that the n-th prime is the smallest prime p for which p+d is also prime.

Original entry on oeis.org

1, 2, 6, 22, 116, 88, 470, 112, 284, 242, 202, 772, 1326, 718, 1334, 1328, 2558, 1762, 1642, 2402, 3274, 1732, 7094, 9512, 7984, 5246, 12688, 10532, 9952, 16766, 7702, 60458, 9974, 25708, 5888, 13528, 10342, 25678, 62156, 69518, 76838, 37666
Offset: 1

Views

Author

Jens Kruse Andersen, Nov 28 2004

Keywords

Comments

Except for n=1, A020483(a(n)/2) is the first appearance of the n-th prime. It is conjectured that a(n) always exists. a(386) is the first number which must be above 10^12.

Examples

			a(3)=6 because: The 3rd prime is 5. 2+6, 3+6 is composite, 5+6 is prime. 6 is the smallest such number.
		

Crossrefs

Showing 1-10 of 29 results. Next