login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A000959 Lucky numbers.
(Formerly M2616 N1035)
243
1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, 69, 73, 75, 79, 87, 93, 99, 105, 111, 115, 127, 129, 133, 135, 141, 151, 159, 163, 169, 171, 189, 193, 195, 201, 205, 211, 219, 223, 231, 235, 237, 241, 259, 261, 267, 273, 283, 285, 289, 297, 303 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

An interesting general discussion of the phenomenon of 'random primes' (generalizing the lucky numbers) occurs in Hawkins (1958). Heyde (1978) proves that Hawkins' random primes do not only almost always satisfy the Prime Number Theorem but also the Riemann Hypothesis. - Alf van der Poorten, Jun 27 2002

Bui and Keating establish an asymptotic formula for the number of k-difference twin primes, and more generally to all l-tuples, of Hawkins primes, a probabilistic model of the Eratosthenes sieve. The formula for k = 1 was obtained by Wunderlich [Acta Arith. 26 (1974), 59 - 81]. - Jonathan Vos Post, Mar 24 2009. (This is quoted from the abstract of the Bui-Heating (2006) article, Joerg Arndt, Jan 04 2014)

It appears that a 1's line is formed, as in the Gilbreath's conjecture, if we use 2 (or 4), 3, 5 (differ of 7), 9, 13, 15, 21, 25,... instead of A000959 1, 3, 7, 9, 13, 15, 21, 25, ... - Eric Desbiaux, Mar 25 2010

a(n) = A254967(n-1,n-1). - Reinhard Zumkeller, Feb 11 2015

REFERENCES

Martin Gardner, Gardner's Workout, Chapter 21 "Lucky Numbers and 2187" pp. 149-156 A. K. Peters MA 2002.

Verna Gardiner, R. Lazarus, N. Metropolis, S. Ulam. "On certain sequences of integers defined by sieves". Mathematics Magazine 29 (3): 117-122, 1956. doi:10.2307/3029719. ISSN 0025-570X. Zbl 0071.27002.

Richard K. Guy, Unsolved Problems in Number Theory, C3.

C. S. Ogilvy, Tomorrow's Math. 2nd ed., Oxford Univ. Press, 1972, p. 99.

N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

M. L. Stein and P. R. Stein, Tables of the Number of Binary Decompositions of All Even Numbers Less Than 200,000 into Prime Numbers and Lucky Numbers. Report LA-3106, Los Alamos Scientific Laboratory of the University of California, Los Alamos, NM, Sep 1964.

David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 114.

LINKS

T. D. Noe, R. J. Mathar, and Hugo v. d. Sanden, Table of n, a(n) for n = 1..200000 (first 10000 terms from T. D. Noe. Terms up to 30981 by R. J. Mathar)

H. M. Bui, J. P. Keating, On twin primes associated with the Hawkins random sieve, version 2, Mar 24, 2009. J. Number Theory 119 (2006), 284-296.

Vema Gardiner, R. Lazarus, N. Metropolis and S. Ulam, On certain sequences of integers defined by sieves, Math. Mag., 29 (1955), 117-119.

Martin Gardner, Lucky numbers and 2187, Math. Intellig., 19 (No. 2, 1997), 26-29.

David Hawkins, The random sieve, Math. Mag. 31 (1958), 1-3.

D. Hawkins and W. E. Briggs, The lucky number theorem, Math. Mag. 31 1958 81-84.

C. C. Heyde, A Log Log Improvement to the Riemann Hypothesis for the Hawkins Random Sieve, Ann. Probability, 6 (1978), 850-875.

Ivars Peterson, MathTrek, Martin Gardner's Lucky Numbers (archived on Archive.org)

Ivars Peterson, Martin Gardner's Lucky Numbers (archived on Wikiwix.com)

Popular Computing (Calabasas, CA), Sieves: Problem 43, Vol. 2 (No. 13, Apr 1974), pp. 6-7. This is Sieve #7. [Annotated and scanned copy]

Walter Schneider, Lucky Numbers

Torsten Sillke, S. M. Ulam's Lucky Numbers

Hugo van der Sanden, Lucky numbers up to 1e8

G. Villemin's Almanach of Numbers, Nombre Chanceux

Eric Weisstein's World of Mathematics, Lucky number.

Wikipedia, Lucky number

David W. Wilson, Fast space-efficient sequence generating program in C++

Index entries for "core" sequences

Index entries for sequences generated by sieves [From Reinhard Zumkeller, Oct 15 2008]

FORMULA

Start with the natural numbers. Delete every 2nd number, leaving 1 3 5 7 ...; the 2nd number remaining is 3, so delete every 3rd number, leaving 1 3 7 9 13 15 ...; now delete every 7th number, leaving 1 3 7 9 13 ...; now delete every 9th number; etc.

Other identities:

A145649(a(n)) = 1; complement of A050505. - Reinhard Zumkeller, Oct 15 2008

From Antti Karttunen, Feb 26 2015: (Start)

For all n >= 1, A109497(a(n)) = n.

For all n >= 1, a(n) = A000040(n) + A032600(n).

For all n >= 2, a(n) = A255553(A000040(n)).

(End)

MAPLE

## luckynumbers(n) returns all lucky numbers from 1 to n. ## Try n=10^5 just for fun. luckynumbers:=proc(n) local k, Lnext, Lprev; Lprev:=[$1..n]; for k from 1 do if k=1 or k=2 then Lnext:= map(w-> Lprev[w], remove(z -> z mod Lprev[2] = 0, [$1..nops(Lprev)])); if nops(Lnext)=nops(Lprev) then break fi; Lprev:=Lnext; else Lnext:= map(w-> Lprev[w], remove(z -> z mod Lprev[k] = 0, [$1..nops(Lprev)])); if nops(Lnext)=nops(Lprev) then break fi; Lprev:=Lnext; fi; od; return Lnext; end: # Walter Kehowski, Jun 05 2008

# Alternative

L:= [seq(2*i+1, i=0..10^3)]:

for n from 2 while n < nops(L) do

  r:= L[n];

  L:= subsop(seq(r*i=NULL, i=1..nops(L)/r), L);

od:

L; # Robert Israel, Nov 19 2014

MATHEMATICA

luckies = 2*Range@200 - 1; f[n_] := Block[{k = luckies[[n]]}, luckies = Delete[luckies, Table[{k}, {k, k, Length@luckies, k}]]]; Do[f@n, {n, 2, 30}]; luckies (* Robert G. Wilson v, May 09 2006 *)

sieveMax = 10^6; luckies = Range[1, sieveMax, 2]; sieve[n_] := Module[{k = luckies[[n]]}, luckies = Delete[luckies, Table[{i}, {i, k, Length[luckies], k}]]]; n = 1; While[luckies[[n]] < Length[luckies], n++; sieve[n]]; luckies

PROG

(Haskell)

a000959 n = a000959_list !! (n-1)

a000959_list =  1 : sieve 2 [1, 3..] where

   sieve k xs = z : sieve (k + 1) (lucky xs) where

      z = xs !! (k - 1 )

      lucky ws = us ++ lucky vs where

            (us, _:vs) = splitAt (z - 1) ws

-- Reinhard Zumkeller, Dec 05 2011

(PARI) A000959(nMax)={my(v=vector(nMax, i, i), i, k); while(v[i=!k+k++]<=#v, v=vecextract(v, 2^#v-1-sum(j=1, #v\v[i], 2^(v[i]*j-1)))); v} \\ M. F. Hasler, Sep 22 2013

(Python)

def lucky(n):

...L=list(range(1, n+1, 2)); j=1

...while L[j] <= len(L)-1:

......L=[L[i] for i in range(len(L)) if (i+1)%L[j]!=0]

......j+=1

...return(L)

Robert FERREOL, Nov 19 2014

(Scheme)

(define (A000959 n) ((rowfun_n_for_A000959sieve n) n)) ;; Code for rowfun_n_for_A000959sieve given in A255543.

;; Antti Karttunen, Feb 26 2015

CROSSREFS

Column 1 of A255545. (cf. also arrays A255543, A255551).

Cf. A050505 (complement).

Cf. A145649 (characteristic function).

Cf. A137164-A137185, A039672, A045954, A249876.

Cf. A031883 (first differences), A254967 (iterated absolute differences), see also A054978.

Cf. A109497 (works as an left inverse function).

Cf. also A000040, A003309, A032600, A219178, A255553.

Sequence in context: A172367 A024901 A258011 * A204085 A230076 A120226

Adjacent sequences:  A000956 A000957 A000958 * A000960 A000961 A000962

KEYWORD

nonn,easy,nice,core

AUTHOR

N. J. A. Sloane. Entry updated Mar 07 2008

EXTENSIONS

Typo in Walter Kehowski's Maple program fixed by Robert Israel, Nov 19 2014

STATUS

approved

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

Content is available under The OEIS End-User License Agreement .

Last modified August 2 18:07 EDT 2015. Contains 260251 sequences.