|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
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]];
|
|
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'
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|