OFFSET
1,2
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
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
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 *)
PROG
(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
(PARI) a(n) = my(k=1); while (gcd(n*(n+1)/2, (n+k)*(n+k+1)/2) != 1, k++); k;
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 28 2007
STATUS
approved