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

A356371 a(n) is the smallest positive integer k, such that set of pairwise gcd of k, k+1, ..., k+n has a cardinality of n.

Original entry on oeis.org

1, 2, 3, 8, 15, 24, 35, 48, 63, 270, 440, 528, 780, 1078, 2925, 1440, 8160, 2142, 5472, 34560, 23919, 235598, 64239, 42480, 158400, 1255800, 1614600, 1247400, 16442971, 8233650, 41021370, 21561120, 127327167, 439824000, 439824000, 24504444, 1329112224, 1653775162
Offset: 1

Views

Author

Gleb Ivanov, Oct 17 2022

Keywords

Comments

n | a(n). - David A. Corneth, Oct 17 2022

Crossrefs

Cf. A214799.

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[Length[Union[GCD @@@ Subsets[k + Range[0, n], {2}]]] != n, k++]; k]; Array[a, 20] (* Amiram Eldar, Oct 17 2022 *)
  • Python
    from math import gcd
    from itertools import count
    def A356371(n):
        for k in count(n,n):
            if len(set(gcd(i,j) for i in range(k,n+k+1) for j in range(i+1,n+k+1))) == n:
                return k # Chai Wah Wu, Oct 18 2022

Extensions

a(31)-a(38) from Giovanni Resta, Oct 17 2022

A213918 a(n) = smallest possible element of a set of n positive integers s_1, s_2, ..., s_n such that for i != j, |s_i - s_j| = gcd(s_i, s_j), where |x| denotes absolute value.

Original entry on oeis.org

1, 1, 2, 6, 36, 210, 14976, 552720, 309582000
Offset: 1

Views

Author

Phil Scovis, Mar 04 2013

Keywords

Examples

			Examples of sets for the first few cases:
{1},
{1,2},
{2, 3, 4},
{6, 8, 9, 12},
{36, 40, 42, 45, 48},
{210, 216, 220, 224, 225, 240},
{14976, 14980, 14994, 15000, 15008, 15015, 15120},
{552720, 552825, 552960, 553000, 553014, 553140, 553280, 554400},
{309582000, 309583680, 309583800, 309583872, 309583890, 309584000, 309584025, 309584100, 309584160}.
		

Crossrefs

Programs

  • Mathematica
    ok[v_, n_] := v == Select[v, GCD[#, n] == Abs[n - #] &];
    ric[p_, cc_, k_] :=
    If[Length@p == k, sol = p; True,
      Block[{c = cc, x, r = False},
       While[c != {}, x = First@c; c = Rest@c;
        If[p == Select[p, GCD[#, x] == Abs[x - #] &] &&
         ric[Append[p, x], c, k], r = True; Break[]]]; r]];
    a[k_] := Block[{n = 1, d}, While[Length[d = Divisors@n] < k - 1 ||
    !ric[{n}, n + d, k], n++]; n];
    Do[Print[n, " ", a[n], " ", sol], {n, 7}]

Extensions

Corrected (with Mathematica program) by Giovanni Resta, Mar 05 2013. Entry revised by N. J. A. Sloane, Mar 05 2013
a(8) from Robert Gerbicz, Mar 05 2013
a(9) from Robert Gerbicz, Mar 06 2013

A358127 a(n) is the cardinality of the set of pairwise gcd's of {prime(1)+1, ..., prime(n)+1}.

Original entry on oeis.org

1, 3, 4, 5, 5, 5, 5, 7, 8, 8, 8, 9, 9, 11, 12, 14, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 18, 19, 20, 21, 22, 22, 23, 23, 23, 23, 23, 24, 24, 26, 27, 29, 29, 30, 32, 32, 33, 35, 36, 36, 37, 37, 37, 37, 38, 38, 39, 39, 39, 39, 40, 40, 42, 42, 43, 43, 43, 44, 45, 45, 48, 48, 48, 48, 50, 50, 50, 50
Offset: 2

Views

Author

Gleb Ivanov, Oct 30 2022

Keywords

Examples

			For n = 3 initial set is {2+1, 3+1, 5+1} and after applying gcd for each distinct pair of elements we get {1, 2, 3} set with cardinality of a(3) = 3.
		

Crossrefs

Programs

  • Python
    from sympy import nextprime
    from math import gcd
    from itertools import combinations
    pr, terms = [2,3], []
    for i in range(100):
        terms.append(len(set([gcd(t[0]+1, t[1]+1) for t in combinations(pr,2)])))
        pr.append(nextprime(pr[-1]))
    print(terms)
    
  • Python
    from math import gcd
    from itertools import count, islice
    from sympy import prime
    def A358127_gen(): # generator of terms
        a, b = [3], set()
        for n in count(2):
            q = prime(n)+1
            b |= set(gcd(p,q) for p in a)
            yield len(b)
            a.append(q)
    A358127_list = list(islice(A358127_gen(),100)) # Chai Wah Wu, Nov 02 2022

A358178 a(n) is the cardinality of the set of distinct pairwise gcd's of {1! + 1, ..., n! + 1}.

Original entry on oeis.org

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

Views

Author

Gleb Ivanov, Nov 02 2022

Keywords

Examples

			For n = 6 initial set is {1+1, 2+1, 6+1, 24+1, 120+1, 720+1} and after applying gcd for each distinct pair of elements we get {1, 7} set with cardinality of a(6) = 2.
		

Crossrefs

Programs

  • Python
    from math import gcd, factorial
    from itertools import combinations
    f, terms = [2,], []
    for i in range(2,100):
        f.append(factorial(i)+1)
        terms.append(len(set([gcd(*t) for t in combinations(f, 2)])))
    print(terms)
    
  • Python
    from math import gcd
    from itertools import count, islice
    def A358178_gen(): # generator of terms
        m, f, g = 1, [], set()
        for n in count(1):
            m *= n
            g |= set(gcd(d,m+1) for d in f)
            f.append(m+1)
            yield len(g)
    A358178_list = list(islice(A358178_gen(),20)) # Chai Wah Wu, Dec 15 2022
Showing 1-4 of 4 results.