OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
4 is a term since 4, 5 and 6 are all Catalan-Niven numbers: the Catalan representation of 4, A014418(20) = 20, has the sum of digits 2+0 = 2 and 4 is divisible by 2, the Catalan representation of 5, A014418(5) = 100, has the sum of digits 1+0+0 = 1 and 5 is divisible by 1, and the Catalan representation of 6, A014418(6) = 101, has the sum of digits 1+0+1 = 2 and 6 is divisible by 2.
MATHEMATICA
c[n_] := c[n] = CatalanNumber[n]; catNivQ[n_] := Module[{s = {}, m = n, i}, While[m > 0, i = 1; While[c[i] <= m, i++]; i--; m -= c[i]; AppendTo[s, i]]; Divisible[n, Plus @@ IntegerDigits[Total[4^(s - 1)], 4]]]; seq[count_, nConsec_] := Module[{cn = catNivQ /@ Range[nConsec], s = {}, c = 0, k = nConsec + 1}, While[c < count, If[And @@ cn, c++; AppendTo[s, k - nConsec]]; cn = Join[Rest[cn], {catNivQ[k]}]; k++]; s]; seq[30, 3]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Mar 19 2022
STATUS
approved