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-3 of 3 results.

A175498 a(1)=1. a(n) = the smallest positive integer not occurring earlier such that a(n)-a(n-1) doesn't equal a(k)-a(k-1) for any k with 2 <= k <= n-1.

Original entry on oeis.org

1, 2, 4, 3, 6, 10, 5, 11, 7, 12, 9, 16, 8, 17, 15, 23, 13, 24, 18, 28, 14, 26, 19, 32, 20, 34, 21, 36, 25, 41, 22, 39, 30, 48, 27, 46, 29, 49, 31, 52, 37, 59, 33, 56, 40, 64, 35, 60, 38, 65, 42, 68, 43, 71, 44, 73, 45, 75, 51, 82, 47, 79, 112, 50, 84, 53, 88, 54, 90, 57, 94, 55, 93, 61, 100, 58, 98, 62, 103, 63, 105, 67
Offset: 1

Views

Author

Leroy Quet, May 31 2010

Keywords

Comments

This sequence is a permutation of the positive integers.
a(n+1)-a(n) = A175499(n).
Conjecture: the lexicographically earliest permutation of {1,2,...n} for which differences of adjacent numbers are all distinct (cf. A131529) has, for n-->infinity, this sequence as its prefix. - Joerg Arndt, May 27 2012

Crossrefs

Programs

  • Haskell
    import Data.List (delete)
    a175498 n = a175498_list !! (n-1)
    a175498_list = 1 : f 1 [2..] [] where
       f x zs ds = g zs where
         g (y:ys) | diff `elem` ds = g ys
                  | otherwise      = y : f y (delete y zs) (diff:ds)
                  where diff = y - x
    -- Reinhard Zumkeller, Apr 25 2015
  • Mathematica
    a[1] = 1; d[1] = 0; k = 1; z = 10000; zz = 120;
    A[k_] := Table[a[i], {i, 1, k}]; diff[k_] := Table[d[i], {i, 1, k}];
    c[k_] := Complement[Range[-z, z], diff[k]];
    T[k_] := -a[k] + Complement[Range[z], A[k]];
    Table[{h = Min[Intersection[c[k], T[k]]], a[k + 1] = a[k] + h, d[k + 1] = h, k = k + 1}, {i, 1, zz}];
    u = Table[a[k], {k, 1, zz}]  (* Clark Kimberling, May 13 2015 *)
  • Python
    A175498_list, l, s, b1, b2 = [1,2], 2, 3, set(), set([1])
    for n in range(3, 10**5):
        i = s
        while True:
            if not (i in b1 or i-l in b2):
                A175498_list.append(i)
                b1.add(i)
                b2.add(i-l)
                l = i
                while s in b1:
                    b1.remove(s)
                    s += 1
                break
            i += 1 # Chai Wah Wu, Dec 15 2014
    

Extensions

More terms from Sean A. Irvine, Jan 27 2011

A327845 Number of permutations of {1,2,...,n} such that for every k >= 1, the k-th differences are distinct.

Original entry on oeis.org

1, 2, 4, 12, 40, 132, 428, 1668, 7628, 36924, 199000, 1161824, 7231332
Offset: 1

Views

Author

Peter Kagey, Sep 27 2019

Keywords

Comments

a(n) <= A131529(n).

Examples

			For n = 5 the a(5) = 40 solutions are one of following ten permutations, or a reversal, complement, or reversal and complement of one of these permutations:
[1,3,4,2,5]
[1,4,3,5,2]
[1,4,5,3,2]
[1,5,2,4,3]
[1,5,3,2,4]
[2,1,4,5,3]
[2,1,5,3,4]
[2,3,5,1,4]
[2,4,1,5,3]
[2,5,4,1,3]
As a non-example, [1,5,4,2,3] does not satisfy the k-th differences property, because while its first differences ([4,-1,-2,1]) and its second differences ([-5,-1,3]) are distinct, its third differences ([4,4]) are not.
		

Crossrefs

Extensions

a(11) from Giovanni Resta, Sep 29 2019
a(12)-a(13) from Freddy Barrera, Oct 07 2019

A346658 Number of permutations of {0, 1, ..., n} that start with 0 and have pairwise distinct differences between adjacent terms.

Original entry on oeis.org

1, 1, 1, 3, 7, 27, 94, 425, 2100, 12252, 79865, 576220, 4532457, 38657929, 354600915, 3485914368, 36545825768, 407149542540
Offset: 0

Views

Author

Max Alekseyev, Jul 27 2021

Keywords

Comments

a(n) <= A131529(n).

Crossrefs

Cf. A131529.

Programs

  • PARI
    { A346658(n) = my(q,r=0); forperm(n,p, q=vector(n,i,p[i]-if(i>1,p[i-1])); r+=(#vecsort(q,,8)==n); ); r; }

Extensions

a(14)-a(17) from Martin Ehrenstein, Aug 01 2021
Showing 1-3 of 3 results.