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

A258208 Transpose of array A258207 which gives the numbers remaining after the stage n of Lucky sieve.

Original entry on oeis.org

1, 1, 3, 1, 3, 5, 1, 3, 7, 7, 1, 3, 7, 9, 9, 1, 3, 7, 9, 13, 11, 1, 3, 7, 9, 13, 15, 13, 1, 3, 7, 9, 13, 15, 19, 15, 1, 3, 7, 9, 13, 15, 21, 21, 17, 1, 3, 7, 9, 13, 15, 21, 25, 25, 19, 1, 3, 7, 9, 13, 15, 21, 25, 27, 27, 21, 1, 3, 7, 9, 13, 15, 21, 25, 31, 31, 31, 23, 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 33, 33, 25, 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 37, 37, 27, 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 43, 39, 29
Offset: 1

Views

Author

Antti Karttunen, Jul 27 2015

Keywords

Comments

See comments in A258207.

Examples

			The top left corner of the array:
   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1
   3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3
   5,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7
   7,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9
   9, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13
  11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15
  13, 19, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21
  15, 21, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25
  17, 25, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31
  19, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33
  21, 31, 33, 37, 37, 37, 37, 37, 37, 37, 37, 37
  23, 33, 37, 43, 43, 43, 43, 43, 43, 43, 43, 43
  ...
		

Crossrefs

Transpose of A258207.
Main diagonal: A000959 (the Lucky numbers).

Programs

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)

A260717 Square array: row n gives the numbers remaining before the stage n of Ludic sieve.

Original entry on oeis.org

2, 3, 3, 4, 5, 5, 5, 7, 7, 7, 6, 9, 11, 11, 11, 7, 11, 13, 13, 13, 13, 8, 13, 17, 17, 17, 17, 17, 9, 15, 19, 23, 23, 23, 23, 23, 10, 17, 23, 25, 25, 25, 25, 25, 25, 11, 19, 25, 29, 29, 29, 29, 29, 29, 29, 12, 21, 29, 31, 37, 37, 37, 37, 37, 37, 37, 13, 23, 31, 37, 41, 41, 41, 41, 41, 41, 41, 41, 14, 25, 35, 41, 43, 43, 43, 43, 43, 43, 43, 43, 43
Offset: 1

Views

Author

Antti Karttunen, Jul 30 2015

Keywords

Comments

This square array A(row,col) is read by downwards antidiagonals as: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
Ludic sieve starts with natural numbers larger than one: 2, 3, 4, 5, 6, 7, ... and in each subsequent stage one sets k = (which will be one of Ludic numbers) and removes both k and every k-th term after it, from column positions 1, 1+k, 1+2k, 1+3k, etc. of the preceding row to produce the next row of this array.

Examples

			The top left corner of the array:
   2,  3,  4,  5,  6,  7,  8,  9,  10,  11,  12,  13,  14,  15,  16,  17
   3,  5,  7,  9, 11, 13, 15, 17,  19,  21,  23,  25,  27,  29,  31,  33
   5,  7, 11, 13, 17, 19, 23, 25,  29,  31,  35,  37,  41,  43,  47,  49
   7, 11, 13, 17, 23, 25, 29, 31,  37,  41,  43,  47,  53,  55,  59,  61
  11, 13, 17, 23, 25, 29, 37, 41,  43,  47,  53,  55,  61,  67,  71,  73
  13, 17, 23, 25, 29, 37, 41, 43,  47,  53,  61,  67,  71,  73,  77,  83
  17, 23, 25, 29, 37, 41, 43, 47,  53,  61,  67,  71,  77,  83,  89,  91
  23, 25, 29, 37, 41, 43, 47, 53,  61,  67,  71,  77,  83,  89,  91,  97
  25, 29, 37, 41, 43, 47, 53, 61,  67,  71,  77,  83,  89,  91,  97, 107
  29, 37, 41, 43, 47, 53, 61, 67,  71,  77,  83,  89,  91,  97, 107, 115
  37, 41, 43, 47, 53, 61, 67, 71,  77,  83,  89,  91,  97, 107, 115, 119
  41, 43, 47, 53, 61, 67, 71, 77,  83,  89,  91,  97, 107, 115, 119, 121
  43, 47, 53, 61, 67, 71, 77, 83,  89,  91,  97, 107, 115, 119, 121, 127
  47, 53, 61, 67, 71, 77, 83, 89,  91,  97, 107, 115, 119, 121, 127, 131
  53, 61, 67, 71, 77, 83, 89, 91,  97, 107, 115, 119, 121, 127, 131, 143
  61, 67, 71, 77, 83, 89, 91, 97, 107, 115, 119, 121, 127, 131, 143, 149
  etc.
		

Crossrefs

Transpose: A260718.
Column 1: A003309 (without the initial 1).
Row 1: A020725, Row 2: A144396, Row 3: A007310 (from its second term onward), Row 4: A260714, Row 5: A260715.
Cf. A255127 (gives the numbers removed at each stage).
Cf. also array A258207.

Programs

  • Scheme
    (define (A260717 n) (A260717bi (A002260 n) (A004736 n)))
    (define (A260717bi row col) ((rowfun_n_for_A003309sieve row) col))
    (define (add1 n) (1+ n))
    ;; Uses definec-macro which can memoize also function-closures:
    (definec (rowfun_n_for_A003309sieve n) (if (= 1 n) add1 (let* ((prevrowfun (rowfun_n_for_A003309sieve (- n 1))) (everynth (prevrowfun 1))) (compose-funs prevrowfun (nonzero-pos 1 1 (lambda (i) (modulo (- i 1) everynth)))))))

A278492 Square array where row n (n >= 0) gives the numbers remaining after the n-th round of the Flavius sieve, read by descending antidiagonals.

Original entry on oeis.org

1, 2, 1, 3, 3, 1, 4, 5, 3, 1, 5, 7, 7, 3, 1, 6, 9, 9, 7, 3, 1, 7, 11, 13, 13, 7, 3, 1, 8, 13, 15, 15, 13, 7, 3, 1, 9, 15, 19, 19, 19, 13, 7, 3, 1, 10, 17, 21, 25, 25, 19, 13, 7, 3, 1, 11, 19, 25, 27, 27, 27, 19, 13, 7, 3, 1, 12, 21, 27, 31, 31, 31, 27, 19, 13, 7, 3, 1, 13, 23, 31, 37, 39, 39, 39, 27, 19, 13, 7, 3, 1
Offset: 0

Views

Author

Antti Karttunen, Nov 23 2016, after David W. Wilson's posting on SeqFan-list Nov 22 2016

Keywords

Comments

The terms of square array A(row,col) are read by descending antidiagonals as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ...

Examples

			The top left corner of the array:
1, 2, 3,  4,  5,  6,  7,  8,  9, 10 (row 0: start from A000027)
1, 3, 5,  7,  9, 11, 13, 15, 17, 19 (after the 1st round, A005408 remain)
1, 3, 7,  9, 13, 15, 19, 21, 25, 27 (after the 2nd, A047241)
1, 3, 7, 13, 15, 19, 25, 27, 31, 37
1, 3, 7, 13, 19, 25, 27, 31, 39, 43
1, 3, 7, 13, 19, 27, 31, 39, 43, 49
1, 3, 7, 13, 19, 27, 39, 43, 49, 61
1, 3, 7, 13, 19, 27, 39, 49, 61, 63
1, 3, 7, 13, 19, 27, 39, 49, 63, 67
1, 3, 7, 13, 19, 27, 39, 49, 63, 79
		

Crossrefs

One more than A278482.
Transpose: A278493.
Main diagonal: A000960.
Cf. A278507 (the numbers removed at each round).
Similarly constructed arrays for other sieves: A258207, A260717.

Programs

Formula

A(n,k) = 1 + A278482(n,k).

A258011 Numbers remaining after the third stage of Lucky sieve.

Original entry on oeis.org

1, 3, 7, 9, 13, 15, 21, 25, 27, 31, 33, 37, 43, 45, 49, 51, 55, 57, 63, 67, 69, 73, 75, 79, 85, 87, 91, 93, 97, 99, 105, 109, 111, 115, 117, 121, 127, 129, 133, 135, 139, 141, 147, 151, 153, 157, 159, 163, 169, 171, 175, 177, 181, 183, 189, 193, 195, 199, 201, 205, 211, 213, 217, 219, 223, 225, 231, 235, 237, 241, 243, 247, 253, 255
Offset: 1

Views

Author

Antti Karttunen, Jul 27 2015

Keywords

Comments

Equal to A047241 with its every seventh term (A258016) removed.
Numbers congruent to {1, 3, 7, 9, 13, 15, 21, 25, 27, 31, 33, 37} modulo 42. - Jianing Song, Apr 27 2022

Crossrefs

Row 3 of A258207.
Setwise difference of A047241 \ A258016.
Cf. also A260440 (Every ninth term).

Programs

  • Maple
    gf := (x*(1 + x*(2 + x*(4 + x*(2 + x*(4 + x*(2 + x*(6 + x*(4 + x*(2 + x*(4 + x*(2 + x*(4 + 5*x)))))))))))))/(1 - x*(1 + (1 - x)*x^11)): ser:= series(gf, x, 112):
    seq(coeff(ser, x, k), k = 1..74); # Peter Luschny, Apr 29 2022
  • Scheme
    (define (A258011 n) (A258207bi 3 n)) ;; A258207bi given in A258207.

Formula

From Jianing Song, Apr 27 2022: (Start)
a(n) = a(n-12) + 42.
a(n) = a(n-1) + a(n-12) - a(n-13).
G.f.:(x+2*x^2+4*x^3+2*x^4+4*x^5+2*x^6+6*x^7+4*x^8+2*x^9+4*x^10+2*x^11+4*x^12+5*x^13)/(1-x-x^12+x^13). (End)
Showing 1-5 of 5 results.