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-3 of 3 results.

A339506 Numbers surviving a repeated sieving process for pseudo-lucky numbers (A249876).

Original entry on oeis.org

1, 3, 5, 7, 13, 17, 31, 35, 41, 43, 47, 63, 101, 105, 107, 131, 175, 177, 185, 211, 235, 237, 267, 301, 305, 315, 323, 397, 407, 451, 571, 631, 633, 683, 757, 841, 877, 947, 987, 1043, 1221, 1251, 1431, 1501, 1655, 1781, 1961, 1981, 2023, 2067, 2157, 2197, 2253, 2367, 2457, 2505, 2615
Offset: 1

Views

Author

Lechoslaw Ratajczak, Dec 07 2020

Keywords

Comments

Start with the positive integers as the 1st starting sequence. The 1st full sieving process for the pseudo-lucky numbers begins with the 2nd term in the 1st starting sequence and generates A249876 (the 2nd starting sequence). The n-th full sieving process begins with the (n+1)-th term in the n-th starting sequence and generates the (n+1)-th starting sequence. The numbers that are left form the final sequence.
Let b(m) be the number of elements of this sequence <= m. Let c(m) = round(square(s*m/log(s*m))), where s = 11.
--------------------------------
m | b(m) | c(m) | b(m)-c(m)
--------------------------------
10^2 | 12 | 13 | -1
10^3 | 39 | 34 | +5
10^4 | 103 | 97 | +6
5*10^4 | 210 | 204 | +6
6*10^4 | 228 | 222 | +6
7*10^4 | 236 | 238 | -2
8*10^4 | 256 | 254 | +2
9*10^4 | 270 | 268 | +3
10^5 | 282 | 281 | +1
--------------------------------
Is c(m) an approximation to b(m)?

Examples

			The 1st full sieving process:
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ...
  1 X 3 X 5 X 7 X 9  X 11  X 13  X 15  X 17  X 19  X 21  X 23  X 25 ...
  1   3   5   7   X    11    13    15    17     X    21    23    25 ...
  1   3   5   7        11    13     X    17          21    23    25 ...
Continuing the above procedure generates the 2nd starting sequence (the pseudo-lucky numbers) to begin the 2nd full sieving process:
  1 3 5 7 11 13 17 21 23 25 31 35 41 43 45 47 55 57 63 65 73 75 83 87 95 ...
  1 3 5 7  X 13 17 21 23  X 31 35 41 43  X 47 55 57 63  X 73 75 83 87  X ...
  1 3 5 7    13 17  X 23    31 35 41 43    47  X 57 63    73 75 83 87    ...
  1 3 5 7    13 17    23    31 35 41 43    47     X 63    73 75 83 87    ...
  1 3 5 7    13 17    23    31 35 41 43    47       63    73 75 83  X    ...
Continuing the above procedure generates the 3rd starting sequence to begin the 3rd full sieving process:
  1 3 5 7 13 17 23 31 35 41 43 47 63 73 75 83 101 105 107 123 127 131 151 ...
  1 3 5 7 13 17  X 31 35 41 43 47 63  X 75 83 101 105 107 123   X 131 151 ...
  1 3 5 7 13 17    31 35 41 43 47 63     X 83 101 105 107 123     131 151 ...
  1 3 5 7 13 17    31 35 41 43 47 63       83 101 105 107   X     131 151 ...
Continuing the above procedure generates the 4th starting sequence to begin the 4th full sieving process:
  1 3 5 7 13 17 31 35 41 43 47 63 83 101 105 107 131 151 153 175 177 185 ...
  1 3 5 7 13 17 31 35 41 43 47 63  X 101 105 107 131 151 153 175 177 185 ...
  1 3 5 7 13 17 31 35 41 43 47 63    101 105 107 131   X 153 175 177 185 ...
Continuing the above procedure generates the 5th starting sequence to begin the 5th full sieving process:
  1 3 5 7 13 17 31 35 41 43 47 63 101 105 107 131 153 175 177 185 211 235 ...
  1 3 5 7 13 17 31 35 41 43 47 63 101 105 107 131   X 175 177 185 211 235 ...
...
Continue forever and the numbers not crossed off give the sequence.
		

Crossrefs

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)

A341883 Number of partitions of 2*n+1 into three parts from A339506.

Original entry on oeis.org

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

Views

Author

Lechoslaw Ratajczak, Feb 22 2021

Keywords

Comments

Conjecture: for n > 0 this sequence is always positive (it has been verified up to 10^6).

Examples

			a(0) = 0 because 2*0+1 = 1 is not the sum of 3 terms of A339506.
a(1) = 1 because 2*1+1 = 3 and 3 = 1+1+1 (1 is the term of A339506).
a(2) = 1 because 2*2+1 = 5 and 5 = 1+1+3 (1 and 3 are terms of A339506).
a(3) = 2 because 2*3+1 = 7 and 7 = 1+1+5 = 1+3+3 (1, 3, 5 are terms of A339506).
a(4) = 3 because 2*4+1 = 9 and 9 = 1+1+7 = 1+3+5 = 3+3+3 (1, 3, 5, 7 are terms of A339506).
		

Crossrefs

Showing 1-3 of 3 results.