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

A141095 Number of unordered pairs of coprime nonprime numbers that sum to 2n.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Jun 02 2008

Keywords

Comments

Nonprime numbers are 1 and the composite numbers. See A141097 for pairs of coprime composite numbers. It appears that a(n) > 0 except for the 26 values of 2n given in A141096.

Examples

			a(17)=2 because 34 = 1+33 = 9+25.
		

Crossrefs

Programs

  • Mathematica
    Table[cnt=0; Do[If[GCD[2n-i,i]==1 && !PrimeQ[i] && !PrimeQ[2n-i], cnt++ ], {i,1,n,2}]; cnt, {n,100}]

A141100 Number of unordered pairs of odd composite numbers that sum to 2n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 1, 2, 0, 1, 3, 1, 1, 3, 2, 1, 4, 1, 2, 5, 1, 3, 5, 1, 4, 5, 3, 3, 6, 3, 3, 7, 3, 3, 9, 3, 4, 7, 4, 6, 9, 5, 5, 8, 6, 6, 10, 5, 5, 12, 4, 6, 12, 5, 9, 11, 7, 7, 11, 9, 9, 13, 8, 8, 16, 7, 11, 14, 8, 11, 14, 9, 9, 17, 13, 10, 16, 11, 11, 19, 11, 12, 18, 10
Offset: 1

Views

Author

T. D. Noe, Jun 02 2008, Jun 05 2008

Keywords

Comments

See A141099 for pairs of odd nonprime numbers. We have a(n) > 0 except for the 14 values of 2n given in A118081.

Examples

			a(18)=2 because 36 = 9+27 = 15+21.
		

Crossrefs

Programs

  • Mathematica
    Table[cnt=0; Do[If[ !PrimeQ[i] && !PrimeQ[2n-i], cnt++ ], {i,3,n,2}]; cnt, {n,100}]

Formula

a(n) = 1 - floor(n/2) + Sum_{i=3..n} c(i) * c(2n-i), n>1, where c = A005171. - Wesley Ivan Hurt, Dec 27 2013

A141098 Even numbers not representable as the sum of two coprime composite numbers.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 36, 38, 40, 42, 48, 50, 54, 56, 60, 66, 70, 72, 78, 80, 84, 90, 96, 108, 110, 120, 126, 132, 138, 140, 150, 180, 210
Offset: 1

Views

Author

T. D. Noe, Jun 02 2008

Keywords

Comments

210 is the last term.

Crossrefs

This sequence is a superset of A141096. See A141097.

Programs

  • Mathematica
    t = Table[Length[Select[Range[2, n/2], ! PrimeQ[#] && ! PrimeQ[n - #] && GCD[#, n - #] == 1 &]], {n, 2, 2000, 2}]; Flatten[2*Position[t, 0]] (* T. D. Noe, Dec 05 2013 *)

A141099 Number of unordered pairs of odd nonprime numbers that sum to 2n.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 2, 0, 2, 3, 0, 2, 3, 1, 2, 3, 3, 2, 4, 2, 3, 5, 1, 4, 6, 1, 5, 5, 3, 4, 7, 3, 4, 7, 4, 4, 9, 4, 5, 8, 4, 7, 9, 5, 6, 8, 6, 7, 10, 6, 6, 13, 5, 7, 13, 5, 10, 11, 8, 8, 11, 9, 10, 14, 9, 9, 16, 7, 12, 15, 8, 12, 15, 9, 10, 17, 14, 11, 16, 12, 12, 19, 11, 13, 19
Offset: 1

Views

Author

T. D. Noe, Jun 02 2008, Jun 05 2008

Keywords

Comments

See A141100 for pairs of odd composite numbers. We have a(n) > 0 except for the 8 values of 2n given in A046458.

Examples

			a(18)=3 because 36 = 1+35 = 9+27 = 15+21.
		

Crossrefs

Programs

  • Mathematica
    Table[cnt=0; Do[If[ !PrimeQ[i] && !PrimeQ[2n-i], cnt++ ], {i,1,n,2}]; cnt, {n,100}]

A220093 a(n) is the smallest odd positive integer > 1 that makes the composite number 2*n-a(n)*p1 divisible by p2, where p1 and p2 are the smallest and 2nd smallest odd prime numbers that are not factors of n. When no such odd positive integer exists, a(n)=0.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 7, 0, 0, 9, 0, 0, 11, 0, 9, 3, 0, 11, 0, 0, 3, 7, 0, 0, 9, 0, 7, 21, 0, 9, 3, 0, 11, 3, 5, 3, 7, 0, 0, 9, 13, 7, 11, 0, 9, 3, 0, 11, 27, 0, 3, 7, 0, 0, 9, 5, 7, 11, 0, 9, 3, 0, 11, 9, 17, 3, 7, 5
Offset: 1

Views

Author

Lei Zhou, Dec 12 2012

Keywords

Comments

Most positive integers are averages of pairs of coprime composite numbers (c1, c2), as of A141097.
For any 2*n=c1+c2, 2*n, c1, and c2 are coprime to each other.
Suppose c1=a*p1, c2=b*p2, where p1 and p2 are the smallest and second smallest prime numbers that are not factors of n; this sequence lists the smallest possible a value for any positive integer n.
The first Mathematica program checks through all number pairs to obtain this sequence. The second analytically calculates it. The results of the two programs are consistent up to n=100000.

Examples

			When n <= 16, 2*n cannot be written as the sum of a pair of coprime composites, so a(n)=0 for n=1..16.
When n=17, 3 and 5 are the smallest primes that are not factors of 17, 2*n=34=3*3+5*5, 9 and 25 are coprime composites, so a(17)=9/3=3.
...
When n=31, 3 and 5 are the smallest primes that are not factors of 31, 2*n=62=3*9+5*7, 27 and 35 are coprime composites, so a(31)=27/3=9.
		

Crossrefs

Programs

  • Mathematica
    OddPrimeFactors[n_] := Block[{nn = Round[Abs[n]], ans = {}}, If[nn > 1, ans = Transpose[FactorInteger[nn]][[1]]; If[EvenQ[nn], ans = Delete[ans, 1]]]; ans]; (* Subroutine for listing the odd prime factors of n *)
    FirstTwoPrimeNofactors[n_] := Block[{opf = OddPrimeFactors[n], tdo = 2, p = 2, ftpp = {}}, While[tdo > 0, p = NextPrime[p]; If[! MemberQ[opf, p], ftpp = Append[ftpp, p]; tdo--]]; ftpp]; (* Subroutine for finding the first two prime non-factors *)
    Table[{f1, f2} = FirstTwoPrimeNofactors[i]; n = 2*i; ans = 0; t1 = f1^2;
    While[t2 = n - t1; (Mod[t2, f2] != 0) || (! CoprimeQ[t1, t2]), t1 = t1 + f1]; If[(t1 < n) && (t2 >= (f1*f2)), ans = t1/f1]; ans, {i, 84}]
    (* Method 1: Scan t1 by the interval of f1 until a candidate is found.*)
    k[p1_, p2_] := Block[{r, pb = p1, s0, s = 1, ans}, While[r = Ceiling[p2/pb]*pb - p2; If[Abs[r] > (Abs[pb]/2), If[r > 0, r = r - Abs[pb], r = r + Abs[pb]]]; s0 = (p2 + r)/pb; s = Mod[s*s0, p2]; Abs[r] != 1, pb = r]; If[r == 1, ans = Mod[s*(p2 - 1), p2], ans = Mod[s, p2]]; ans]; (* Subroutine for function k in Method 2. *)
    Table[opf = OddPrimeFactors[i]; {f1, f2} = FirstTwoPrimeNofactors[i];
    k1 = k[f1, f2]; r2 = Mod[2*i, f2]; diff = Mod[-r2*k1, f2];
    If[EvenQ[diff], diff = diff + f2]; While[(diff < f1) || (Intersection[Transpose[FactorInteger[diff]][[1]], opf] != {}), diff = diff + 2*f2]; If[((diff*f1) + (f2)^2) > (2*i), diff = 0]; diff, {i, 84}]
    (* Method 2: Calculate minimum diff regardless if it has co-factor with i first, then scan diff by interval of 2*f2 until diff and i are coprime pair.*)
Showing 1-5 of 5 results.