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.

Previous Showing 21-30 of 60 results. Next

A327743 a(n) = smallest positive number not already in the sequence such that for each k = 1, ..., n-1, the k-th differences are distinct.

Original entry on oeis.org

1, 2, 4, 3, 6, 11, 5, 9, 7, 13, 10, 18, 8, 15, 27, 14, 23, 12, 22, 17, 28, 16, 29, 20, 34, 19, 35, 21, 36, 32, 24, 42, 26, 43, 25, 44, 66, 33, 53, 30, 51, 31, 54, 37, 61, 39, 64, 38, 67, 40, 70, 41, 68, 47, 75, 50, 76, 45, 77, 49, 80, 48, 81, 46, 82, 52, 86
Offset: 1

Views

Author

Peter Kagey, Sep 24 2019

Keywords

Comments

Is this sequence a permutation of the positive integers?
Does each k-th difference contain all nonzero integers?
It is not difficult to show that if a(1), ..., a(k) satisfy the requirements, then any sufficiently large number is a candidate for a(k+1). So a(k) exists for all k. - N. J. A. Sloane, Sep 24 2019
The original definition was "Lexicographically earliest infinite sequence of distinct positive integers such that for every k >= 1, the k-th differences are distinct."
If only first differences are considered, one gets the classical Mian-Chowla sequence A005282. - M. F. Hasler, Oct 09 2019

Examples

			Illustration of the first eight terms of the sequence.
k | k-th differences
--+---------------------------------
0 |   1,  2,   4,   3,   6, 11, 5, 9
1 |   1,  2,  -1,   3,   5, -6, 4
2 |   1, -3,   4,   2, -11, 10
3 |  -4,  7,  -2, -13,  21
4 |  11, -9, -11,  34
5 | -20, -2,  45
6 |  18, 47
7 |  29
		

Crossrefs

Cf. A175498.
First differences: A327452; leading column of difference triangle: A327457.
If ALL terms of the difference triangle must be distinct, see A327460 and A327762.
Cf. A005282.

Programs

  • Mathematica
    a[1] = 1;
    a[n_] := a[n] = For[aa = Array[a, n-1]; an = 1, True, an++, If[FreeQ[aa, an], aa = Append[aa, an]; If[AllTrue[Range[n-1], Unequal @@ Differences[ aa, #]&], Return[an]]]];
    a /@ Range[1, 100] (* Jean-François Alcover, Oct 26 2019 *)

Extensions

"Infinite" added to definition (for otherwise the one-term sequence 1 is earlier). - N. J. A. Sloane, Sep 25 2019
Changed definition to avoid use of "Lexicographically earliest infinite sequence" and the associated existence questions. - N. J. A. Sloane, Sep 28 2019

A337655 a(1)=1; thereafter, a(n) is the smallest number such that both the addition and multiplication tables for (a(1),...,a(n)) contain n*(n+1)/2 different entries (the maximum possible).

Original entry on oeis.org

1, 2, 5, 7, 15, 22, 31, 50, 68, 90, 101, 124, 163, 188, 215, 253, 322, 358, 455, 486, 527, 631, 702, 780, 838, 920, 1030, 1062, 1197, 1289, 1420, 1500, 1689, 1765, 1886, 2114, 2353, 2410, 2570, 2686, 2857, 3063, 3207, 3477, 3616, 3845, 3951, 4150, 4480, 4595, 4746, 5030, 5286, 5698, 5999, 6497, 6624, 6938, 7219, 7661, 7838, 8469, 8665, 9198, 9351, 9667, 9966
Offset: 1

Views

Author

Jean-Paul Delahaye, Sep 30 2020

Keywords

Comments

If one specifies that not only are there n(n+1)/2 distinct numbers in the addition and multiplication tables, but that all n(n+1) numbers are distinct, then the sequence is A337946 - David A. Corneth, Oct 02 2020

Crossrefs

See A337659 and A337660 (for the addition table), and A337661 and A337662 (for the multiplication table).
For similar sequences that focus just on the addition or multiplication tables, see A005282 and A066720.
Cf. also A337946.

Programs

  • Mathematica
    terms=67;a[1]=b[1]=1;a1=b1={1};Do[k=a[n-1]+1;While[a2=Union@Join[{2k},Array[a@#+k&,n-1]];b2=Union@Join[{k^2},Array[b@#*k&,n-1]];Intersection[a2,a1]!={}||Intersection[b2,b1]!={},k++];a[n]=b[n]=k;a1=Union[a1,a2];b1=Union[b1,b2],{n,2,terms}];Array[a,terms] (* Giorgos Kalogeropoulos, Nov 15 2021 *)

A337946 a(1)=1; thereafter, a(n) is the smallest number such that the addition and multiplication tables for (a(1),...,a(n)) together contain n*(n+1) different entries (the maximum possible).

Original entry on oeis.org

1, 3, 7, 12, 22, 30, 47, 61, 85, 113, 126, 177, 193, 246, 279, 321, 341, 428, 499, 571, 616, 686, 754, 854, 975, 1052, 1150, 1317, 1376, 1457, 1513, 1664, 1761, 1961, 2307, 2434, 2591, 2795, 2843, 3057, 3226, 3405, 3508, 3776, 3930, 4023, 4196, 4575, 4731
Offset: 1

Views

Author

Peter Kagey, Oct 02 2020

Keywords

Examples

			The addition table of a(k) for k=1..5:
   + | 1 3  7 12 22
  ---+-------------
   1 | 2 4  8 13 23
   3 |   6 10 15 25
   7 |     14 19 29
  12 |        24 34
  22 |           44
The multiplication table of a(k) for k=1..5:
   * | 1 3  7  12  22
  ---+---------------
   1 | 1 3  7  12  22
   3 |   9 21  36  66
   7 |     49  84 154
  12 |        144 264
  22 |            484
These two tables contain the 5*(5+1) = 30 values {1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 15, 19, 21, 22, 23, 24, 25, 29, 34, 36, 44, 49, 66, 84, 144, 154, 264, 484}.
		

Crossrefs

Cf. A005282 (addition table), A066720 (multiplication table), A337655, A337656, A337947.

Programs

  • Mathematica
    j={k=1};Do[While[l=Join[j,{++k}];g=Union[Sort/@Tuples[l,{2}]];p=Times@@#&/@g;s=Total/@g;!SameQ@@Flatten[{Length@Union@Flatten@{p,s},Length@l(Length@l+1)}]];j=Join[j,{k}];k=Last@j,48];j (* Giorgos Kalogeropoulos, Nov 16 2021 *)

A001857 a(1)=2, a(2)=3; for n >= 3, a(n) is smallest number that is uniquely of the form a(j) + a(k) with 1 <= j < k < n.

Original entry on oeis.org

2, 3, 5, 7, 8, 9, 13, 14, 18, 19, 24, 25, 29, 30, 35, 36, 40, 41, 46, 51, 56, 63, 68, 72, 73, 78, 79, 83, 84, 89, 94, 115, 117, 126, 153, 160, 165, 169, 170, 175, 176, 181, 186, 191, 212, 214, 230, 235, 240, 245, 266, 273, 278, 283, 288, 325, 331, 332, 337, 342
Offset: 1

Views

Author

Keywords

Comments

An Ulam-type sequence - see A002858 for many further references, comments, etc.
A plot of the first 10^6 terms shows a nearly straight line having a slope of about 11.1. In contrast to A002858, this sequence has many consecutive numbers; of the first 10^6 terms, consecutive numbers appear 141674 times! - T. D. Noe, Jan 21 2008

References

  • S. R. Finch, Patterns in 1-additive sequences, Experimental Mathematics 1 (1992), 57-63.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 145-151.
  • R. K. Guy, Unsolved Problems in Number Theory, Section C4.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • S. M. Ulam, Problems in Modern Mathematics, Wiley, NY, 1960, p. ix.

Crossrefs

Programs

  • Haskell
    a001857 n = a001857_list !! (n-1)
    a001857_list = 2 : 3 : ulam 2 3 a001857_list
    -- Function ulam as defined in A002858.
    -- Reinhard Zumkeller, Nov 03 2011
  • Mathematica
    s = {2, 3}; Do[ AppendTo[s, n = Last[s]; While[n++; Length[ DeleteCases[ Intersection[s, n-s], n/2, 1, 1]] != 2]; n], {100}]; s (* Jean-François Alcover, Sep 08 2011 *)

Extensions

More terms from Jud McCranie

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

A001463 Partial sums of A001462; also a(n) is the last occurrence of n in A001462.

Original entry on oeis.org

1, 3, 5, 8, 11, 15, 19, 23, 28, 33, 38, 44, 50, 56, 62, 69, 76, 83, 90, 98, 106, 114, 122, 131, 140, 149, 158, 167, 177, 187, 197, 207, 217, 228, 239, 250, 261, 272, 284, 296, 308, 320, 332, 344, 357, 370, 383, 396, 409, 422, 436, 450, 464, 478, 492, 506, 521, 536, 551, 566, 581, 596
Offset: 1

Views

Author

Keywords

Comments

Vardi gives several identities satisfied by A001463 and this sequence.

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Programs

Formula

a(n) is asymptotic to tau^(1-tau)*n^tau where tau is the golden ratio, tau=(1+sqrt(5))/2. More precisely, a(n)= tau^(1-tau)*n^tau + c*n^(1/tau)+0(n^(1/tau)) where c is a constant around 0.6. Is there any known value for c? - Benoit Cloitre, Oct 29 2002

A051788 a(1) = 1, a(2) = 3; for n>2, a(n) = least value > a(n-1) such that pairwise differences are unique.

Original entry on oeis.org

1, 3, 4, 8, 14, 22, 31, 46, 62, 82, 108, 137, 149, 171, 206, 259, 303, 367, 414, 479, 545, 578, 658, 728, 848, 921, 1004, 1130, 1268, 1352, 1454, 1584, 1669, 1876, 1915, 2114, 2303, 2404, 2563, 2797, 2991, 3112, 3270, 3423, 3592, 3773, 3889, 4284, 4727, 4819
Offset: 1

Views

Author

Gerald A. Mischke (Gerald.Mischke(AT)mutualofomaha.com), Dec 09 1999

Keywords

Comments

A variation on A005282 (Mian-Chowla, where sums of pairs of elements are unique).

Crossrefs

Cf. A005282, A080201 (for differences that do not occur).

A101274 a(1)=1; for n>1, a(n) is the smallest positive integer such that the set of all sums of adjacent elements up to and including a(n) contains no number more than once.

Original entry on oeis.org

1, 2, 4, 5, 8, 10, 14, 21, 15, 16, 26, 25, 34, 22, 48, 38, 71, 40, 74, 90, 28, 69, 113, 47, 94, 54, 46, 143, 153, 83, 128, 49, 249, 75, 133, 225, 125, 131, 270, 145, 230, 199, 237, 206, 201, 299, 136, 346, 72, 272, 120, 55, 453, 247, 376, 427, 124, 535, 87, 242, 431, 283, 227, 212, 940, 318, 387, 311, 391, 325
Offset: 1

Views

Author

David S. Newman, Dec 20 2004

Keywords

Comments

Does the sequence together with the sums of adjacent elements include all positive integers? Choosing starting values other than a(1)=1 gives other sequences. We could ask, for a given n, which such sequences have the smallest sum of a(k) from k=1 to n.
The first differences of A005282. [Zak Seidov, Nov 06 2010]

Examples

			a(8)=21 because the set of sums of adjacent elements to this point, call it s(7) is {1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,23,24,27,29,30,32,37,41,43,44}.
The first number missing from this list is 15, but a(8) cannot equal 15 because 15+14=29 and 29 is already in s(7). Similarly a(8) cannot be 16 because 16+14=30.
		

Crossrefs

Cf. A005282.

Programs

  • Mathematica
    t = {1}; sms = {2}; k = 1;
    Do[k++; While[Intersection[sms, k + t] != {}, k++]; sms = Join[sms, t + k, {2 k}]; AppendTo[t, k], {41}];
    Differences[t] (* Jean-François Alcover, Feb 13 2019, after T. D. Noe in A005282 *)
  • Python
    from itertools import count, islice
    def A101274_gen(): # generator of terms
        aset1, aset2, alist, n = {1}, set(), [1], 1
        for k in count(2):
            bset2 = {k<<1}
            if (k<<1) not in aset2:
                for d in aset1:
                    if (m:=d+k) in aset2:
                        break
                    bset2.add(m)
                else:
                    yield k-n
                    n = k
                    alist.append(k)
                    aset1.add(k)
                    aset2.update(bset2)
    A101274_list = list(islice(A101274_gen(),30)) # Chai Wah Wu, Sep 05 2023

A126428 a(1) = 1; for n > 1, a(n) = smallest number > a(n-1) such that pairwise sums and (absolute) differences of distinct elements are all distinct.

Original entry on oeis.org

1, 2, 6, 12, 21, 37, 58, 84, 112, 129, 173, 213, 266, 307, 373, 446, 513, 589, 639, 829, 916, 1061, 1209, 1297, 1429, 1461, 1626, 1783, 1964, 2220, 2576, 2653, 2875, 3064, 3307, 3605, 3889, 4228, 4332, 4412, 4658, 5337, 5618, 5647, 6281, 6511, 7001, 7388
Offset: 1

Views

Author

Philippe Lallouet (philip.lallouet(AT)wanadoo.fr), Mar 11 2007, Jul 27 2007

Keywords

Examples

			a(1) = 1, a(2) = 2; n = 3: k = 3, k-a(2) = 1 = a(2)-a(1), so a(3) > 3; k = 4: k-a(1) = 3 = a(1)+a(2), so a(3) > 4; k = 5: k-a(2) = 3 = a(1)+a(2), so a(3) > 5; k=6: k-a(1) = 5, k-a(2) = 4, k+a(1) = 7, k+a(2) = 8, a(2)-a(1) = 1, a(2)+a(1) = 3 are all distinct, hence a(3) = 6.
		

Crossrefs

Cf. A005282 (Mian-Chowla sequence).

Programs

  • Haskell
    import Data.List (intersect)
    a126428 n = a126428_list !! (n-1)
    a126428_list =  magics 1 [] [] where
       magics :: Integer -> [Integer] -> [Integer] -> [Integer]
       magics n ms tests
          | tests `intersect` nMinus == [] && tests `intersect` nPlus == []
          = n : magics (n+1) (n:ms) (nMinus ++ nPlus ++ tests)
          | otherwise
          = magics (n+1) ms tests
          where nMinus = map (n -) ms
                nPlus  = map (n +) ms
    -- magics is the generator for a004210_list, cf. A004210, magic integers.
    -- Reinhard Zumkeller, Mar 03 2011
  • PARI
    {m=48; u=[]; s=Set(); k=0; for(n=1, m, b=1; while(b, b=0; k++; j=0; while(!b&&j<#u, j++; if(setsearch(s, k-u[j])||setsearch(s, k+u[j]), b=1))); print1(k, ","); if(n
    				

Extensions

Edited and extended by Klaus Brockhaus, Sep 05 2007

A281511 The lexicographically earliest sequence of positive integers such that for all k >= j >= 1, if a(n) = a(n + j) = a(n + k) then a(n + j + k) != a(n).

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 3, 1, 3, 2, 4, 3, 1, 4, 4, 2, 5, 3, 3, 4, 1, 4, 5, 2, 5, 5, 6, 6, 7, 5, 1, 3, 2, 4, 6, 3, 6, 7, 7, 5, 6, 7, 8, 4, 1, 8, 8, 2, 9, 7, 3, 5, 6, 8, 9, 6, 7, 9, 4, 8, 10, 9, 9, 2, 10, 1, 3, 5, 8, 10, 10, 4, 6, 7, 11, 11, 12, 9, 7, 9, 1, 10, 11, 2
Offset: 1

Views

Author

Peter Kagey, Apr 13 2017

Keywords

Comments

Indices of ones are given by A005282.
Conjecture: For all positive i, j, k there exists some n such that a(n) = a(n + j) = a(n + k) = i.
Also, if a(k)=a(j) for any kMarc Morgenegg, May 31 2024

Examples

			For n=1 through n=7, the terms are as follows:
a(1) = 1;
a(2) = 1;
a(3) != 1 because a(1) = a(1+1) = a(1+1) so a(1+1+1) != a(1);
a(3) = 2, the least value such that satisfies the sequence condition;
a(4) = 1;
a(5) != 1 because a(1) = a(1+1) = a(1+3) so a(1+1+3) != a(1);
a(5) = 2, the least value such that satisfies the sequence condition;
a(6) != 1 because a(2) = a(2+2) = a(2+2) so a(2+2+2) != a(2);
a(6) = 2, the least value such that satisfies the sequence condition;
a(7) != 1 because a(1) = a(1+3) = a(1+3) so a(1+3+3) != a(1);
a(7) != 2 because a(3) = a(3+2) = a(3+2) so a(3+2+2) != a(3);
a(7) = 3, the least value such that satisfies the sequence condition.
		

Crossrefs

Cf. A005282.
Previous Showing 21-30 of 60 results. Next