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 21-28 of 28 results.

A377320 a(n) is the smallest positive integer k such that n + k and n - k have the same number of prime factors.

Original entry on oeis.org

1, 1, 1, 3, 2, 2, 2, 6, 1, 5, 3, 2, 3, 6, 1, 1, 3, 2, 9, 2, 2, 5, 3, 4, 6, 1, 1, 11, 6, 4, 1, 6, 2, 2, 2, 2, 3, 8, 1, 1, 3, 2, 4, 3, 4, 12, 1, 1, 3, 2, 3, 1, 1, 3, 2, 7, 1, 4, 7, 4, 3, 6, 5, 1, 2, 1, 3, 5, 1, 3, 4, 4, 3, 1, 4, 13, 6, 2, 5, 15, 2, 7, 1, 3, 3, 1, 3
Offset: 4

Views

Author

Felix Huber, Nov 17 2024

Keywords

Comments

If the strong Goldbach conjecture is true, that every even number >= 8 is the sum of two distinct primes, then a positive integer k <= A082467(n) exists for n >= 4.

Examples

			a(7) = 3 because 10 and 4 have both two prime factors. 8 and 6 or 9 and 7 respectively have a different number of prime factors.
		

Crossrefs

Programs

  • Maple
    A377320:=proc(n)
       local k;
       for k to n-1 do
          if NumberTheory:-Omega(n+k)=NumberTheory:-Omega(n-k) then
             return k
          fi
       od;
    end proc;
    seq(A377320(n),n=4..90);
  • Mathematica
    A377320[n_] := Module[{k = 0}, While[PrimeOmega[++k + n] != PrimeOmega[n - k]]; k];
    Array[A377320, 100, 4] (* Paolo Xausa, Dec 02 2024 *)
  • PARI
    a(n) = my(k=1); while (bigomega(n+k) != bigomega(n-k), k++); k; \\ Michel Marcus, Nov 17 2024

Formula

1 <= a(n) <= A082467(n).

A377321 a(n) is the smallest positive integer k such that n + k and n - k have the same number of distinct prime factors.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 3, 2, 2, 3, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, 4, 4, 1, 1, 2, 1, 2, 1, 3, 3, 1, 3, 3, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 4, 3, 1, 4, 6, 3, 1, 3, 3, 2, 2, 2, 2, 3, 1, 1, 2, 1, 1, 3, 2, 3, 1, 1, 1, 3, 2, 3, 1, 1, 3, 2, 2
Offset: 4

Views

Author

Felix Huber, Nov 17 2024

Keywords

Comments

If the strong Goldbach conjecture is true, that every even number >= 8 is the sum of two distinct primes, then a positive integer k <= A082467(n) exists for n >= 4.

Examples

			a(7) = 2 because 9 and 5 have both one distinct prime factor. 8 and 6 have a different number of distinct prime factors.
		

Crossrefs

Programs

  • Maple
    A377321:=proc(n)
       local k;
       for k to n-1 do
          if NumberTheory:-Omega(n+k,'distinct')=NumberTheory:-Omega(n-k,'distinct') then
             return k
          fi
       od;
    end proc;
    seq(A377321(n),n=4..90);
  • Mathematica
    A377321[n_] := Module[{k = 0}, While[PrimeNu[++k + n] != PrimeNu[n - k]]; k];
    Array[A377321, 100, 4] (* Paolo Xausa, Dec 02 2024 *)
  • PARI
    a(n) = my(k=1); while (omega(n+k) != omega(n-k), k++); k; \\ Michel Marcus, Nov 17 2024

Formula

1 <= a(n) <= A082467(n).

A104884 Records in A104883.

Original entry on oeis.org

4, 5, 8, 24, 54, 117, 222, 258, 291, 591, 888, 951, 1656, 1674, 2451, 2577, 4212, 4857, 6597, 7398, 10758, 10950, 11601, 19608, 20604, 27411, 35157, 43338, 45174, 46920, 53412, 71661, 90699, 96681, 107385, 123051, 130782, 189741, 225747, 273738, 288096, 362781
Offset: 1

Views

Author

Keywords

Comments

a(k) has the largest equal 'gap' between the nearest primes so far, i.e.; (the sum of the two nearest primes)/2 equals a(k).

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k}, If[ OddQ[n], k = 2, k = 1]; While[ !PrimeQ[n - k] || !PrimeQ[n + k], k += 2]; k]; t = Table[f[n], {n, 4, 10^4}];u = Table[0, {80}]; Do[a = t[[n]]; If[a < 81 && u[[a]] == 0, u[[a]] = n + 3], {n, 10^4}]; a = 0; lst = {}; Do[ If[u[[n]] > a, a = u[[n]]; AppendTo[lst, a]], {n, 80}]; lst

A239146 Smallest k>0 such that n +/- k and n^2 +/- k are all prime. a(n) = 0 if no such number exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 3, 2, 3, 0, 5, 0, 3, 2, 0, 0, 13, 12, 0, 2, 0, 0, 0, 6, 15, 10, 0, 12, 0, 0, 15, 20, 0, 12, 5, 0, 15, 22, 21, 12, 0, 0, 0, 14, 27, 0, 35, 0, 0, 8, 15, 0, 0, 24, 27, 0, 0, 48, 7, 48, 0, 50, 3, 6, 7, 0, 0, 28, 0, 18, 0, 0, 27, 34
Offset: 1

Views

Author

Derek Orr, Mar 11 2014

Keywords

Comments

a(n) is always smaller than n due to the requirement on n-k.

Examples

			8 +/- 1 (7 and 9) and 8^2 +/- 1 (63 and 65) are not all prime. 8 +/- 2 (6 and 10) and 8^2 +/- 2 (62 and 66) are not all prime. However, 8 +/- 3 (5 and 11) and 8^2 +/- 3 (61 and 67) are all prime. Thus, a(8) = 3.
		

Crossrefs

Programs

  • Maple
    A239146 := proc(n)
        local k ;
        for k from 1 do
            if n-k <= 1 then
                return 0;
            end if;
            if isprime(n+k) and isprime(n-k) and isprime(n^2+k)
                and isprime(n^2-k) then
                return k;
            end if;
        end do;
    end proc:
    seq(A239146(n),n=1..80) ; # R. J. Mathar, Mar 12 2014
  • Mathematica
    a[n_] := Catch@ Block[{k = 1}, While[k < n, And @@ PrimeQ@ {n+k, n-k, n^2+k, n^2-k} && Throw@k; k++]; 0]; Array[a, 75] (* Giovanni Resta, Mar 13 2014 *)
  • Python
    import sympy
    from sympy import isprime
    def c(n):
      for k in range(1,n):
        if isprime(n+k) and isprime(n-k) and isprime(n**2+k) and isprime(n**2-k):
          return k
    n = 1
    while n < 100:
      if c(n) == None:
        print(0)
      else:
        print(c(n))
      n += 1

A242165 Smallest k>=0, such that n+/-k are both Fermi-Dirac primes (A050376).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 2, 0, 0, 1, 0, 3, 2, 3, 0, 1, 0, 3, 2, 3, 0, 1, 0, 9, 4, 3, 6, 5, 0, 9, 2, 3, 0, 1, 0, 3, 2, 3, 0, 1, 0, 3, 2, 9, 0, 5, 6, 3, 4, 9, 0, 1, 0, 9, 4, 3, 6, 5, 0, 15, 2, 3, 0, 1, 0, 7, 4, 3, 4, 5, 0, 1, 0, 1, 0, 5, 4, 3, 14, 9, 0, 7, 10, 9, 4, 13, 6, 7, 0
Offset: 2

Views

Author

Vladimir Shevelev, May 05 2014

Keywords

Comments

The existence of a(n)>=0 for all n >= 2 is equivalent to the Goldbach conjecture in Fermi-Dirac arithmetic (cf. comment in A241927) that every even number >= 4 is a sum of two terms of A050376 (it is slightly weaker than Goldbach conjecture for primes).

References

  • V. S. Shevelev, Multiplicative functions in the Fermi-Dirac arithmetic, Izvestia Vuzov of the North-Caucasus region, Nature sciences 4 (1996), 28-43 (in Russian; MR 2000f: 11097, pp. 3912-3913).

Crossrefs

Formula

a(A050376(n)) = 0.

A298736 a(n) = s(n) - prime(n+1)+3, where s(n) = smallest even number x > prime(n) such that the difference x-p is composite for all primes p <= prime(n).

Original entry on oeis.org

6, 10, 26, 90, 88, 84, 82, 200, 282, 280, 522, 518, 516, 512, 942, 936, 934, 928, 924, 922, 2566, 2562, 2556, 2548, 2544, 2542, 5268, 5266, 5262, 5248, 5244, 5238, 5236, 7280, 7278, 7272, 7266, 7262, 7256, 43356, 43354, 43344, 43342, 43338, 43336, 43324, 54024
Offset: 1

Views

Author

Felix Fröhlich, Jan 25 2018

Keywords

Comments

The statement "a(n) >= 0 for n >= 1" is equivalent to Goldbach's conjecture (cf. Phong, Dongdong, 2004, Theorem (a)).
Records: 6, 10, 26, 90, 200, 282, 522, 942, 2566, 5268, 7280, 43356, 54024, ..., . - Robert G. Wilson v, Feb 28 2018

Crossrefs

Programs

  • Maple
    N:= 100: # to get a(1)..a(N)
    P:= [seq(ithprime(i),i=1..N+1)]:
    s:= proc(n,k0) local k;
      for k from max(k0,P[n]+1) by 2 do
        if andmap(not(isprime), map(t -> k - t, P[1..n])) then return k
      fi
    od
    end proc:
    K[1]:= 6: A[1]:= 6:
    for n from 2 to N do
      K[n]:= s(n,K[n-1]);
      A[n]:= K[n]- P[n+1]+3;
    od:
    seq(A[n],n=1..N); # Robert Israel, Mar 01 2018
  • Mathematica
    f[n_] := Block[{k, x = 2, q = Prime@ Range@ n}, x += Mod[x, 2]; While[k = 1; While[k < n +1 && CompositeQ[x - q[[k]]], k++]; k < n +1, z = x += 2]; x - Prime[n +1] +3]; Array[f, 47] (* Robert G. Wilson v, Feb 26 2018 *)
  • PARI
    s(n) = my(p=prime(n), x); if(p==2, x=4, x=p+1); while(1, forprime(q=1, p, if(ispseudoprime(x-q), break, if(q==p, return(x)))); x=x+2)
    a(n) = s(n)-prime(n+1)+3

Formula

a(n) = A152522(n)-A000040(n+1)+3 for n > 0.

A177464 The smallest positive k such that the n-th Mersenne prime +-k are two primes.

Original entry on oeis.org

4, 12, 24, 30, 30, 66, 954, 1920, 30, 4116, 576, 214608
Offset: 2

Views

Author

Keywords

Comments

Smallest k>0 such that A000668(n)+k and A000668(n)-k are both prime.

Examples

			7+-4->primes, 31+-12->primes, 127+-24->primes, 8191+-30->primes, 131071+-30->primes, 524287+-66->primes..
		

Crossrefs

Programs

  • Mathematica
    g[n_]:=2^Prime[n]-1; f[n_]:=Block[{k},If[OddQ[n],k=2,k=1];While[ !PrimeQ[n-k]||!PrimeQ[n+k],k+=2];k]; lst={};Do[If[PrimeQ[g[n]],AppendTo[lst,f[g[n]]]],{n,2,40}];lst

Formula

a(n) = A082467(A000668(n)). - R. J. Mathar, Jan 23 2011

A254886 a(n) = least k>0 such that n-k^2 and n+k^2 are both primes.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 0, 2, 0, 0, 1, 0, 3, 2, 0, 0, 1, 0, 3, 4, 3, 0, 0, 0, 0, 2, 3, 0, 1, 0, 3, 2, 0, 0, 5, 0, 3, 0, 0, 0, 1, 6, 0, 4, 0, 6, 5, 0, 3, 0, 3, 6, 5, 0, 0, 2, 0, 0, 1, 0, 3, 2, 0, 6, 0, 6, 0, 0, 3, 0, 1, 6, 0, 2, 0, 6, 5, 0, 3, 0, 0, 0, 5, 0, 9, 4, 3, 0, 7, 0, 3, 2, 0, 6, 0, 0, 3, 0, 9, 0, 1, 6, 0, 2, 0, 0, 1, 0
Offset: 1

Views

Author

Zak Seidov, Feb 10 2015

Keywords

Comments

If n is a square then a(n)=sqrt(n)-1 or 0.
Also if n is a square and a(n)=sqrt(n)-1 then sqrt(n) is a term in A178659.
First appearances of k for k=1..58 are at n = 4, 7, 14, 21, 36, 43, 90, 117, 86, 111, 210, 149, 768, 201, 236, 285, 468, 329, 366, 411, 446, 1137, 534, 647, 654, 807, 770, 885, 900, 911, 3090, 1665, 1192, 2415, 1296, 1313, 4212, 2163, 1600, 1671, 5448, 1769, 2040, 1941, 2054, 3207, 2214, 2333, 5340, 2601, 2792, 7725, 2814, 3095, 3054, 5913, 3442, 4377.
Among the first 10000 terms, the first missing values are 59, 79, 82, 83, 89, 91, 92, 94, 97, 98, 100.

Crossrefs

Programs

  • PARI
    k=1;while(k^2Derek Orr, Feb 11 2015
Previous Showing 21-28 of 28 results.