login
A192490
Characteristic function of ludic numbers (A003309).
23
1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0
OFFSET
1
COMMENTS
a(A003309(n)) = 1 and a(A192607(n)) = 0.
MATHEMATICA
a3309[nmax_] := a3309[nmax] = Module[{t = Range[2, nmax], k, r = {1}},
While[Length[t] > 0, k = First[t]; AppendTo[r, k];
t = Drop[t, {1, -1, k}]]; r];
ludicQ[n_, nmax_] /; 1 <= n <= nmax := MemberQ[a3309[nmax], n];
nmax = 100;
a[n_] := Boole[ludicQ[n, nmax]];
Array[a, nmax] (* Jean-François Alcover, Dec 09 2021, after Ray Chandler in A003309 *)
PROG
(Haskell) a192490 n = a192490_list !! (n-1)
a192490_list = ch [1..] a003309_list where
ch (i:is) ls'@(l:ls) = if i == l then 1 : ch is ls else 0 : ch is ls'
-- Reinhard Zumkeller, Feb 10 2014, Jul 05 2011
CROSSREFS
Cf. A192512 (partial sums).
Sequence in context: A336868 A083187 A187036 * A267133 A080339 A294905
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 05 2011
STATUS
approved