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

A256487 a(n) = A254100(n) - A219178(n).

Original entry on oeis.org

2, 4, 0, 4, 10, 18, 16, 36, 28, 48, 78, 80, 62, 90, 76, 110, 134, 158, 200, 220, 224, 216, 236, 280, 308, 312, 262, 314, 328, 402, 430, 424, 438, 488, 506, 538, 414, 510, 642, 620, 680, 648, 656, 690, 666, 684, 730, 790, 742, 840, 844, 862, 916, 976, 1004, 1092, 1072, 1112, 1054, 1166, 1176, 1184, 1292
Offset: 1

Views

Author

Antti Karttunen, May 01 2015

Keywords

Comments

Difference between the least nonludic number removed at the n-th stage of Ludic sieve and the least unlucky number removed at the n-th stage of Lucky sieve.

Crossrefs

Cf. A219178, A254100, A256482, A256486, A256488 (same terms divided by 2).

Programs

Formula

a(n) = A254100(n) - A219178(n).

A256482 a(n) = A254100(n) - A003309(n+1).

Original entry on oeis.org

2, 6, 14, 24, 44, 60, 84, 122, 142, 176, 216, 252, 274, 308, 360, 412, 454, 498, 546, 594, 648, 672, 736, 810, 868, 908, 930, 994, 1040, 1130, 1188, 1254, 1310, 1398, 1444, 1484, 1500, 1614, 1748, 1780, 1866, 1890, 1944, 2012, 2040, 2096, 2154, 2240, 2328, 2436, 2488, 2544, 2676, 2740, 2800, 2948, 2976, 3034, 3090, 3210
Offset: 1

Views

Author

Antti Karttunen, Apr 30 2015

Keywords

Crossrefs

Column 1 of A257257.
Cf. also A256483 (same terms divided by 2).

Programs

Formula

a(n) = A254100(n) - A003309(n+1).
a(n) = 2*A256483(n).

A276606 First differences of postludic numbers: a(n) = A254100(1+n) - A254100(n).

Original entry on oeis.org

5, 10, 12, 24, 18, 28, 44, 22, 38, 48, 40, 24, 38, 58, 60, 48, 48, 54, 54, 60, 26, 70, 84, 66, 44, 24, 70, 50, 102, 64, 74, 60, 100, 48, 44, 18, 126, 150, 34, 96, 26, 58, 74, 30, 60, 66, 96, 96, 120, 58, 60, 146, 70, 66, 164, 30, 64, 60, 132, 50, 40, 168, 78, 62, 100, 108, 104, 42, 58, 98, 40, 50, 100, 198, 44, 88, 60, 138, 60
Offset: 1

Views

Author

Antti Karttunen, Sep 13 2016

Keywords

Crossrefs

Column 2 of A276610.
Cf. also A260723, A276607.

Programs

Formula

a(n) = A254100(1+n) - A254100(n).
a(n) = A260723(1+n) + A276607(n).

A256483 a(n) = A256482(n)/2 = (A254100(n) - A003309(n+1)) / 2.

Original entry on oeis.org

1, 3, 7, 12, 22, 30, 42, 61, 71, 88, 108, 126, 137, 154, 180, 206, 227, 249, 273, 297, 324, 336, 368, 405, 434, 454, 465, 497, 520, 565, 594, 627, 655, 699, 722, 742, 750, 807, 874, 890, 933, 945, 972, 1006, 1020, 1048, 1077, 1120, 1164, 1218, 1244, 1272, 1338, 1370, 1400, 1474, 1488, 1517, 1545, 1605, 1627
Offset: 1

Views

Author

Antti Karttunen, May 01 2015

Keywords

Crossrefs

Column 1 of A257258.
Cf. also A256486, A256487.

Programs

Formula

a(n) = A256482(n)/2 = (A254100(n) - A003309(n+1)) / 2.

A256488 a(n) = A256487(n)/2 = (A254100(n) - A219178(n))/2.

Original entry on oeis.org

1, 2, 0, 2, 5, 9, 8, 18, 14, 24, 39, 40, 31, 45, 38, 55, 67, 79, 100, 110, 112, 108, 118, 140, 154, 156, 131, 157, 164, 201, 215, 212, 219, 244, 253, 269, 207, 255, 321, 310, 340, 324, 328, 345, 333, 342, 365, 395, 371, 420, 422, 431, 458, 488, 502, 546, 536, 556, 527, 583, 588, 592, 646, 643, 639, 665, 688, 662, 662
Offset: 1

Views

Author

Antti Karttunen, May 01 2015

Keywords

Comments

Half the difference between the least nonludic number removed at the n-th stage of Ludic sieve and the least unlucky number removed at the n-th stage of Lucky sieve.

Crossrefs

Programs

Formula

a(n) = A256487(n)/2 = (A254100(n) - A219178(n))/2.

A276576 Column 2 of A276580: a(n) = A276570(A254100(n)); the n-th postludic number modulo the corresponding Ludic number.

Original entry on oeis.org

0, 0, 4, 3, 0, 8, 16, 7, 17, 2, 31, 6, 16, 26, 42, 46, 52, 1, 7, 13, 25, 35, 57, 61, 63, 75, 83, 105, 123, 129, 145, 155, 22, 14, 44, 52, 52, 70, 76, 92, 98, 106, 128, 148, 160, 184, 178, 184, 208, 220, 224, 248, 268, 284, 296, 316, 328, 1, 21, 33, 23, 43, 51, 69, 71, 91, 99, 123, 125, 163, 161, 181, 191, 211, 229, 233, 241, 241
Offset: 1

Views

Author

Antti Karttunen, Sep 13 2016

Keywords

Crossrefs

Column 2 of A276580.

Programs

Formula

a(n) = A276570(A254100(n)) = A254100(n) modulo A003309(1+n).

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

A255127 Ludic array: square array A(row,col), where row n lists the numbers removed at stage n in the sieve which produces Ludic numbers. Array is read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Original entry on oeis.org

2, 4, 3, 6, 9, 5, 8, 15, 19, 7, 10, 21, 35, 31, 11, 12, 27, 49, 59, 55, 13, 14, 33, 65, 85, 103, 73, 17, 16, 39, 79, 113, 151, 133, 101, 23, 18, 45, 95, 137, 203, 197, 187, 145, 25, 20, 51, 109, 163, 251, 263, 281, 271, 167, 29, 22, 57, 125, 191, 299, 325, 367, 403, 311, 205, 37, 24, 63, 139, 217, 343, 385, 461, 523, 457, 371, 253, 41
Offset: 2

Views

Author

Antti Karttunen, Feb 22 2015

Keywords

Comments

The starting offset of the sequence giving the terms of square array is 2. However, we can tacitly assume that a(1) = 1 when the sequence is used as a permutation of natural numbers. However, term 1 itself is out of the array.
The choice of offset = 2 for the terms starting in rows >= 1 is motivated by the desire to have a permutation of the integers n -> a(n) with a(n) = A(A002260(n-1), A004736(n-1)) for n > 1 and a(1) := 1. However, since this sequence is declared as a "table", offset = 2 would mean that the first *row* (not element) has index 2. I think the sequence should have offset = 1 and the permutation of the integers would be n -> a(n-1) with a(0) := 1 (if a(1) = A(1,1) = 2). Or, the sequence could have offset 0, with an additional row 0 of length 1 with the only element a(0) = A(0,1) = 1, the permutation still being n -> a(n-1) if a(n=0, 1, 2, ...) = (1, 2, 4, ...). This would be in line with considering 1 as the first ludic number, and A(n, 1) = A003309(n+1) for n >= 0. - M. F. Hasler, Nov 12 2024

Examples

			The top left corner of the array:
   2,   4,   6,   8,  10,  12,   14,   16,   18,   20,   22,   24,   26
   3,   9,  15,  21,  27,  33,   39,   45,   51,   57,   63,   69,   75
   5,  19,  35,  49,  65,  79,   95,  109,  125,  139,  155,  169,  185
   7,  31,  59,  85, 113, 137,  163,  191,  217,  241,  269,  295,  323
  11,  55, 103, 151, 203, 251,  299,  343,  391,  443,  491,  539,  587
  13,  73, 133, 197, 263, 325,  385,  449,  511,  571,  641,  701,  761
  17, 101, 187, 281, 367, 461,  547,  629,  721,  809,  901,  989, 1079
  23, 145, 271, 403, 523, 655,  781,  911, 1037, 1157, 1289, 1417, 1543
  25, 167, 311, 457, 599, 745,  883, 1033, 1181, 1321, 1469, 1615, 1753
  29, 205, 371, 551, 719, 895, 1073, 1243, 1421, 1591, 1771, 1945, 2117
...
		

Crossrefs

Transpose: A255129.
Inverse: A255128. (When considered as a permutation of natural numbers with a(1) = 1).
Cf. A260738 (index of the row where n occurs), A260739 (of the column).
Main diagonal: A255410.
Column 1: A003309 (without the initial 1). Column 2: A254100.
Row 1: A005843, Row 2: A016945, Row 3: A255413, Row 4: A255414, Row 5: A255415, Row 6: A255416, Row 7: A255417, Row 8: A255418, Row 9: A255419.
A192607 gives all the numbers right of the leftmost column, and A192506 gives the composites among them.
Cf. A272565, A271419, A271420 and permutations A269379, A269380, A269384.
Cf. also related or derived arrays A260717, A257257, A257258 (first differences of rows), A276610 (of columns), A276580.
Analogous arrays for other sieves: A083221, A255551, A255543.
Cf. A376237 (ludic factorials), A377469 (ludic analog of A005867).

Programs

  • Mathematica
    rows = 12; cols = 12; t = Range[2, 3000]; 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 - k + 1, k]], {n, 1, rows}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Mar 14 2016, after Ray Chandler *)
  • Python
    a255127 = lambda n: A255127(A002260(k-1), A004736(k-1))
    def A255127(n, k):
        A = A255127; R = A.rows
        while len(R) <= n or len(R[n]) < min(k, A.P[n]): A255127_extend(2*n)
        return R[n][(k-1) % A.P[n]] + (k-1)//A.P[n] * A.S[n]
    A=A255127; A.rows=[[1],[2],[3]]; A.P=[1]*3; A.S=[0,2,6]; A.limit=30
    def A255127_extend(rMax=9, A=A255127):
        A.limit *= 2; L = [x+5-x%2 for x in range(0, A.limit, 3)]
        for r in range(3, rMax):
            if len(A.P) == r:
                A.P += [ A.P[-1] * (A.rows[-1][0] - 1) ]  # A377469
                A.rows += [[]]; A.S += [ A.S[-1] * L[0] ] # ludic factorials
            if len(R := A.rows[r]) < A.P[r]: # append more terms to this row
                R += L[ L[0]*len(R) : A.S[r] : L[0] ]
            L = [x for i, x in enumerate(L) if i%L[0]] # M. F. Hasler, Nov 17 2024
  • Scheme
    (define (A255127 n) (if (<= n 1) n (A255127bi (A002260 (- n 1)) (A004736 (- n 1)))))
    (define (A255127bi row col) ((rowfun_n_for_A255127 row) col))
    ;; definec-macro memoizes its results:
    (definec (rowfun_n_for_A255127 n) (if (= 1 n) (lambda (n) (+ n n)) (let* ((rowfun_for_remaining (rowfun_n_for_remaining_numbers (- n 1))) (eka (rowfun_for_remaining 0))) (COMPOSE rowfun_for_remaining (lambda (n) (* eka (- n 1)))))))
    (definec (rowfun_n_for_remaining_numbers n) (if (= 1 n) (lambda (n) (+ n n 3)) (let* ((rowfun_for_prevrow (rowfun_n_for_remaining_numbers (- n 1))) (off (rowfun_for_prevrow 0))) (COMPOSE rowfun_for_prevrow (lambda (n) (+ 1 n (floor->exact (/ n (- off 1)))))))))
    

Formula

From M. F. Hasler, Nov 12 2024: (Start)
A(r, c) = A(r, c-P(r)) + S(r) = A(r, ((c-1) mod P(r)) + 1) + floor((c-1)/P(r))*S(r) with periods P = (1, 1, 2, 8, 48, 480, 5760, ...) = A377469, and shifts S = (2, 6, 30, 210, 2310, 30030, 510510) = A376237(2, 3, ...). For example:
A(1, c) = A(1, c-1) + 2 = 2 + (c-1)*2 = 2*c,
A(2, c) = A(2, c-1) + 6 = 3 + (c-1)*6 = 6*c - 3,
A(3, c) = A(3, c-2) + 30 = {5 if c is odd else 19} + floor((c-1)/2)*30 = 15*c - 11 + (c mod 2),
A(4, c) = A(4, c-8) + 210 = A(4, ((c-1) mod 8)+1) + floor((c-1)/8)*210, etc. (End)

A219178 a(n) = first unlucky number removed at the n-th stage of Lucky sieve.

Original entry on oeis.org

2, 5, 19, 27, 45, 55, 85, 109, 139, 157, 175, 213, 255, 265, 337, 363, 387, 411, 423, 457, 513, 547, 597, 637, 675, 715, 789, 807, 843, 871, 907, 987, 1033, 1083, 1113, 1125, 1267, 1297, 1315, 1371, 1407, 1465, 1515, 1555, 1609, 1651, 1671, 1707, 1851, 1873, 1927, 1969
Offset: 1

Views

Author

Phil Carmody, Nov 15 2012

Keywords

Comments

First numbers removed by each lucky number in the lucky number sieve. - This is the original definition of the sequence, still valid from a(2) onward.
a(1) = 2, because at the first stage of Lucky sieve, all even numbers are removed, of which 2 is the first one. - Antti Karttunen, Feb 26 2015

Examples

			1 and 2 are a special case in the lucky number sieve, (1 is the lucky number, but every 2nd element is removed) so are ignored [in the original version of the sequence, which started from a(2). Now we have a(1) = 2. - _Antti Karttunen_, Feb 26 2015]. The 2nd lucky number, 3, removes { 5, 11, ... } from the list, so a(2) = 5. The 3rd lucky number, 7, removes { 19, 39, ... } from the list, so a(3)=19.
		

Crossrefs

Column 1 of A255543, Column 2 of A255545 (And apart from the first term, also column 2 of A255551).

Programs

  • Mathematica
    rows = 52; cols = 1; L = 2 Range[0, 10^4] + 1; A = Join[{2 Range[cols]}, Reap[For[n = 2, n <= rows, r = L[[n++]]; L0 = L; L = ReplacePart[L, Table[r i -> Nothing, {i, 1, Length[L]/r}]]; Sow[Complement[L0, L][[1 ;; cols]]]]][[2, 1]]]; Table[A[[n, 1]], {n, 1, rows}] (* Jean-François Alcover, Mar 15 2016 *)
  • Scheme
    (define (A219178 n) (A255543bi n 1)) ;; Code for A255543bi given in A255543.

Formula

From Antti Karttunen, Feb 26 2015: (Start)
a(n) = A255543(n,1).
Other identities.
For all n >= 2, a(n) = A255553(A001248(n)).
(End)

Extensions

Term a(1) = 2 prepended, without changing the rest of sequence. Name changed, with the original, more restrictive definition moved to the Comments section. - Antti Karttunen, Feb 26 2015

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