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.

A075075 a(1) = 1, a(2) = 2 and then the smallest number not occurring earlier such that every term divides the product of its neighbors: a(n-1)*a(n+1)/a(n) is an integer.

Original entry on oeis.org

1, 2, 4, 6, 3, 5, 10, 8, 12, 9, 15, 20, 16, 24, 18, 21, 7, 11, 22, 14, 28, 26, 13, 17, 34, 30, 45, 27, 33, 44, 32, 40, 25, 35, 42, 36, 48, 52, 39, 51, 68, 56, 70, 50, 55, 66, 54, 63, 49, 77, 88, 64, 72, 81, 90, 60, 38, 19, 23, 46, 58, 29, 31, 62, 74, 37, 41, 82, 76, 114, 57, 43
Offset: 1

Views

Author

Amarnath Murthy, Sep 09 2002

Keywords

Comments

This is a permutation of natural numbers. [Leroy Quet asks (May 06 2009) if this is a theorem or just a conjecture.]
Every time a(n) divides a(n-1), a(n+1) is the next number that is not already in the sequence. I don't have a proof that a(n) divides a(n-1) infinitely often. - Franklin T. Adams-Watters, Jun 12 2014
It appears that a(n): 1,2,...,3,5,...,7,11,...,prime(2k),prime(2k+1),... - Thomas Ordowski, Jul 10 2015
The primes do appear to occur in increasing order, but prime(2k) is not always followed directly by prime(2k+1). For example, a(72) = 43 = prime(14), but a(125) = 47 = prime(15). - Robert Israel, Jul 10 2015
If a(n) and a(n+1) are primes then a(n) divides a(n-1). - Thomas Ordowski, Jul 10 2015 [Cf. second comment]
a(n) is the least multiple of a(n-1)/gcd(a(n-2),a(n-1)) that has not previously occurred. - Robert Israel, Jul 10 2015
Conjecture: if a(n) divides a(n-1) then a(n+1) is prime. - Thomas Ordowski, Jul 11 2015
It seems that a(n) and a(n+1) are consecutive primes if and only if a(n) divides a(n-1) and a(n) < a(n+1). - Thomas Ordowski, Jul 13 2015

Crossrefs

Cf. A075076 (ratios), A160256, A064413 (EKG sequence).
Cf. A160516 (inverse), A185635 (fixed points).

Programs

  • Haskell
    import Data.List (delete)
    a075075 n = a075075_list !! (n-1)
    a075075_list = 1 : 2 : f 1 2 [3..] where
      f z z' xs = g xs where g (u:us) =
        if (z * u) `mod` z' > 0 then g us else u : f z' u (delete u xs)
    -- Reinhard Zumkeller, Dec 19 2012
    
  • MATLAB
    N = 10^6;
    Avail = ones(1,N);
    A = zeros(1,N);
    A(1) = 1; A(2) = 2;
    Avail([1,2]) = 0;
    for n=3:N
      q = round(A(n-1)/gcd(A(n-1),A(n-2)));
      b = find(Avail(q*[1:floor(N/q)]),1,'first');
      if numel(b) == 0
         break
      end
      A(n) = q*b;
      Avail(A(n)) = 0;
    end
    A = A(1:n-1); % Robert Israel, Jul 10 2015
  • Maple
    b:= proc(n) option remember; false end: a:= proc(n) option remember; local k, m; if n<3 then b(n):= true; n else m:= denom(a(n-2) /a(n-1)); for k from m by m while b(k) do od; b(k):= true; k fi end: seq(a(n), n=1..100); # Alois P. Heinz, May 16 2009
  • Mathematica
    f[s_List] := Block[{m = Numerator[ s[[ -1]]/s[[ -2]] ]}, k = m; While[ MemberQ[s, k], k += m]; Append[s, k]]; Nest[f, {1, 2}, 70] (* Robert G. Wilson v, May 20 2009 *)
  • Python
    from math import gcd
    A075075_list, l1, l2, m, b = [1,2], 2, 1, 2, {1,2}
    for _ in range(10**3):
        i = m
        while True:
            if not i in b:
                A075075_list.append(i)
                l1, l2, m = i, l1, i//gcd(l1,i)
                b.add(i)
                break
            i += m # Chai Wah Wu, Dec 09 2014
    

Extensions

More terms from Sascha Kurz, Feb 03 2003