login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A192490 Characteristic function of ludic numbers (A003309). 23

%I #15 Dec 09 2021 14:43:17

%S 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,

%T 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,

%U 0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0

%N Characteristic function of ludic numbers (A003309).

%C a(A003309(n)) = 1 and a(A192607(n)) = 0.

%H Reinhard Zumkeller, <a href="/A192490/b192490.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%t a3309[nmax_] := a3309[nmax] = Module[{t = Range[2, nmax], k, r = {1}},

%t While[Length[t] > 0, k = First[t]; AppendTo[r, k];

%t t = Drop[t, {1, -1, k}]]; r];

%t ludicQ[n_, nmax_] /; 1 <= n <= nmax := MemberQ[a3309[nmax], n];

%t nmax = 100;

%t a[n_] := Boole[ludicQ[n, nmax]];

%t Array[a, nmax] (* _Jean-François Alcover_, Dec 09 2021, after _Ray Chandler_ in A003309 *)

%o (Haskell) a192490 n = a192490_list !! (n-1)

%o a192490_list = ch [1..] a003309_list where

%o ch (i:is) ls'@(l:ls) = if i == l then 1 : ch is ls else 0 : ch is ls'

%o -- _Reinhard Zumkeller_, Feb 10 2014, Jul 05 2011

%Y Cf. A192512 (partial sums).

%K nonn

%O 1

%A _Reinhard Zumkeller_, Jul 05 2011

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 07:22 EDT 2024. Contains 371922 sequences. (Running on oeis4.)