A145649 Characteristic function of the lucky numbers.
1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..100005
- Eric Weisstein's World of Mathematics, Lucky Numbers
- Index entries for characteristic functions
- Index entries for sequences generated by sieves
Crossrefs
Programs
-
Mathematica
luckies = 2 Range[0, 100] + 1; Module[{k, r}, For[k = 2, k
Nothing, {i, 1, Length[luckies]/r}]]]]; a[n_ /; 1 <= n <= Last[luckies]] := Boole[MemberQ[luckies, n]]; Table[a[n], {n, 1, Last[luckies]}] (* Jean-François Alcover, Oct 18 2021, after Robert Israel in A000959 *) -
PARI
A145649list(up_to) = { my(u=A000959_upto(up_to), v=vector(up_to)); for(i=1,#u,v[u[i]] = 1); (v); }; \\ See there for A000959_upto(). - Antti Karttunen, Sep 27 2019
Comments