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

A113484 a(n) = smallest composite integer > n and coprime to n.

Original entry on oeis.org

4, 9, 4, 9, 6, 25, 8, 9, 10, 21, 12, 25, 14, 15, 16, 21, 18, 25, 20, 21, 22, 25, 24, 25, 26, 27, 28, 33, 30, 49, 32, 33, 34, 35, 36, 49, 38, 39, 40, 49, 42, 55, 44, 45, 46, 49, 48, 49, 50, 51, 52, 55, 54, 55, 56, 57, 58, 63, 60, 77, 62, 63, 64, 65, 66, 85, 68, 69, 70, 81, 72, 77
Offset: 1

Views

Author

Leroy Quet, Jan 11 2006

Keywords

Crossrefs

Cf. A113496.

Programs

  • Mathematica
    f[n_] := Block[{k = n + 1}, While[PrimeQ@k || GCD[k, n] > 1, k++ ]; k]; Array[f, 72] (* Robert G. Wilson v *)
  • PARI
    a(n) = my(k = n+1); while(isprime(k) || (gcd(n,k) != 1), k++); k; \\ Michel Marcus, Mar 13 2017
    
  • Python
    from sympy import isprime, gcd
    def A113484(n):
        k = n+1
        while gcd(k,n) != 1 or isprime(k):
            k += 1
        return k # Chai Wah Wu, Mar 28 2021

Formula

a(p) = p+1 for prime p > 2. - Michel Marcus, Mar 13 2017

Extensions

More terms from Robert G. Wilson v, Jan 13 2006

A342175 a(n) is the difference between the n-th composite number and the smallest larger composite to which it is relatively prime.

Original entry on oeis.org

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

Views

Author

William C. Laursen, Mar 04 2021

Keywords

Comments

Conjecture: The only nonprime terms are squares (based on checking the first 2 million terms). - Ivan N. Ianakiev, Mar 28 2021
The conjecture above is false (see A353203 for counterexamples). - Ivan N. Ianakiev, Jul 04 2022

Examples

			The first composite number is 4, and the smallest larger composite to which it is coprime is 9, so a(1) = 9 - 4 = 5.
The second composite number is 6, and the smallest larger composite to which it is coprime is 25, so a(2) = 25 - 6 = 19.
		

Crossrefs

Programs

  • Mathematica
    Table[Block[{k = 1}, While[Nand[GCD[#, k] == 1, CompositeQ[# + k]], k++]; k] &@ FixedPoint[n + PrimePi@ # + 1 &, n + PrimePi@ n + 1], {n, 83}] (* Michael De Vlieger, Mar 19 2021 *)
  • PARI
    lista(nn) = {forcomposite(c=1, nn, my(x=c+1); while (isprime(x) || (gcd(x,c) != 1), x++); print1(x - c, ", "););} \\ Michel Marcus, Mar 04 2021
    
  • Python
    from sympy import isprime, gcd, composite
    def A342175(n):
        m = composite(n)
        k = m+1
        while gcd(k,m) != 1 or isprime(k):
            k += 1
        return k-m # Chai Wah Wu, Mar 28 2021

Formula

a(n) = A113496(n) - A002808(n). - Jon E. Schoenfield, Mar 04 2021

A353203 Let b be a composite number, c be the smallest composite number greater than b and coprime to b, and d = c-b. This sequence contains all b such that d is neither a prime nor a square.

Original entry on oeis.org

67613590, 72808450, 125918320, 153469030, 190281850, 229119880, 328315900, 339204910, 360203140, 395961280, 447304000, 450075340, 692309530, 844334920, 861327610, 909001390, 1029358330, 1166831380, 1178236510, 1321005400, 1344348610, 1366379080, 2035500610, 2045710810, 2156564410
Offset: 1

Views

Author

Fausto Morales Díaz and Ivan N. Ianakiev, Apr 30 2022

Keywords

Comments

Other such terms are 18806843674476 and 18806855958880.
a(n) is even. Proof: If a(n) = b is odd then c = a(n) + 1 where gcd(b, c) = 1 and d = c-b = 1 which is a square. Contradiction. - David A. Corneth, May 01 2022

Examples

			If b = 6, then c = 25 and d = c-b = 19 (prime), so 6 is not in the sequence.
If b = 67613590, then c = 67613611, and d = c-b = 21 (neither prime nor square), so 67613590 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    c[n_]:=Module[{k=n+1},While[GCD[n,k]!=1||PrimeQ[k],k++];k];
    Select[Range[10^8],CompositeQ[#]&&CompositeQ[c[#]-#]&&!IntegerQ[Sqrt[c[#]-#]]&]
Showing 1-3 of 3 results.