cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A264940 Lucky factor of n.

Original entry on oeis.org

0, 2, 0, 2, 3, 2, 0, 2, 0, 2, 3, 2, 0, 2, 0, 2, 3, 2, 7, 2, 0, 2, 3, 2, 0, 2, 9, 2, 3, 2, 0, 2, 0, 2, 3, 2, 0, 2, 7, 2, 3, 2, 0, 2, 13, 2, 3, 2, 0, 2, 0, 2, 3, 2, 15, 2, 9, 2, 3, 2, 7, 2, 0, 2, 3, 2, 0, 2, 0, 2, 3, 2, 0, 2, 0, 2, 3, 2, 0, 2, 7, 2, 3, 2, 21, 2
Offset: 1

Views

Author

Max Barrentine, Dec 09 2015

Keywords

Comments

This sequence is analogous to the smallest prime factor of n (A020639). If n is lucky, a(n)=0; if n is unlucky, a(n) is the number that rejects n from the lucky number sieve. This is 2 for even numbers, and a lucky number >= 3 for odd unlucky numbers.

Crossrefs

Cf. A020639, A271419 (somewhat analogous sequences).

Programs

Formula

From Antti Karttunen, Sep 11 2016: (Start)
If A145649(n) = 1 [when n is lucky], a(n) = 0, else if n is even, a(n) = 2, otherwise a(n) = A000959(A265859(n)) = A000959(A260438(n)).
For n >= 2, a(A219178(n)) = A000959(n).
(End)

Extensions

Formula corrected and comment clarified by Antti Karttunen, Sep 11 2016