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.

A115409 Inverse integer permutation of A115408.

Original entry on oeis.org

1, 5, 4, 7, 6, 2, 17, 16, 12, 10, 20, 19, 15, 13, 3, 43, 42, 38, 36, 26, 23, 51, 50, 46, 44, 34, 31, 8, 105, 104, 100, 98, 88, 85, 62, 54, 114, 113, 109, 107, 97, 94, 71, 63, 9
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 22 2006

Keywords

Comments

Seen as a triangle read by rows T(n,k) = a(n*(n-1)/2+k) = A024431(n)-A024431(k-1), 1<=k<=n.
T(n,1) = A024431(n)-1; T(n,n) = A247414(n-1). - Reinhard Zumkeller, Sep 16 2014

Examples

			Triangle begins:
1;
5, 4;
7, 6, 2;
17, 16, 12, 10;
20, 19, 15, 13, 3;
...
		

Crossrefs

Programs

  • Haskell
    import Data.List (inits)
    a115409 n k = a115409_tabl !! (n-1) !! (k-1)
    a115409_row n = a115409_tabl !! (n-1)
    a115409_tabl = map f $ drop 2 $ inits a024431_list where
       f xs = reverse $ map (z -) zs where (z:zs) = reverse xs
    a115409_list = concat a115409_tabl
    -- Reinhard Zumkeller, Sep 16 2014
  • Mathematica
    nmax = 9;
    differenceQ[seq_, x_] := Module[{r = False}, Do[If[x==seq[[k]] - seq[[j]], r = True; Break[]], {j, 1, Length[seq]}, {k, 1, Length[seq]}]; r];
    seq[1] = {1, 2};
    seq[i_] := seq[i] = Module[{j, k}, k = Max[seq[i-1]]; j = First[Select[ Range[k], !differenceQ[seq[i-1], #]&, 1]]; Union[seq[i-1], {2k+2, 2k+2+j}]];
    A024431 = seq[nmax];
    T[n_, k_] := A024431[[n+1]] -  A024431[[k]];
    Table[T[n, k], {n, 1, nmax}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 20 2021 *)

A024431 A generalized difference set on the set of all integers (lambda = 1).

Original entry on oeis.org

1, 2, 6, 8, 18, 21, 44, 52, 106, 115, 232, 243, 488, 502, 1006, 1024, 2050, 2071, 4144, 4166, 8334, 8358, 16718, 16743, 33488, 33515, 67032, 67060, 134122, 134151, 268304, 268334, 536670, 536702, 1073406, 1073439, 2146880, 2146915, 4293832
Offset: 0

Views

Author

Otokar Grosek (grosek(AT)elf.stuba.sk)

Keywords

Comments

In the set of all positive differences of the sequence each integer appears exactly once, i.e., lambda = 1.

References

  • T. Baginova, R. Jajcay, Notes on subtractive properties of natural numbers, Bulletin of the ICA, Vol. 25(1999), pp. 29-40
  • O. Grosek, R. Jajcay, Generalized Difference Sets on an Infinite Cyclic Semigroup, JCMCC, Vol. 13 (1993), pp. 167-174.

Crossrefs

Cf. A247414 (first differences).

Programs

  • Haskell
    import Data.List ((\\))
    a024431 n = a024431_list !! n
    a024431_list = 1 : 2 : f [2, 1] [2 ..] where
       f ks@(k:_) (j:js) =
         x : y : f (y : x : ks) ((js \\ map (y -) ks) \\ map (x -) ks)
         where y = x + j; x = 2 * k + 2
    -- Reinhard Zumkeller, Sep 16 2014
  • Maple
    M:= 100: # to get all differences up to M
    Agenda:= Array(1..M,1):
    a[1]:= 1: a[2]:= 2: Agenda[1]:= 0:
    for n from 2 by 2 do
      dm:= ArrayTools:-SearchArray(Agenda,1);
      if ArrayTools:-Size(dm)[1]=0  then break fi;
      dm:= dm[1];
      Agenda[dm]:= 0:
      a[n+1]:= 2*a[n]+2:
      a[n+2]:= a[n+1] + dm;
      for j from n by -1 to 1 while a[n+1] - a[j] <= M do
        Agenda[a[n+1]-a[j]]:= 0;
        if a[n+2]-a[j] <= M then Agenda[a[n+2]-a[j]]:= 0 fi
      od:
    od:
    seq(a[i],i=1..n); # Robert Israel, Oct 08 2015
  • Mathematica
    differenceQ[seq_, x_] := (r = False; Do[ If[ x == seq[[k]] - seq[[j]], r = True; Break[]], { j, 1, Length[seq] }, {k, 1, Length[seq] } ]; r); seq[1] = {1, 2}; seq[i_] := seq[i] = (k = Max[ seq[i-1] ]; j = First[ Select[ Range[k], !differenceQ[ seq[i-1], #] & , 1]]; Union[ seq[i-1], {2k+2, 2k+2+j} ] ); A024431 = seq[20] (* Jean-François Alcover, Jan 04 2012 *)

Formula

Let N_1={1, 2}. Given N_i, let N_{i+1} = N_i union {2k+2, 2k+2+j} where k = max element of N_i and j = smallest number not of form x-y for x, y in N_i, x>y. Union of all N_i gives sequence.
a(A115406(n)) - a(A115407(n)) = n; a(m) - a(n) = A115409(m*(m-1)/2+n+1), 1 <= n < m. - Reinhard Zumkeller, Jan 22 2006
For n > 0: a(n) = A115409(n,1) + 1. - Reinhard Zumkeller, Sep 16 2014

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 04 2000

A115406 Unique m such that A024431(m) - A024431(A115407(n)) = n.

Original entry on oeis.org

1, 3, 5, 2, 2, 3, 3, 7, 9, 4, 11, 4, 5, 13, 5, 4, 4, 15, 5, 5, 17, 19, 6, 21, 23, 6, 25, 27, 29, 31, 7, 33, 35, 7, 37, 6, 39, 6, 41, 43, 45, 6, 6, 7, 47, 7, 49
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 22 2006

Keywords

Comments

A024431(a(n)) - A024431(A115407(n)) = n.

Crossrefs

Cf. A115408.

A115407 Unique m such that A024431(A115406(n)) - A024431(m) = n.

Original entry on oeis.org

0, 2, 4, 1, 0, 1, 0, 6, 8, 3, 10, 2, 3, 12, 2, 1, 0, 14, 1, 0, 16, 18, 5, 20, 22, 4, 24, 26, 28, 30, 5, 32, 34, 4, 36, 3, 38, 2, 40, 42, 44, 1, 0, 3, 46, 2, 48
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 22 2006

Keywords

Comments

A024431(A115406(n)) - A024431(a(n)) = n.

Crossrefs

Cf. A115408.
Showing 1-4 of 4 results.