login
Characteristic function of numbers having a valid Luhn mod 10 check digit.
3

%I #7 Oct 10 2019 09:58:19

%S 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,

%T 1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,

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

%N Characteristic function of numbers having a valid Luhn mod 10 check digit.

%C a(A093018(n)) = 1; a(A249830(n)) = 0;

%C a(n) = if A093017(n) mod 10 = 0 then 1 else 0.

%H Reinhard Zumkeller, <a href="/A249832/b249832.txt">Table of n, a(n) for n = 0..10000</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Luhn_algorithm">Luhn algorithm</a>

%H <a href="/index/De#decimal_expansion">Index entries for sequences related to decimal expansion of n</a>

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

%F a(n) = A000007(A093017(n) mod 10).

%o (Haskell)

%o a249832 = (0 ^) . flip mod 10 . a093017

%Y Cf. A093017, A000007, A093018, A249830.

%K nonn,base

%O 0

%A _Reinhard Zumkeller_, Nov 08 2014