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.

Showing 1-10 of 13 results. Next

A000959 Lucky numbers.

Original entry on oeis.org

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
Offset: 1

Views

Author

N. J. A. Sloane; entry updated Mar 07 2008

Keywords

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-Keating (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
The Mersenne primes 2^p - 1 (= A000668, p in A000043) are in this sequence for p = 2, 3, 5, 7, 13, 17, and 19, but not for the following exponents p = 31, 61, and 89. - M. F. Hasler, May 06 2025

References

  • Martin Gardner, Gardner's Workout, Chapter 21 "Lucky Numbers and 2187" pp. 149-156 A. K. Peters MA 2002.
  • 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.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 116.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 114.

Crossrefs

Main diagonal of A258207.
Column 1 of A255545. (cf. also arrays A255543, A255551).
Cf. A050505 (complement).
Cf. A145649 (characteristic function).
Cf. A031883 (first differences), A254967 (iterated absolute differences), see also A054978.
Cf. A109497 (works as a left inverse function).
The Gilbreath transform is A054978 - see also A362460, A362461, A362462.

Programs

  • 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
    
  • Haskell
    -- Also see links.
    (C++) // See Wilson link, Nov 14 2012
    
  • 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; typo fixed by Robert Israel, Nov 19 2014
    # Alternative
    A000959List := proc(mx) local i, L, n, r;
    L:= [seq(2*i+1, i=0..mx)]:
    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 end:
    A000959List(10^3); # 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
    L = Table[2*i + 1, {i, 0, 10^3}]; For[n = 2, n < Length[L], r = L[[n++]]; L = ReplacePart[L, Table[r*i -> Nothing, {i, 1, Length[L]/r}]]]; L (* Jean-François Alcover, Mar 15 2016, after Robert Israel *)
  • PARI
    A000959_upto(nMax)={my(v=vectorsmall(nMax\2,k,2*k-1),i=1,q);while(v[i++]<=#v,v=vecextract(v,2^#v-1-(q=1<M. F. Hasler, Sep 22 2013, improved Jan 20 2020
    
  • Python
    def lucky(n):
        L = list(range(1, n + 1, 2))
        j = 1
        while j <= len(L) - 1 and L[j] <= len(L):
            del L[L[j]-1::L[j]]
            j += 1
        return L
    # Robert FERREOL, Nov 19 2014, corrected by F. Chapoton, Mar 29 2020, performance improved by Ely Golden, Aug 18 2022
    
  • Scheme
    (define (A000959 n) ((rowfun_n_for_A000959sieve n) n)) ;; Code for rowfun_n_for_A000959sieve given in A255543.
    ;; Antti Karttunen, Feb 26 2015

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.
a(n) = A254967(n-1, n-1). - Reinhard Zumkeller, Feb 11 2015
a(n) = A258207(n,n). [Where A258207 is a square array constructed from the numbers remaining after each step described above.] - Antti Karttunen, Aug 06 2015
A145649(a(n)) = 1; complement of A050505. - Reinhard Zumkeller, Oct 15 2008
Other identities 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)

A045954 Even-Lucky-Numbers: generated by a sieve process like that for Lucky numbers but starting with even numbers.

Original entry on oeis.org

2, 4, 6, 10, 12, 18, 20, 22, 26, 34, 36, 42, 44, 50, 52, 54, 58, 68, 70, 76, 84, 90, 98, 100, 102, 108, 114, 116, 118, 130, 132, 138, 140, 148, 150, 164, 170, 172, 178, 182, 186, 196, 198, 212, 214, 218, 228, 230, 234, 244, 246, 260, 262, 268, 278, 282, 290, 298, 300, 308
Offset: 1

Views

Author

Keywords

Comments

Write down even numbers: 2, 4, 6, 8, ...; first term > 2 is 4 so starting from 2 remove every 4th number: 2, 4, 6, 10, 12, 14, 18, ...; next number is 6 so remove every 6th term starting from 2: 2, 4, 6, 10, 12, 18, 20, 22, 26, etc.

Crossrefs

Programs

  • Haskell
    a045954 n = a045954_list !! (n-1)
    a045954_list =  2 : sieve 2 [2,4..] 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
  • Maple
    ## Finds all Even Lucky Numbers up to n from the list 2..n.
    ## Try n=10^5 or 10^6 just for fun!
    evenluckynumbers:=proc(n) local k, Lnext, Lprev; Lprev:=[$2..n]; for k from 1 do Lnext:= map(w-> Lprev[w],remove(z -> z mod Lprev[k] = 0,[$1..nops(Lprev)])); if nops(Lnext)=nops(Lprev) then return Lnext fi; Lprev:=Lnext; od; end: # Walter Kehowski, Jun 06 2008
  • Mathematica
    lst = Range[2, 308, 2]; i = 2; While[ i <= (len = Length@lst) && (k = lst[[i]]) <= len, lst = Drop[lst, {k, len, k}]; i++ ]; lst (* Robert G. Wilson v, May 11 2006 *)

A039673 Twin Fibonacci-lucky numbers.

Original entry on oeis.org

2, 4, 5, 7, 11, 13, 23, 25, 38, 40, 50, 52, 56, 58, 59, 61, 74, 76, 86, 88, 101, 103, 104, 106, 122, 124, 131, 133, 149, 151, 164, 166, 173, 175, 185, 187, 200, 202, 236, 238, 248, 250, 254, 256, 266, 268, 275, 277, 281, 283, 308, 310, 329, 331, 344, 346, 380
Offset: 1

Views

Author

Keywords

Comments

See A039672 for definition.

Crossrefs

Cf. A039672 - Lower terms: A039693, upper terms: A039694, middle terms: A039695.

Programs

  • Maple
    From R. J. Mathar, Oct 10 2010: (Start)
    A039672 := proc(nmax) L := [seq(i,i=1..nmax)] ; for itr from 1 do if itr+1 > nops(L) then return L; end if; str := op(itr,L)+op(itr+1,L) ; for i from floor(nops(L)/str) to 1 by -1 do L := subsop(str*i=NULL,L) ; end do: print(L) ; end do: end proc:
    L := A039672(600) ; for i from 1 to nops(L)-1 do if op(i,L) = op(i+1,L)-2 then printf("%d,%d,",op(i,L),op(i+1,L)) ; fi; end do: (End)

Extensions

Corrected from a(25) on by R. J. Mathar, Oct 10 2010

A039694 Twin Fibonacci-lucky numbers (upper terms).

Original entry on oeis.org

4, 7, 13, 25, 40, 52, 58, 61, 76, 88, 103, 106, 124, 133, 151, 166, 175, 187, 202, 238, 250, 256, 268, 277, 283, 310, 331, 346, 382, 394, 427, 445, 463, 481, 493, 520, 529, 547, 571, 619, 634, 661, 772, 781, 796, 805, 817, 877, 886, 904, 949, 967, 985, 1006
Offset: 1

Views

Author

Keywords

Comments

See A039672 for definition.

Crossrefs

Formula

a(n) = A039693(n)+2. [From R. J. Mathar, Oct 10 2010]

Extensions

Corrected by R. J. Mathar, Oct 10 2010

A039681 Odd Fibonacci-lucky numbers.

Original entry on oeis.org

1, 5, 7, 11, 13, 19, 23, 25, 29, 37, 41, 49, 59, 61, 65, 77, 83, 91, 97, 101, 103, 115, 121, 131, 133, 137, 149, 151, 155, 163, 173, 175, 181, 185, 187, 205, 211, 223, 227, 235, 247, 253, 275, 277, 281, 283, 295, 299, 319, 325, 329, 331, 347, 353, 367, 379, 389
Offset: 1

Views

Author

Keywords

Comments

See A039672 for definition.

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Feb 21 2001

A039695 Twin Fibonacci-lucky numbers (middle terms).

Original entry on oeis.org

3, 6, 12, 24, 39, 51, 57, 60, 75, 87, 102, 105, 123, 132, 150, 165, 174, 186, 201, 237, 249, 255, 267, 276, 282, 309, 330, 345, 381, 393, 426, 444, 462, 480, 492, 519, 528, 546, 570, 618, 633, 660, 771, 780, 795, 804, 816, 876, 885, 903, 948, 966, 984, 1005
Offset: 1

Views

Author

Keywords

Comments

See A039672 for definition.

Crossrefs

Formula

a(n) = A039693(n)+1 = A039694(n)-1. [From R. J. Mathar, Oct 10 2010]

Extensions

Corrected by R. J. Mathar, Oct 10 2010

A039674 Palindromic Fibonacci-lucky numbers.

Original entry on oeis.org

1, 2, 4, 5, 7, 11, 77, 88, 101, 121, 131, 151, 181, 202, 212, 262, 353, 424, 464, 505, 515, 535, 545, 676, 707, 757, 787, 868, 919, 929, 949, 979, 1001, 1661, 2002, 2992, 4334, 5665, 5995, 6226, 8338, 8668, 8888, 9889, 10501, 10801, 11011, 11911, 12721, 13631
Offset: 1

Views

Author

Keywords

Comments

See A039672 for definition.

Extensions

Corrected and extended by Naohiro Nomoto, Oct 28 2001
Single-digit palindromes and more terms from Sean A. Irvine, Feb 21 2021

A039675 Prime Fibonacci-lucky numbers.

Original entry on oeis.org

2, 5, 7, 11, 13, 19, 23, 29, 37, 41, 59, 61, 83, 97, 101, 103, 131, 137, 149, 151, 163, 173, 181, 211, 223, 227, 277, 281, 283, 331, 347, 353, 367, 379, 389, 397, 401, 421, 433, 443, 461, 463, 479, 491, 509, 541, 547, 563, 569, 571, 577, 601, 607, 613, 617
Offset: 1

Views

Author

Keywords

Comments

See A039672 for definition.

Extensions

Corrected and extended by Naohiro Nomoto, Oct 28 2001

A039676 Differences between Fibonacci-lucky numbers.

Original entry on oeis.org

1, 2, 1, 2, 3, 1, 2, 3, 3, 1, 3, 2, 3, 1, 3, 5, 1, 2, 1, 8, 1, 2, 4, 2, 1, 2, 4, 3, 6, 2, 1, 5, 1, 3, 2, 3, 6, 4, 2, 1, 2, 9, 3, 3, 1, 2, 6, 1, 2, 3, 1, 12, 2, 3, 1, 3, 5, 1, 2, 7, 2, 6, 1, 3, 2, 3, 6, 4, 2, 3, 3, 3, 1, 8, 3, 4, 8, 1, 2, 9, 1, 2, 3, 1, 2, 6, 4, 2, 7, 2, 3, 1, 2, 1
Offset: 1

Views

Author

Keywords

Comments

See A039672 for definition.

Extensions

More terms from Naohiro Nomoto, Oct 28 2001

A039677 Partial sums of Fibonacci-lucky numbers.

Original entry on oeis.org

1, 3, 7, 12, 19, 29, 40, 53, 69, 88, 108, 131, 156, 184, 213, 245, 282, 320, 360, 401, 450, 500, 552, 608, 666, 725, 786, 851, 919, 993, 1069, 1146, 1228, 1311, 1397, 1485, 1576, 1673, 1774, 1877, 1981, 2087, 2202, 2320, 2441, 2563, 2687, 2817, 2948, 3081
Offset: 1

Views

Author

Keywords

Comments

See A039672 for definition.

Extensions

Corrected and extended by Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Mar 23 2003
Showing 1-10 of 13 results. Next