%I #72 Apr 25 2016 12:05:00
%S 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,
%T 45,27,33,44,32,40,25,35,42,36,48,52,39,51,68,56,70,50,55,66,54,63,49,
%U 77,88,64,72,81,90,60,38,19,23,46,58,29,31,62,74,37,41,82,76,114,57,43
%N 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.
%C This is a permutation of natural numbers. [_Leroy Quet_ asks (May 06 2009) if this is a theorem or just a conjecture.]
%C 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
%C It appears that a(n): 1,2,...,3,5,...,7,11,...,prime(2k),prime(2k+1),... - _Thomas Ordowski_, Jul 10 2015
%C 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
%C If a(n) and a(n+1) are primes then a(n) divides a(n-1). - _Thomas Ordowski_, Jul 10 2015 [Cf. second comment]
%C 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
%C Conjecture: if a(n) divides a(n-1) then a(n+1) is prime. - _Thomas Ordowski_, Jul 11 2015
%C 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
%H Alois P. Heinz, <a href="/A075075/b075075.txt">Table of n, a(n) for n = 1..10000</a>
%p 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
%t 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 *)
%o (Haskell)
%o import Data.List (delete)
%o a075075 n = a075075_list !! (n-1)
%o a075075_list = 1 : 2 : f 1 2 [3..] where
%o f z z' xs = g xs where g (u:us) =
%o if (z * u) `mod` z' > 0 then g us else u : f z' u (delete u xs)
%o -- _Reinhard Zumkeller_, Dec 19 2012
%o (Python)
%o from __future__ import division
%o from fractions import gcd
%o A075075_list, l1, l2, m, b = [1,2], 2, 1, 2, {1,2}
%o for _ in range(10**3):
%o ....i = m
%o ....while True:
%o ........if not i in b:
%o ............A075075_list.append(i)
%o ............l1, l2, m = i, l1, i//gcd(l1,i)
%o ............b.add(i)
%o ............break
%o ........i += m # _Chai Wah Wu_, Dec 09 2014
%o (MATLAB)
%o N = 10^6;
%o Avail = ones(1,N);
%o A = zeros(1,N);
%o A(1) = 1; A(2) = 2;
%o Avail([1,2]) = 0;
%o for n=3:N
%o q = round(A(n-1)/gcd(A(n-1),A(n-2)));
%o b = find(Avail(q*[1:floor(N/q)]),1,'first');
%o if numel(b) == 0
%o break
%o end
%o A(n) = q*b;
%o Avail(A(n)) = 0;
%o end
%o A = A(1:n-1); % _Robert Israel_, Jul 10 2015
%Y Cf. A075076 (ratios), A160256, A064413 (EKG sequence).
%Y Cf. A160516 (inverse), A185635 (fixed points).
%K nice,nonn,look
%O 1,2
%A _Amarnath Murthy_, Sep 09 2002
%E More terms from _Sascha Kurz_, Feb 03 2003
|