OFFSET
1,1
COMMENTS
Let t(d,k) be the number of digits d in the base-7 representation of k. Then k is a term if and only if t(4,k) = t(5,k) = t(6,k) = 0, t(1,k) is divisible by 3 and t(2,k) + t(3,k) is even. This follows from Lucas's theorem on binomial coefficients.
If k is a term then so are 7*k, 49*k + 16, 49*k + 17, 49*k + 23, 49*k + 24 and 343*k + 57.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Wikipedia, Lucas's theorem
EXAMPLE
a(3) = 23 is a term because C(46,23) = 8233430727600 and 8233430727600 == 1 (mod 7).
MAPLE
filter:= proc(n) local L;
L:= convert(n, base, 7);
max(L) <= 3 and numboccur(1, L) mod 3 = 0 and (numboccur(2, L) + numboccur(3, L))::even
end proc:
select(filter, [$1..10000]);
MATHEMATICA
Select[Range[3000], Mod[Binomial[2#, #], 7]==1&] (* Stefano Spezia, Jul 11 2024 *)
PROG
(Python)
from itertools import count, islice
from gmpy2 import digits
def A374559_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n: max(d:=digits(n, 7))<='3' and not (d.count('1')%3 or (d.count('2')^d.count('3'))&1), count(max(startvalue, 1)))
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Robert Israel, Jul 11 2024
STATUS
approved
