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 16 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

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)).

A255408 Permutation of natural numbers: a(n) = A083221(A255128(n)).

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, 38, 39, 40, 37, 42, 41, 44, 45, 46, 43, 48, 55, 50, 51, 52, 47, 54, 121, 56, 57, 58, 77, 60, 53, 62, 63, 64, 65, 66, 59, 68, 69, 70, 61, 72, 169, 74, 75, 76, 67, 78, 85, 80, 81, 82, 71, 84, 91, 86, 87
Offset: 1

Views

Author

Antti Karttunen, Feb 22 2015

Keywords

Comments

a(n) tells which number in array A083221 (the sieve of Eratosthenes) is at the same position where n is in Ludic array A255127. 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 A083140 is at the same position where n is in the array A255129, as they are the transposes of above two arrays.

Examples

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

Crossrefs

Inverse: A255407.
Similar permutations: A249817.

Programs

Formula

a(n) = A083221(A255128(n)).
Other identities. For all n >= 1:
a(2n) = 2n. [Fixes even numbers.]
a(3n) = 3n. [Fixes multiples of three.]
a(A003309(n)) = A008578(n). [Maps Ludic numbers to noncomposites.]

A269171 Permutation of natural numbers: a(1) = 1, a(2n) = 2*a(n), a(2n+1) = A269379(a(A268674(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, 23, 20, 21, 22, 25, 24, 19, 26, 27, 28, 29, 30, 37, 32, 33, 34, 35, 36, 41, 46, 39, 40, 43, 42, 47, 44, 45, 50, 53, 48, 31, 38, 51, 52, 61, 54, 49, 56, 57, 58, 67, 60, 71, 74, 63, 64, 65, 66, 77, 68, 69, 70, 83, 72, 89, 82, 75, 92, 59, 78, 91, 80, 81, 86, 97, 84, 79, 94, 87, 88, 107, 90, 85, 100
Offset: 1

Views

Author

Antti Karttunen, Mar 03 2016

Keywords

Crossrefs

Inverse: A269172.
Related or similar permutations: A260741, A260742, A269355, A269357, A255421, A252754, A252756, A269385, A269387.
Cf. also A269393 (a(3n)/3) and A269395.
Differs from A255407 for the first time at n=38, where a(38) = 46, while A255407(38) = 38.

Formula

a(1) = 1, then after for even n, a(n) = 2*a(n/2), and for odd n, a(n) = A269379(a(A268674(n))).
a(1) = 1, for n > 1, a(n) = A255127(A055396(n), a(A078898(n))).
As a composition of other permutations:
a(n) = A269385(A252756(n)).
a(n) = A269387(A252754(n)).
Other identities. For all n >= 1:
A000035(a(n)) = A000035(n). [Preserves the parity of n.]
a(A008578(n)) = A003309(n). [Maps noncomposites to Ludic numbers.]

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).

A255413 a(n) = 15*n - 11 + (n mod 2). Row 3 of Ludic array A255127.

Original entry on oeis.org

5, 19, 35, 49, 65, 79, 95, 109, 125, 139, 155, 169, 185, 199, 215, 229, 245, 259, 275, 289, 305, 319, 335, 349, 365, 379, 395, 409, 425, 439, 455, 469, 485, 499, 515, 529, 545, 559, 575, 589, 605, 619, 635, 649, 665, 679, 695, 709, 725, 739, 755, 769, 785, 799, 815, 829, 845, 859, 875, 889, 905, 919, 935, 949, 965, 979, 995, 1009
Offset: 1

Views

Author

Antti Karttunen, Feb 22 2015

Keywords

Crossrefs

Programs

Formula

a(n) = A007310((5*n)-3).
a(n) = A255407(A084967(n)) = A255407(5*A007310(n)).
a(2n+1) = 5*A016921(n) for all n >= 0.
From M. F. Hasler, Nov 09 2024: (Start)
a(n) = a(n-1) + a(n-2) + a(n-3) for n > 3, a(1..3) = (5, 19, 35).
a(n) = a(n-2) + 30 for n > 2, with a(1..2) = (5, 19).
a(2n-1) = 30n - 25, a(2n) = 30n - 11.
G.f.: x*(5 + 14*x + 11*x^2)/((1 - x)^2*(1 + x)). (End)
E.g.f.: 11 + (15*x - 11)*cosh(x) + 5*(3*x - 2)*sinh(x). - Stefano Spezia, Nov 12 2024

Extensions

New definition from M. F. Hasler, Nov 09 2024

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.]

A255414 Row 4 of Ludic array A255127.

Original entry on oeis.org

7, 31, 59, 85, 113, 137, 163, 191, 217, 241, 269, 295, 323, 347, 373, 401, 427, 451, 479, 505, 533, 557, 583, 611, 637, 661, 689, 715, 743, 767, 793, 821, 847, 871, 899, 925, 953, 977, 1003, 1031, 1057, 1081, 1109, 1135, 1163, 1187, 1213, 1241, 1267, 1291, 1319, 1345, 1373, 1397, 1423, 1451, 1477, 1501, 1529, 1555, 1583, 1607, 1633, 1661
Offset: 1

Views

Author

Antti Karttunen, Feb 22 2015

Keywords

Crossrefs

Row 4 of A255127.

Programs

Formula

a(n) = A255407(A084968(n)).
From M. F. Hasler, Nov 09 2024: (Start)
a(n) = a(n-8) + 210 = 210*floor((n-1)/8) + a((n-1)%8 + 1), where % is the modulo or remainder operation.
a(n) = a(n-1) + a(n-8) - a(n-9) for n > 9, with a(1..9) given in DATA.
G.f.: x*(7 + 24*x + 28*x^2 + 26*x^3 + 28*x^4 + 24*x^5 + 26*x^6 + 28*x^7 + 19*x^8)/D with D = 1 - x - x^8 + x^9 = (1 + x^4)(1 - x^4) = (1 + x^4)(1 + x^2)(1 + x)(1 - x). (End)

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).
Showing 1-10 of 16 results. Next