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

A047160 For n >= 2, a(n) = smallest number m >= 0 such that n-m and n+m are both primes, or -1 if no such m exists.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 3, 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, 9, 2, 3, 0, 1, 0, 3, 2, 15, 0, 5, 12, 3, 8, 9, 0, 7, 12, 3, 4, 15, 0, 1, 0, 9, 4, 3, 6, 5, 0, 15, 2, 3, 0, 1, 0, 15, 4, 3, 6, 5, 0, 9, 2, 15, 0, 5, 12, 3, 14, 9, 0, 7, 12, 9, 4, 15, 6, 7, 0, 9, 2, 3
Offset: 2

Views

Author

Keywords

Comments

I have confirmed there are no -1 entries through integers to 4.29*10^9 using PARI. - Bill McEachen, Jul 07 2008
From Daniel Forgues, Jul 02 2009: (Start)
Goldbach's Conjecture: for all n >= 2, there are primes (distinct or not) p and q s.t. p+q = 2n. The primes p and q must be equidistant (distance m >= 0) from n: p = n-m and q = n+m, hence p+q = (n-m)+(n+m) = 2n.
Equivalent to Goldbach's Conjecture: for all n >= 2, there are primes p and q equidistant (distance >= 0) from n, where p and q are n when n is prime.
If this conjecture is true, then a(n) will never be set to -1.
Twin Primes Conjecture: there is an infinity of twin primes.
If this conjecture is true, then a(n) will be 1 infinitely often (for which each twin primes pair is (n-1, n+1)).
Since there is an infinity of primes, a(n) = 0 infinitely often (for which n is prime).
(End)
If n is composite, then n and a(n) are coprime, because otherwise n + a(n) would be composite. - Jason Kimberley, Sep 03 2011
From Jianglin Luo, Sep 22 2023: (Start)
a(n) < primepi(n)+sigma(n,0);
a(n) < primepi(primepi(n)+n);
a(n) < primepi(n), for n>344;
a(n) = o(primepi(n)), as n->+oo. (End)
If -1 < a(n) < n-3, then a(n) is divisible by 3 if and only if n is not divisible by 3, and odd if and only if n is even. - Robert Israel, Oct 05 2023

Examples

			16-3=13 and 16+3=19 are primes, so a(16)=3.
		

Crossrefs

Programs

  • Haskell
    a047160 n = if null ms then -1 else head ms
                where ms = [m | m <- [0 .. n - 1],
                                a010051' (n - m) == 1, a010051' (n + m) == 1]
    -- Reinhard Zumkeller, Aug 10 2014
    
  • Magma
    A047160:=func;[A047160(n):n in[2..100]]; // Jason Kimberley, Sep 02 2011
    
  • Mathematica
    Table[k = 0; While[k < n && (! PrimeQ[n - k] || ! PrimeQ[n + k]), k++]; If[k == n, -1, k], {n, 2, 100}]
    smm[n_]:=Module[{m=0},While[AnyTrue[n+{m,-m},CompositeQ],m++];m]; Array[smm,100,2] (* Harvey P. Dale, Nov 16 2024 *)
  • PARI
    a(n)=forprime(p=n,2*n, if(isprime(2*n-p), return(p-n))); -1 \\ Charles R Greathouse IV, Jun 23 2017
  • UBASIC
    10 N=2// 20 M=0// 30 if and{prmdiv(N-M)=N-M,prmdiv(N+M)=N+M} then print M;:goto 50// 40 inc M:goto 30// 50 inc N: if N>130 then stop// 60 goto 20
    

Formula

a(n) = n - A112823(n).
a(n) = A082467(n) * A005171(n), for n > 3. - Jason Kimberley, Jun 25 2012

Extensions

More terms from Patrick De Geest, May 15 1999
Deleted a comment. - T. D. Noe, Jan 22 2009
Comment corrected and definition edited by Daniel Forgues, Jul 08 2009

A099303 Greatest integer x such that x' = n, or 0 if there is no such x, where x' is the arithmetic derivative of x.

Original entry on oeis.org

0, 0, 4, 6, 9, 10, 15, 14, 25, 0, 35, 22, 49, 26, 55, 0, 77, 34, 91, 38, 121, 0, 143, 46, 169, 27, 187, 0, 221, 58, 247, 62, 289, 0, 323, 0, 361, 74, 391, 42, 437, 82, 403, 86, 529, 0, 551, 94, 589, 63, 667, 0, 713, 106, 703, 0, 841, 70, 899, 118, 961, 122, 943, 0, 1073, 0
Offset: 2

Views

Author

T. D. Noe, Oct 12 2004

Keywords

Comments

This is the largest member of the set I(n) in the paper by Ufnarovski and Ahlander. They show that a(n) <= (n/2)^2.
Because this sequence is quite different for even and odd n, it is bisected into A102084 and A189762. The upper bound for odd n appears to be (n/3)^(3/2), which is attained when n = 3p^2 for primes p>5. - T. D. Noe, Apr 27 2011

References

Crossrefs

Cf. A003415 (arithmetic derivative of n), A099302 (number of solutions to x' = n), A098699 (least x such that x' = n), A098700 (n such that x' = n has no integer solution).

Programs

  • Mathematica
    dn[0]=0; dn[1]=0; dn[n_]:=Module[{f=Transpose[FactorInteger[n]]}, If[PrimeQ[n], 1, Plus@@(n*f[[2]]/f[[1]])]]; d1=Table[dn[n], {n, 40000}]; Table[x=Max[Flatten[Position[d1, n]]]; If[x>-Infinity, x, 0], {n, 2, 400}]
  • Python
    from sympy import factorint
    def A099303(n):
        for m in range(n**2>>2,0,-1):
            if sum((m*e//p for p,e in factorint(m).items())) == n:
                return m
        return 0 # Chai Wah Wu, Sep 12 2022

A073046 Write 2*n = p+q (p,q prime), p*q minimal; then a(n) = p*q.

Original entry on oeis.org

4, 9, 15, 21, 35, 33, 39, 65, 51, 57, 95, 69, 115, 161, 87, 93, 155, 217, 111, 185, 123, 129, 215, 141, 235, 329, 159, 265, 371, 177, 183, 305, 427, 201, 335, 213, 219, 365, 511, 237, 395, 249, 415, 581, 267, 445, 623, 1501, 291, 485, 303, 309, 515, 321, 327
Offset: 2

Views

Author

Werner D. Sand, Aug 31 2002

Keywords

Comments

Least semiprime whose sum of prime factors equals 2*n.
Assuming Goldbach's conjecture, a(n) exists for all n >= 2. - David James Sycamore, Jan 08 2019

Examples

			n=13: 2n=26; 26 = 23 + 3 = 19 + 7 = 13 + 13; 23*3 = minimal => p*q = 23*3 = 69.
		

Crossrefs

Programs

  • Haskell
    a073046 n = head $ dropWhile (== 0) $
                       zipWith (*) prims $ map (a061397 . (2*n -)) prims
       where prims = takeWhile (<= n) a000040_list
    -- Reinhard Zumkeller, Aug 28 2011
  • Mathematica
    Array[Block[{p = 2, q}, While[! PrimeQ@ Set[q, 2 # - p], p = NextPrime[p]]; p q] &, 55, 2] (* Michael De Vlieger, Aug 02 2020 *)

Formula

For all n except 3, a(n) = A288814(2*n). - David James Sycamore, Jan 08 2019

Extensions

Corrected by Ray Chandler, Jun 11 2005

A189762 Greatest integer x such that x' = 2n+1, or 0 if there is no such x, where x' is the arithmetic derivative (A003415).

Original entry on oeis.org

0, 6, 10, 14, 0, 22, 26, 0, 34, 38, 0, 46, 27, 0, 58, 62, 0, 0, 74, 42, 82, 86, 0, 94, 63, 0, 106, 0, 70, 118, 122, 0, 0, 134, 105, 142, 146, 98, 0, 158, 0, 166, 117, 0, 178, 0, 175, 0, 194, 130, 202, 206, 0, 214, 218, 154, 226, 0, 245, 138, 171, 0, 0, 254
Offset: 1

Views

Author

T. D. Noe, Apr 27 2011

Keywords

Comments

Bisection of A099303. In contrast to the sequence for even numbers, A102084, there appear to be an infinite number of zeros in this sequence (see A098700). The density of the zeros appears to be 1/3. Quite Often a(n) = 4n-2. For odd number 2n+1, an upper bound on the largest anti-derivative x appears to ((2n+1)/3)^(3/2).

Crossrefs

Cf. A003415, A099303, A102084 (another bisection of A099303).

Programs

  • Mathematica
    dn[0] = 0; dn[1] = 0; dn[n_] := Module[{f = Transpose[FactorInteger[n]]}, If[PrimeQ[n], 1, Plus @@ (n*f[[2]]/f[[1]])]]; nn = 100; d = Array[dn, (nn/2)^2]; Table[pos = Position[d, n]; If[pos == {}, 0, pos[[-1, 1]]], {n, 3, nn, 2}]

A189764 Greatest integer x such that x' = 2n and x is not a semiprime, or 0 if there is no such x, where x' is the arithmetic derivative (A003415).

Original entry on oeis.org

0, 0, 0, 0, 0, 8, 0, 12, 0, 0, 0, 20, 0, 0, 0, 28, 0, 0, 0, 0, 0, 24, 0, 44, 0, 0, 0, 52, 0, 36, 0, 0, 0, 40, 0, 68, 0, 0, 0, 76, 0, 0, 0, 0, 0, 60, 0, 92, 0, 0, 0, 0, 0, 81, 0, 48, 0, 0, 0, 116, 0, 84, 0, 124, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 148, 0, 72
Offset: 1

Views

Author

T. D. Noe, Apr 27 2011

Keywords

Comments

As mentioned in A102084, the anti-derivatives of even numbers are overwhelmingly semiprimes of the form n^2 - k^2. This sequence excludes those semiprimes. The upper bound of a(n) appears to be (n/2)^(4/3), which is attained when 2n = 4p^3 for primes p>3.

Crossrefs

Cf. A003415, A102084, A189763 (n such that a(n)>0).

Programs

  • Mathematica
    dn[0] = 0; dn[1] = 0; dn[n_] := Module[{f = Transpose[FactorInteger[n]]}, If[PrimeQ[n], 1, Plus @@ (n*f[[2]]/f[[1]])]]; nn = 200; d = Array[dn, (nn/2)^2]; Table[s1 = Flatten[Position[d, n]]; s2 = Select[s1, ! IntegerQ[Sqrt[(n/2)^2 - #]] &]; If[s2 == {}, 0, s2[[-1]]], {n, 2, nn, 2}]

A193315 Write 2n=j+q (j,q positive noncomposite numbers); j*q maximal; then a(n)=j*q.

Original entry on oeis.org

1, 4, 9, 15, 25, 35, 49, 55, 77, 91, 121, 143, 169, 187, 221, 247, 289, 323, 361, 391, 437, 403, 529, 551, 589, 667, 713, 703, 841, 899, 961, 943, 1073, 1147, 1189, 1271, 1369, 1363, 1517, 1591, 1681, 1763, 1849, 1927, 2021, 1891, 2209, 2279, 2257, 2491, 2537, 2623, 2809, 2867, 2881
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 26 2011

Keywords

Comments

a(n) = A102084(n) for n > 0. [Reinhard Zumkeller, Aug 28 2011]

Examples

			At n=6, 2n=12; 12 = 1 + 11 = 7 + 5; 7*5 = maximal => j*q = 7*5 = 35.
		

Crossrefs

Programs

  • Haskell
    a193315 1 = 1
    a193315 n = maximum $ zipWith (*) prims $ map (a061397 . (2*n -)) prims
       where prims = takeWhile (<= n) a008578_list
    -- Reinhard Zumkeller, Aug 28 2011
  • Maple
    isA008578 := proc(n) if n = 1 then true ; elif isprime(n) then true; else false; end if; end proc:
    A193315 := proc(n) local mx,j,q ; mx := 0 ; for j from 1 to 2*n-1 do if isA008578(j) then q := 2*n-j ; if isA008578(q) then mx := max(mx,j*q) ; end if ; end if; end do: mx ; end proc:
    seq(A193315(n),n=1..60) ; # R. J. Mathar, Aug 28 2011
  • Sage
    def is_A008578(n): return n == 1 or is_prime(n)
    def A193315(n): return max((j*(2*n-j)) for j in [1]+prime_range(n+1) if is_A008578(2*n-j))
    [A193315(i) for i in range(1,15)]
    # D. S. McNeil, Aug 27 2011
    

A350455 T(n,k) is the k-th semiprime whose sum of prime factors equals 2n, triangle T(n,k), n>=2, 1<=k<=A045917(n), read by rows.

Original entry on oeis.org

4, 9, 15, 21, 25, 35, 33, 49, 39, 55, 65, 77, 51, 91, 57, 85, 121, 95, 119, 143, 69, 133, 169, 115, 187, 161, 209, 221, 87, 247, 93, 145, 253, 289, 155, 203, 299, 323, 217, 361, 111, 319, 391, 185, 341, 377, 437, 123, 259, 403, 129, 205, 493, 529, 215, 287, 407
Offset: 2

Views

Author

Alois P. Heinz, Dec 31 2021

Keywords

Comments

Assuming Goldbach's conjecture, no row is empty.

Examples

			Triangle T(n,k) begins:
    4;
    9;
   15;
   21,  25;
   35     ;
   33,  49;
   39,  55;
   65,  77;
   51,  91;
   57,  85, 121;
   95, 119, 143;
   69, 133, 169;
  115, 187     ;
  161, 209, 221;
   87, 247     ;
   93, 145, 253, 289;
  155, 203, 299, 323;
  ...
		

Crossrefs

Column k=1 gives A073046.
Last elements of rows give A102084.
Row sums give A228553.
Row products give A337568.
Row lengths give A045917.

Programs

  • Maple
    T:= n-> seq(`if`(andmap(isprime, [h, 2*n-h]), h*(2*n-h), [][]), h=2..n):
    seq(T(n), n=2..30);
Showing 1-7 of 7 results.