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

A130335 Smallest k > 0 such that gcd(n*(n+1)/2, (n+k)*(n+k+1)/2) = 1.

Original entry on oeis.org

1, 2, 7, 2, 2, 4, 2, 2, 4, 2, 2, 10, 2, 2, 7, 2, 2, 4, 2, 2, 4, 2, 2, 13, 2, 2, 10, 2, 2, 7, 2, 2, 4, 2, 2, 10, 2, 2, 7, 2, 2, 4, 2, 2, 7, 2, 2, 10, 2, 2, 7, 2, 2, 4, 2, 2, 4, 2, 2, 13, 2, 2, 10, 2, 2, 4, 2, 2, 4, 2, 2, 10, 2, 2, 7, 2, 2, 4, 2, 2, 4, 2, 2, 22, 2, 2, 7, 2, 2, 16, 2, 2, 4, 2, 2, 10, 2, 2, 7, 2
Offset: 1

Views

Author

Reinhard Zumkeller, May 28 2007

Keywords

Comments

First occurrence of 3k+1, k=0.. or 0 if unknown, limit = 2^31: 1, 6, 3, 12, 24, 90, 231, 84, 792, 0, 195, 3432, 780, 0, 3255, 6075, 73644, 51482970, 0, 924, 183540, 0, 45219, 0, 509124, 3842375445, 29259, 71484, 0, 0, 0, 2311539, 238547880, 0, 55380135, 893907420, 23303784, 0, 0, 208260975, 0, 0, 1744264599, 0, 0, 0, 1487657079, 665710275, 0, 0, 1963994955, 0, 319589424, 0, 0, 0, 4181294964, 0, 0, 383229924, ..., . - Robert G. Wilson v, Jun 03 2007

Crossrefs

Cf. A130334.
See A130336 and A130337 for record values and where they occur.

Programs

  • Mathematica
    f[n_] := Block[{k = If[ n == 1 || Mod[n, 3] == 0, 1, 2]}, While[ GCD[n(n + 1)/2, (n + k)(n + k + 1)/2] != 1, k += 3 ]; k]; Array[f, 100] (* Robert G. Wilson v, Jun 03 2007 *)
  • PARI
    a(n) = my(k=1); while (gcd(n*(n+1)/2, (n+k)*(n+k+1)/2) != 1, k++); k;
  • Python
    from math import gcd
    def A130335(n):
        k, Tn, Tm = 1, n*(n+1)//2, (n+1)*(n+2)//2
        while gcd(Tn,Tm) != 1:
            k += 1
            Tm += k+n
        return k # Chai Wah Wu, Sep 16 2021
    

Formula

a(n) = Min{k>0: A050873(A000217(n+k),A000217(n))=1};
a(n) = A130334(n) - n;
a(n) > 1 for n>1; a(n) > 2 iff n mod 3 = 0: a(A001651(n))=2, a(A008585(n)) > 2 for n > 1.
a(n) == 1 (mod 3) if a(n) != 2. - Robert G. Wilson v, Jun 03 2007

A130336 Record values in A130335.

Original entry on oeis.org

1, 2, 7, 10, 13, 22, 31, 37, 58, 79, 82, 94, 109, 118, 157, 178, 193, 214
Offset: 1

Views

Author

Reinhard Zumkeller, May 28 2007

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[ GCD[n(n + 1)/2, (n + k)(n + k + 1)/2] != 1, k++ ]; k]; t = Table[0, {1000}]; Do[a = f@n; If[a < 1001 && t[[a]] == 0, t[[a]] = n; Print[{a, n}], If[a > 1000, Print[{"Over 1000", n}]]], {n, 2^31 - 1}] (* Robert G. Wilson v, Jun 03 2007 *)

Formula

a(n) = A130335(A130337(n)).
A130335(k) < a(n) for k < A130337(n).

Extensions

a(13)-a(16) from Robert G. Wilson v, Jun 03 2007
Added a(17) and corrected a(12) by Chai Wah Wu, Sep 16 2021
a(18) from Chai Wah Wu, Sep 23 2021
Showing 1-2 of 2 results.