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 11 results. Next

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

A255407 Permutation of natural numbers: a(n) = A255127(A252460(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 22 2015

Keywords

Comments

a(n) tells which number in Ludic array A255127 is at the same position where n is in array A083221, the sieve of Eratosthenes. As both arrays have A005843 (even numbers) and A016945 as their two topmost rows, both sequences are among the fixed points of this permutation.
Equally: a(n) tells which number in array A255129 is at the same position where n is in the array A083140, as they are the transposes of above two arrays.

Examples

			A083221(8,1) = 19 and A255127(8,1) = 23, thus a(19) = 23.
A083221(9,1) = 23 and A255127(9,1) = 25, thus a(23) = 25.
A083221(3,2) = 25 and A255127(3,2) = 19, thus a(25) = 19.
		

Crossrefs

Inverse: A255408.
Similar permutations: A249818.

Formula

a(n) = A255127(A252460(n)).
Other identities. For all n >= 1:
a(2n) = 2n. [Fixes even numbers.]
a(3n) = 3n. [Fixes multiples of three.]
a(A008578(n)) = A003309(n). [Maps noncomposites to Ludic numbers.]
a(A001248(n)) = A254100(n). [Maps squares of primes to "postludic numbers".]
a(A084967(n)) = a(5*A007310(n)) = A007310((5*n)-3) = A255413(n). [Maps A084967 to A255413.]
(And similarly between other columns and rows of A083221 and A255127.)

A269172 Permutation of natural numbers: a(1) = 1, a(2n) = 2*a(n), a(2n+1) = A250469(a(A269380(2n+1))).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 03 2016

Keywords

Crossrefs

Inverse: A269171.
Related or similar permutations: A260741, A260742, A269356, A269358, A255422.
Cf. also A269394 (a(3n)/3) and A269396.
Differs from A255408 for the first time at n=38, where a(38) = 50, while A255408(38) = 38.

Formula

a(1) = 1, then after for even n, a(n) = 2*a(n/2), and for odd n, A250469(a(A269380(n))).
a(1) = 1, for n > 1, a(n) = A083221(A260738(n), a(A260739(n))).
As a composition of other permutations:
a(n) = A252755(A269386(n)).
a(n) = A252753(A269388(n)).
Other identities. For all n >= 1:
A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.]
a(A003309(n)) = A008578(n). [Maps Ludic numbers to noncomposites.]

A255553 Permutation of natural numbers: a(n) = A255551(A252460(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 26 2015

Keywords

Comments

a(n) tells which number in array A255551, constructed from Lucky sieve, is at the same position where n is in array A083221, constructed from the sieve of Eratosthenes. As both arrays have A005843 (even numbers) as their topmost row, this permutation fixes all of them.

Crossrefs

Inverse: A255554.
Similar or related permutations: A255407, A255408, A249817, A249818, A252460, A255551.

Programs

Formula

a(n) = A255551(A252460(n)).
Other identities:
a(2n) = 2n. [Fixes even numbers.]
For all n >= 1, a(A083141(n)) = A255550(n).
For all n >= 2, a(A000040(n)) = A000959(n).
For all n >= 2, a(A001248(n)) = A219178(n).

A255421 Permutation of natural numbers: a(1) = 1, a(p_n) = ludic(1+a(n)), a(c_n) = nonludic(a(n)), where p_n = n-th prime, c_n = n-th composite number and ludic = A003309, nonludic = A192607.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 23 2015

Keywords

Comments

This can be viewed as yet another "entanglement permutation", where two pairs of complementary subsets of natural numbers are interwoven with each other. In this case a complementary pair ludic/nonludic numbers (A003309/A192607) is intertwined with a complementary pair prime/composite numbers (A000040/A002808).

Examples

			When n = 19 = A000040(8) [the eighth prime], we look for the value of a(8), which is 8 [all terms less than 19 are fixed because the beginnings of A003309 and A008578 coincide up to A003309(8) = A008578(8) = 17], and then take the eighth ludic number larger than 1, which is A003309(1+8) = 23, thus a(19) = 23.
When n = 20 = A002808(11) [the eleventh composite], we look for the value of a(11), which is 11 [all terms less than 19 are fixed, see above], and then take the eleventh nonludic number, which is A192607(11) = 19, thus a(20) = 19.
When n = 30 = A002808(19) [the 19th composite], we look for the value of a(19), which is 23 [see above], and then take the 23rd nonludic number, which is A192607(23) = 34, thus a(30) = 34.
		

Crossrefs

Formula

a(1) = 1, and for n > 1, if A010051(n) = 1 [i.e. when n is a prime], a(n) = A003309(1+a(A000720(n))), otherwise a(n) = A192607(a(A065855(n))).
As a composition of other permutations:
a(n) = A237126(A246377(n)).
Other identities.
a(A007097(n)) = A255420(n). [Maps iterates of primes to the iterates of Ludic numbers.]

A255422 Permutation of natural numbers: a(1) = 1 and for n > 1, if n is k-th ludic number larger than 1 [i.e., n = A003309(k+1)], a(n) = nthprime(a(k)), otherwise, when n is k-th nonludic number [i.e., n = A192607(k)], a(n) = nthcomposite(a(k)), where nthcomposite = A002808, nthprime = A000040.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 23 2015

Keywords

Comments

The graph has a comet appearance. - Daniel Forgues, Dec 15 2015

Examples

			When n = 19 = A192607(11) [the eleventh nonludic number], we look for the value of a(11), which is 11 [all terms less than 19 are fixed because the beginnings of A003309 and A008578 coincide up to A003309(8) = A008578(8) = 17], and then take the eleventh composite number, which is A002808(11) = 20, thus a(19) = 20.
When n = 25 = A003309(10) = A003309(1+9) [the tenth ludic number, and ninth after one], we look for the value of a(9), which is 9 [all terms less than 19 are fixed, see above], and then take the ninth prime number, which is A000040(9) = 23, thus a(25) = 23.
		

Crossrefs

Inverse: A255421.
Related or similar permutations: A237427, A246378, A245703, A245704 (compare the scatterplots), A255407, A255408.

Formula

a(1)=1; and for n > 1, if A192490(n) = 1 [i.e., n is ludic], a(n) = A000040(a(A192512(n)-1)), otherwise a(n) = A002808(a(A236863(n))) [where A192512 and A236863 give the number of ludic and nonludic numbers <= n, respectively].
As a composition of other permutations: a(n) = A246378(A237427(n)).

A255554 Permutation of natural numbers: a(n) = A083221(A255552(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 26 2015

Keywords

Comments

a(n) tells which number in array A083221, constructed from the sieve of Eratosthenes is at the same position where n is in array A255551 constructed from Lucky sieve. As both arrays have A005843 (even numbers) as their topmost row, this permutation fixes all of them.

Crossrefs

Programs

Formula

a(n) = A083221(A255552(n)).
Other identities:
a(2n) = 2n. [Fixes even numbers.]
For all n >= 1, a(A255550(n)) = A083141(n).
For all n >= 2, a(A000959(n)) = A000040(n).
For all n >= 2, a(A219178(n)) = A001248(n).

A260436 Permutation mapping from Ludic sieve to Lucky sieve: a(1) = 1, for n > 1: a(n) = A255551(A260738(n), A260739(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 30 2015

Keywords

Comments

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

Crossrefs

Inverse: A260435.
Similar permutations: A255408, A255128, A255551, A255553, A249817, A249818, A260742 (a more recursed variant).

Programs

Formula

Other identities. For all n >= 1:
a(A003309(n+2)) = A000959(n+1). [Maps odd Ludic numbers to Lucky numbers.]
a(2n) = 2n.
As a composition of related permutations:
a(n) = A255551(A255128(n)).
a(n) = A255553(A255408(n)).

A269356 Permutation of natural numbers: a(n) = A268674(A269379(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 17, 10, 11, 12, 13, 14, 15, 16, 19, 18, 29, 20, 25, 22, 9, 24, 23, 26, 27, 28, 31, 30, 21, 32, 73, 34, 53, 36, 37, 38, 39, 40, 41, 42, 43, 44, 107, 46, 47, 48, 33, 50, 51, 52, 59, 54, 71, 56, 137, 58, 101, 60, 61, 62, 63, 64, 109, 66, 67, 68, 121, 70, 35, 72, 97, 74, 75, 76, 79, 78, 131, 80, 197
Offset: 1

Views

Author

Antti Karttunen, Mar 03 2016

Keywords

Examples

			For n=9 we first find what number is below 9 in square array A255127, which is 19, then we find what number is above 19 in square array A083221, which is 17, thus a(9) = 17.
		

Crossrefs

Inverse: A269355.
Cf. also arrays A083221 & A255127.
More recursed variant: A269358. Cf. also permutations A266646, A255408, A269172.

Programs

Formula

a(n) = A268674(A269379(n)).
Other identities. For all n >= 1:
a(2n) = 2n. [Fixes the even numbers.]

A255128 Inverse permutation to A255127.

Original entry on oeis.org

1, 2, 4, 3, 7, 5, 11, 8, 6, 12, 16, 17, 22, 23, 9, 30, 29, 38, 10, 47, 13, 57, 37, 68, 46, 80, 18, 93, 56, 107, 15, 122, 24, 138, 14, 155, 67, 173, 31, 192, 79, 212, 92, 233, 39, 255, 106, 278, 19, 302, 48, 327, 121, 353, 21, 380, 58, 408, 20, 437, 137, 467, 69, 498, 25, 530, 154, 563, 81, 597, 172, 632, 28, 668, 94, 705, 191, 743, 32
Offset: 1

Views

Author

Antti Karttunen, Feb 22 2015

Keywords

Crossrefs

Inverse: A255127 (with assumed silent a(1)=1).

Formula

a(n) = A252460(A255408(n)).
Showing 1-10 of 11 results. Next