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-4 of 4 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

A254100 Postludic numbers: Second column of Ludic array A255127.

Original entry on oeis.org

4, 9, 19, 31, 55, 73, 101, 145, 167, 205, 253, 293, 317, 355, 413, 473, 521, 569, 623, 677, 737, 763, 833, 917, 983, 1027, 1051, 1121, 1171, 1273, 1337, 1411, 1471, 1571, 1619, 1663, 1681, 1807, 1957, 1991, 2087, 2113, 2171, 2245, 2275, 2335, 2401, 2497, 2593, 2713, 2771, 2831, 2977, 3047, 3113
Offset: 1

Views

Author

Antti Karttunen, Feb 22 2015

Keywords

Crossrefs

Column 2 of A255127. (Row 2 of A255129). Positions of 2's in A260739.
Subsequence of A192607, A302036 and A302038.
Cf. A276576, A276606 (first differences).
Cf. also A001248, A219178.

Programs

  • Mathematica
    rows = 100; cols = 2; t = Range[2, 10^4]; r = {1}; n = 1; While[n <= rows, k = First[t]; AppendTo[r, k]; t0 = t; t = Drop[t, {1, -1, k}]; ro[n++] = Complement[t0, t][[1 ;; cols]]]; A = Array[ro, rows]; Table[A[[n, 2]], {n, 1, rows} ] (* Jean-François Alcover, Mar 14 2016, after Ray Chandler *)
  • Scheme
    (define (A254100 n) (A255127bi n 2)) ;; A255127bi given in A255127.

Formula

a(n) = A255407(A001248(n)).

A302036 Ludic powers: numbers k such that A302031(k) < 2; numbers k such that A260739(k) is a power of 2.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 21, 23, 25, 29, 31, 32, 37, 41, 43, 45, 47, 49, 53, 55, 61, 64, 67, 71, 73, 77, 83, 85, 89, 91, 93, 97, 101, 107, 109, 115, 119, 121, 127, 128, 131, 143, 145, 149, 151, 157, 161, 167, 173, 175, 179, 181, 189, 191, 193, 197, 205, 209, 211, 221, 223, 227, 229, 233, 235, 239, 247, 253, 256, 257
Offset: 1

Views

Author

Antti Karttunen, Apr 02 2018

Keywords

Comments

An analog of A000961 for factorization process based on the Ludic sieve (A255127).
Numbers k for which A302031(k) < 2, or equally, for which A302034(k) = 1, or equally, for which A209229(A260739(k)) = 1.

Crossrefs

Cf. A000079, A003309, A254100 (subsequences).
Cf. also A000961, A302038, A302040.

Programs

  • PARI
    for(n=1,257,if(A302031(n)<2,print1(n,","))); \\ See also code in A302031.

A302037 A bigomega (A001222) analog based on the Ludic sieve (A255127): a(1) = 0; for n > 1, a(n) = 1 + a(A302032(n)).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 2, 2, 4, 1, 3, 2, 3, 3, 2, 1, 4, 1, 2, 2, 3, 1, 3, 2, 5, 3, 2, 2, 4, 1, 3, 2, 4, 1, 4, 1, 3, 4, 2, 1, 5, 3, 2, 3, 3, 1, 3, 2, 4, 3, 2, 2, 4, 1, 3, 2, 6, 2, 4, 1, 3, 4, 3, 1, 5, 2, 2, 2, 4, 1, 3, 3, 5, 3, 2, 1, 5, 3, 2, 3, 4, 1, 5, 1, 3, 5, 2, 2, 6, 1, 4, 2, 3, 2, 4, 2, 4, 4
Offset: 1

Views

Author

Antti Karttunen, Apr 01 2018

Keywords

Crossrefs

Cf. A003309 (gives the positions of terms <= 1), A302038 (gives the positions of 2's).
Cf. A302031 (an omega-analog), A253557.

Programs

Formula

a(1) = 0; for n > 1, a(n) = 1 + a(A302032(n)).
a(n) = A000120(A269388(n)).
a(n) = A001222(A302026(n)).
Showing 1-4 of 4 results.