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!)
A145649 Characteristic function of the lucky numbers. 17
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Is there an efficient formula for this sequence? To wit, is there an algorithm for determining whether n is a lucky or unlucky number which is substantially faster than determining the lucky numbers up to n? - Charles R Greathouse IV, Nov 24 2021
LINKS
Eric Weisstein's World of Mathematics, Lucky Numbers
FORMULA
a(A000959(n)) = 1, a(A050505(n)) = 0.
MATHEMATICA
luckies = 2 Range[0, 100] + 1;
Module[{k, r}, For[k = 2, k<Length[luckies], r = luckies[[k++]]; luckies = ReplacePart[luckies, Table[r*i -> 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 *)
PROG
(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
CROSSREFS
Cf. A000959 (lucky numbers), A050505 (complement: unlucky numbers).
See also A010051, A192490.
Sequence in context: A015605 A015437 A015101 * A016340 A014021 A015725
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Oct 15 2008
STATUS
approved

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 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)