login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A265647
Smallest k such that n divides k*(k+1)*(k+2)/6.
4
1, 2, 7, 2, 3, 7, 5, 6, 25, 3, 9, 7, 11, 6, 8, 14, 15, 26, 17, 4, 7, 10, 21, 8, 23, 11, 79, 6, 27, 8, 29, 30, 9, 15, 5, 26, 35, 18, 25, 8, 39, 7, 41, 10, 25, 22, 45, 16, 47, 23, 16, 12, 51, 79, 9, 6, 17, 27, 57, 8, 59, 30, 26, 62, 13, 43, 65, 15, 44, 14, 69, 54, 71, 35, 25, 18, 20, 26, 77, 14, 241
OFFSET
1,2
COMMENTS
More generally we can ask for the smallest k such that gcd(n,f(k)) = n. This sequence has f(k) = k*(k+1)*(k+2)/6. For other examples in the OEIS, see the crossrefencess.
LINKS
MATHEMATICA
Table[k = 1; While[! Divisible[k (k + 1) (k + 2)/6, n], k++]; k, {n, 81}] (* Michael De Vlieger, Dec 11 2015 *)
PROG
(PARI) a(n)=my(k=1); while((k*(k+1)*(k+2)/6)%n>0, k++); k \\ Anders Hellström, Dec 11 2015
(PARI) first(n) = { my(todo = n, i = 1, res = vector(n)); while(todo > 0, d = select(x -> x <= n, divisors(binomial(i + 2, 3))); for(j = 1, #d, if(res[d[j]] == 0, res[d[j]] = i; todo-- ) ); i++ ); res } \\ David A. Corneth, Mar 22 2021
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Dec 11 2015
EXTENSIONS
More terms from Michael De Vlieger, Dec 11 2015
STATUS
approved