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

A084333 Erroneous version of A084331.

Original entry on oeis.org

2, 3, 5, 11, 7, 17, 29, 13, 31, 23, 37, 59, 19, 43, 71, 41, 61, 97, 53, 79, 47, 89, 127, 67
Offset: 1

Views

Author

Keywords

A081145 a(1)=1; thereafter, a(n) is the least positive integer which has not already occurred and is such that |a(n)-a(n-1)| is different from any |a(k)-a(k-1)| which has already occurred.

Original entry on oeis.org

1, 2, 4, 7, 3, 8, 14, 5, 12, 20, 6, 16, 27, 9, 21, 34, 10, 25, 41, 11, 28, 47, 13, 33, 54, 15, 37, 60, 17, 42, 68, 18, 45, 73, 19, 48, 79, 22, 55, 23, 58, 94, 24, 61, 99, 26, 66, 107, 29, 71, 115, 30, 75, 121, 31, 78, 126, 32, 81, 132, 35, 87, 140, 36, 91, 147, 38, 96, 155, 39
Offset: 1

Views

Author

Don Reble, Mar 08 2003

Keywords

Comments

The sequence is a permutation of the positive integers. The inverse is A081146.
Similar to A100707, except that when we subtract we use the largest possible k.
The 1977 paper of Slater and Velez proves that this sequence is a permutation of positive integers and conjectures that its absolute difference sequence (see A308007) is also a permutation. If we call this the "Slater-Velez permutation of the first kind", then they also constructed another permutation (the 2nd kind), for which they are able to prove that both the sequence (A129198) and its absolute difference (A129199) are true permutations. - Ferenc Adorjan, Apr 03 2007
The points appear to lie on three straight lines of slopes roughly 0.56, 1.40, 2.24 (click "graph", or see the Wilks link). I checked this for the first 10^6 terms using Allan Wilks's C program. See A308009-A308015 for further information about the three lines. - N. J. A. Sloane, May 14 2019

Examples

			a(4)=7 because the previous term is 4 and the differences |3-4|, |5-4| and |6-4| have already occurred.
After 7 we get 3 as the difference 4 has not occurred earlier. 5 follows 14 as the difference 9 has not occurred earlier.
		

Crossrefs

The sequence of differences is A099004 (see also A308007).
Similar to Murthy's sequence A093903, Cald's sequence (A006509) and Recamán's sequence A005132. See also A100707 (another version).
A308021 is an offspring of this sequence. - N. J. A. Sloane, May 13 2019
See A308009-A308015 for the lines that the points lie on.
A308172 gives smallest missing numbers.

Programs

  • Haskell
    import Data.List (delete)
    a081145 n = a081145_list !! (n-1)
    a081145_list = 1 : f 1 [2..] [] where
       f x vs ws = g vs where
         g (y:ys) = if z `elem` ws then g ys else y : f y (delete y vs) (z:ws)
                    where z = abs (x - y)
    -- Reinhard Zumkeller, Jul 02 2015
  • Mathematica
    f[s_] := Block[{d = Abs[Rest@s - Most@s], k = 1}, While[ MemberQ[d, Abs[k - Last@s]] || MemberQ[s, k], k++ ]; Append[s, k]]; NestList[s, {1}, 70] (* Robert G. Wilson v, Jun 09 2006 *)
    f[s_] := Block[{k = 1, d = Abs[Most@s - Rest@s], l = Last@s}, While[MemberQ[s, k] || MemberQ[d, Abs[l - k]], k++ ]; Append[s, k]]; Nest[f, {1}, 70] (* Robert G. Wilson v, Jun 13 2006 *)
  • PARI
    {SV_p1(n)=local(x,v=6,d=2,j,k); /* Slater-Velez permutation - the first kind (by F. Adorjan)*/ x=vector(n);x[1]=1;x[2]=2; for(i=3,n,j=3;k=1;while(k,if(k=bittest(v,j)||bittest(d,abs(j-x[i-1])),j++,v+=2^j;d+=2^abs(j-x[i-1]);x[i]=j))); return(x)} \\ Ferenc Adorjan, Apr 03 2007
    
  • Python
    A081145_list, l, s, b1, b2 = [1,2], 2, 3, set(), set([1])
    for n in range(3, 10**2):
        i = s
        while True:
            m = abs(i-l)
            if not (i in b1 or m in b2):
                A081145_list.append(i)
                b1.add(i)
                b2.add(m)
                l = i
                while s in b1:
                    b1.remove(s)
                    s += 1
                break
            i += 1 # Chai Wah Wu, Dec 15 2014
    

A084334 a(1) = 1; a(n+1) is the least squarefree m not already used such that |m-a(n)| is not equal to |a(k+1)-a(k)| for any k < n.

Original entry on oeis.org

1, 2, 5, 3, 7, 13, 6, 11, 19, 10, 21, 31, 14, 26, 39, 15, 29, 47, 17, 33, 53, 22, 37, 58, 23, 42, 65, 38, 66, 30, 55, 77, 34, 67, 35, 61, 95, 41, 70, 107, 43, 82, 122, 46, 87, 129, 51, 89, 133, 59, 105, 57, 102, 149, 62, 111, 161, 69, 127, 71, 123, 174, 73, 130, 183, 74
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 18 2003

Keywords

Crossrefs

Programs

  • Maple
    N:= 1000: # for terms before the first term > N
    A[1]:= 1:
    SF:= select(numtheory:-issqrfree, [$2..N]):
    DA:= {}:
    y:= 1:
    found:= true:
    for n from 2 while found do
      found:= false;
      for j from 1 to nops(SF) while not found do
        x:= SF[j];
        if not member(abs(x-y),DA) then
           found:= true;
           A[n]:= x;
           DA:= DA union {abs(x-y)};
           SF:= subsop(j=NULL, SF);
           y:= x;
        fi
    od od:
    convert(A,list); # Robert Israel, Feb 22 2024

Extensions

Edited and extended by David Wasserman, Dec 15 2004

A101595 a(1) = 2; a(n+1) is the least prime p not already used such that p-a(n) is not equal to a(k+1)-a(k) for any k < n.

Original entry on oeis.org

2, 3, 5, 11, 7, 17, 29, 13, 31, 19, 23, 37, 53, 43, 41, 61, 47, 71, 79, 59, 89, 67, 101, 73, 109, 83, 127, 97, 137, 103, 131, 107, 139, 181, 113, 151, 173, 167, 149, 197, 157, 211, 163, 223, 179, 229, 191, 257, 193, 239, 307, 199, 251, 277, 227, 283, 241, 233, 311
Offset: 1

Views

Author

David Wasserman, Dec 14 2004

Keywords

Comments

Apparently a rearrangement of the primes. Among the first 10000 terms the only missing primes are prime(9530,9532,9533,9541,9552,9556,9557,9560,9562,9563,...) = (99259,99289,99317,99401,99559,99581,99607,99643,99667,99679,...). - Zak Seidov, Nov 18 2014

Crossrefs

Cf. A084331.

A084335 a(1) = 1; a(n+1) is the least composite number m not already used such that |m-a(n)| is not equal to |a(k+1)-a(k)| for any k < n.

Original entry on oeis.org

4, 6, 9, 8, 12, 18, 10, 15, 22, 32, 14, 25, 16, 28, 42, 20, 33, 48, 21, 38, 54, 24, 44, 63, 26, 49, 70, 27, 51, 76, 30, 56, 84, 34, 65, 36, 68, 35, 69, 104, 39, 75, 114, 40, 78, 118, 45, 86, 128, 46, 90, 135, 50, 98, 145, 52, 105, 154, 55, 106, 158, 57, 111, 166, 58, 115
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 18 2003

Keywords

Crossrefs

Extensions

Edited and extended by David Wasserman, Dec 15 2004

A198519 a(2n-1) is the first unused prime which is the sum of the two preceding terms and such that a(2n) is that sum and it is also an unused prime.

Original entry on oeis.org

3, 5, 11, 19, 7, 37, 17, 61, 23, 101, 13, 137, 29, 179, 31, 239, 41, 311, 67, 419, 71, 557, 73, 701, 47, 821, 43, 911, 59, 1013, 79, 1151, 53, 1283, 97, 1433, 83, 1613, 127, 1823, 89, 2039, 109, 2237, 113, 2459, 139, 2711, 103, 2953, 107, 3163, 163, 3433, 131, 3727, 149, 4007, 181, 4337, 173, 4691
Offset: 1

Views

Author

Robert G. Wilson v, Dec 21 2012

Keywords

Examples

			a(3) does not equal 7 since 3+5+7 which is 15 is not a prime, but the next prime, 11, meets the criteria.
		

Crossrefs

Programs

  • Mathematica
    s = {3, 5}; k = 1; While[k < 31, p = s[[-2]] + s[[-1]]; q = 7; While[ !PrimeQ[p + q] || MemberQ[s, q] || MemberQ[s, p + q], q = NextPrime@ q]; AppendTo[s, q]; AppendTo[s, p + q]; k++]; s
Showing 1-6 of 6 results.