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

A003309 Ludic numbers: apply the same sieve as Eratosthenes, but cross off every k-th remaining number.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 23, 25, 29, 37, 41, 43, 47, 53, 61, 67, 71, 77, 83, 89, 91, 97, 107, 115, 119, 121, 127, 131, 143, 149, 157, 161, 173, 175, 179, 181, 193, 209, 211, 221, 223, 227, 233, 235, 239, 247, 257, 265, 277, 283, 287, 301, 307, 313
Offset: 1

Views

Author

Keywords

Comments

The definition can obviously only be applied from k = a(2) = 2 on: for k = 1, all remaining numbers would be deleted. - M. F. Hasler, Nov 02 2024

References

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

Crossrefs

Without the initial 1 occurs as the leftmost column in arrays A255127 and A260717.
Cf. A003310, A003311, A100464, A100585, A100586 (variants).
Cf. A192503 (primes in sequence), A192504 (nonprimes), A192512 (number of terms <= n).
Cf. A192490 (characteristic function).
Cf. A192607 (complement).
Cf. A260723 (first differences).
Cf. A255420 (iterates of f(n) = A003309(n+1) starting from n=1).
Subsequence of A302036.
Cf. A237056, A237126, A237427, A235491, A255407, A255408, A255421, A255422, A260435, A260436, A260741, A260742 (permutations constructed from Ludic numbers).
Cf. also A000959, A008578, A255324, A254100, A272565 (Ludic factor of n), A297158, A302032, A302038.
Cf. A376237 (ludic factorial: cumulative product), A376236 (ludic Fortunate numbers).

Programs

  • Haskell
    a003309 n = a003309_list !! (n - 1)
    a003309_list = 1 : f [2..] :: [Int]
       where f (x:xs) = x : f (map snd [(u, v) | (u, v) <- zip [1..] xs,
                                                 mod u x > 0])
    -- Reinhard Zumkeller, Feb 10 2014, Jul 03 2011
    
  • Maple
    ludic:= proc(N) local i, k,S,R;
      S:= {$2..N};
      R:= 1;
      while nops(S) > 0 do
        k:= S[1];
        R:= R,k;
        S:= subsop(seq(1+k*j=NULL, j=0..floor((nops(S)-1)/k)),S);
      od:
    [R];
    end proc:
    ludic(1000); # Robert Israel, Feb 23 2015
  • Mathematica
    t = Range[2, 400]; r = {1}; While[Length[t] > 0, k = First[t]; AppendTo[r, k]; t = Drop[t, {1, -1, k}];]; r (* Ray Chandler, Dec 02 2004 *)
  • PARI
    t=vector(399,x,x+1); r=[1]; while(length(t)>0, k=t[1];r=concat(r,[k]);t=vector((length(t)*(k-1))\k,x,t[(x*k+k-2)\(k-1)])); r \\ Phil Carmody, Feb 07 2007
    
  • PARI
    A3309=[1]; next_A003309(n)=nn && break); n+!if(n=setsearch(A3309,n+1,1),return(A3309[n])) \\ Should be made more efficient if n >> max(A3309). - M. F. Hasler, Nov 02 2024
    {A003309(n) = while(n>#A3309, next_A003309(A3309[#A3309])); A3309[n]} \\ Should be made more efficient in case n >> #A3309. - M. F. Hasler, Nov 03 2024
    
  • PARI
    upto(nn)= my(r=List([1..nn]), p=1); while(p++<#r, my(k=r[p], i=p); while((i+=k)<=#r, listpop(~r, i); i--)); Vec(r); \\ Ruud H.G. van Tol, Dec 13 2024
    
  • Python
    remainders = [0]
    ludics = [2]
    N_MAX = 313
    for i in range(3, N_MAX) :
        ludic_index = 0
        while ludic_index < len(ludics) :
            ludic = ludics[ludic_index]
            remainder = remainders[ludic_index]
            remainders[ludic_index] = (remainder + 1) % ludic
            if remainders[ludic_index] == 0 :
                break
            ludic_index += 1
        if ludic_index == len(ludics) :
            remainders.append(0)
            ludics.append(i)
    ludics = [1] + ludics
    print(ludics)
    # Alexandre Herrera, Aug 10 2023
    
  • Python
    def A003309(): # generator of the infinite list of ludic numbers
        L = [2, 3]; yield 1; yield 2; yield 3
        while k := len(L)//2: # could take min{k | k >= L[-1-k]-1}
            for j in L[-1-k::-1]: k += 1 + k//(j-1)
            L.append(k+2); yield k+2
    A003309_upto = lambda N=99: [t for t,_ in zip(A003309(),range(N))]
    # M. F. Hasler, Nov 02 2024
  • Scheme
    (define (A003309 n) (if (= 1 n) n (A255127bi (- n 1) 1))) ;; Code for A255127bi given in A255127.
    ;; Antti Karttunen, Feb 23 2015
    

Formula

Complement of A192607; A192490(a(n)) = 1. - Reinhard Zumkeller, Jul 05 2011
From Antti Karttunen, Feb 23 2015: (Start)
a(n) = A255407(A008578(n)).
a(n) = A008578(n) + A255324(n).
(End)

Extensions

More terms from David Applegate and N. J. A. Sloane, Nov 23 2004

A260742 Permutation of natural numbers: a(1) = 1, for n > 1: a(n) = A255551(A260738(n), a(A260739(n))).

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 9, 8, 5, 14, 13, 12, 15, 18, 11, 16, 21, 10, 19, 28, 17, 26, 25, 24, 31, 30, 35, 36, 33, 22, 27, 32, 29, 42, 39, 20, 37, 38, 47, 56, 43, 34, 49, 52, 41, 50, 51, 48, 61, 62, 23, 60, 63, 70, 45, 72, 77, 66, 57, 44, 67, 54, 71, 64, 123, 58, 69, 84, 65, 78, 73, 40, 55, 74, 83, 76, 75, 94, 103, 112, 101, 86, 79, 68, 91, 98, 59, 104, 87, 82, 93, 100, 89, 102
Offset: 1

Views

Author

Antti Karttunen, Jul 30 2015

Keywords

Comments

This is a more recursed variant of A260436.

Crossrefs

Inverse: A260741.
Similar permutations: A260436, A250245, A250246.

Formula

a(1) = 1, for n > 1: a(n) = A255551(A260738(n), a(A260739(n))).
Other identities. For all n >= 1:
a(A003309(n+2)) = A000959(n+1). [Maps odd Ludic numbers to Lucky numbers.]
a(n) = a(2n)/2. [The even bisection halved gives the sequence back.]

A260435 Permutation mapping from Lucky sieve to Ludic sieve: a(1) = 1, for n > 1: a(n) = A255127(A260438(n), A260439(n)).

Original entry on oeis.org

1, 2, 3, 4, 9, 6, 5, 8, 7, 10, 15, 12, 11, 14, 13, 16, 21, 18, 19, 20, 17, 22, 27, 24, 23, 26, 31, 28, 33, 30, 25, 32, 29, 34, 39, 36, 37, 38, 35, 40, 45, 42, 41, 44, 55, 46, 51, 48, 43, 50, 47, 52, 57, 54, 73, 56, 59, 58, 63, 60, 49, 62, 53, 64, 69, 66, 61, 68, 67, 70, 75, 72, 71, 74, 77, 76, 81, 78, 83, 80, 65, 82, 87, 84, 101, 86, 89, 88
Offset: 1

Views

Author

Antti Karttunen, Jul 30 2015

Keywords

Comments

a(n) tells which number in array A255127 (constructed from Ludic sieve) is at the same position where n is in array A255551 (constructed from Lucky sieve). This permutation fixes all even numbers because both arrays have A005843 as their topmost row.

Crossrefs

Inverse: A260436.
Similar or related permutations: A255407, A255552, A255554, A249817, A249818, A260741 (a more recursed variant).

Programs

Formula

Other identities. For all n >= 1:
a(A000959(n+1)) = A003309(n+2). [Maps Lucky numbers to odd Ludic numbers.]
a(2n) = 2n.
As a composition of related permutations:
a(n) = A255127(A255552(n)).
a(n) = A255407(A255554(n)).

A258016 Unlucky numbers removed at the stage three of Lucky sieve.

Original entry on oeis.org

19, 39, 61, 81, 103, 123, 145, 165, 187, 207, 229, 249, 271, 291, 313, 333, 355, 375, 397, 417, 439, 459, 481, 501, 523, 543, 565, 585, 607, 627, 649, 669, 691, 711, 733, 753, 775, 795, 817, 837, 859, 879, 901, 921, 943, 963, 985, 1005, 1027, 1047, 1069, 1089, 1111, 1131, 1153, 1173, 1195, 1215, 1237, 1257, 1279, 1299, 1321, 1341, 1363, 1383, 1405
Offset: 1

Views

Author

Antti Karttunen, Jul 27 2015

Keywords

Comments

Numbers congruent to 19 or 39 modulo 42. - Jianing Song, Apr 27 2022

Crossrefs

Row 3 of A255543. Every seventh term of A047241.
Cf. also A258011.

Formula

a(n) = A047241(7*n).
a(n) = A260436(A255413(1+n)).
From Jianing Song, Apr 27 2022: (Start)
a(n) = a(n-2) + 42.
a(n) = a(n-1) + a(n-2) - a(n-3).
G.f.: (19*x+20*x^2+3*x^3)/(1-x-x^2+x^3).
E.g.f.: 3 + (21*x-3)*cosh(x) + (21*x-2)*sinh(x). (End)

A260440 Unlucky numbers removed at the stage four of Lucky sieve.

Original entry on oeis.org

27, 57, 91, 121, 153, 183, 217, 247, 279, 309, 343, 373, 405, 435, 469, 499, 531, 561, 595, 625, 657, 687, 721, 751, 783, 813, 847, 877, 909, 939, 973, 1003, 1035, 1065, 1099, 1129, 1161, 1191, 1225, 1255, 1287, 1317, 1351, 1381, 1413, 1443, 1477, 1507, 1539, 1569, 1603, 1633, 1665, 1695, 1729, 1759, 1791, 1821, 1855, 1885, 1917, 1947, 1981, 2011
Offset: 1

Views

Author

Antti Karttunen, Jul 27 2015

Keywords

Comments

Numbers congruent to {27, 57, 91, 121} modulo 126. - Jianing Song, Apr 27 2022

Crossrefs

Row 4 of A255543. Every ninth term of A258011.

Formula

a(n) = A258011(9*n).
a(n) = A260436(A255414(1+n)).
From Jianing Song, Apr 27 2022: (Start)
a(n) = a(n-4) + 126.
a(n) = a(n-1) + a(n-4) - a(n-5).
G.f.: (27*x+30*x^2+34*x^3+30*x^4+5*x^5)/(1-x-x^4+x^5).
E.g.f: 1/2*(10 + cos(x) - sin(x) + (63*x-11)*cosh(x) + (63*x-8)*sinh(x)). (End)

A260722 Difference between n-th odd Ludic and n-th Lucky number: a(1) = 0; for n > 1: a(n) = A003309(n+1) - A000959(n).

Original entry on oeis.org

0, 0, -2, -2, -2, -2, -4, -2, -6, -4, 0, -2, -6, -4, -10, -6, -2, -2, 2, 4, 2, -2, -2, 2, 4, 4, -6, -2, -2, 8, 8, 6, 2, 10, 6, 8, -8, 0, 14, 10, 16, 12, 8, 10, 4, 4, 10, 16, 6, 16, 16, 14, 18, 22, 24, 32, 28, 30, 22, 32, 32, 30, 38, 34, 32, 36, 40, 30, 28, 28, 32, 24, 22, 24, 36, 38, 42, 30, 30, 22, 26, 26, 30, 38, 40, 30, 36, 46, 48, 46, 56, 54, 54, 54, 40, 46
Offset: 1

Views

Author

Antti Karttunen, Aug 06 2015

Keywords

Comments

Equally: for n >= 2, the difference between (n+1)-th Ludic and n-th Lucky number.

Crossrefs

Cf. A000959, A003309, A031883, A260721 (same terms divided by two), A260723, A256486, A256487.
Cf. also permutations A260435, A260436, A260741, A260742.

Programs

Formula

a(1) = 0; for n > 1: a(n) = A003309(n+1) - A000959(n).
Other identities. For all n >= 2:
a(n) = A256486(n) + A260723(n).
a(n) = A256486(n+1) + A031883(n).
Showing 1-6 of 6 results.