login
Beginning with a(1) = 1, for n > 1, a(n) = the least divisor of a(n-1) not included earlier, otherwise a(n) = the least multiple m*a(n-1) such that m is not a divisor of a(n-1) and m*a(n-1) is not included earlier.
2

%I #19 Jan 01 2021 12:04:53

%S 1,2,6,3,12,4,20,5,10,30,15,60,420,7,14,42,21,84,28,140,35,70,210,105,

%T 630,9,18,72,8,24,120,40,240,16,48,336,56,168,840,280,1680,80,480,32,

%U 96,672,112,560,3360,160,960,64,192,1344,224,1120,6720,320,1920,128,384,2688,448,2240,13440,640,3840,256,768,5376,896,4480,26880,1280,7680,512

%N Beginning with a(1) = 1, for n > 1, a(n) = the least divisor of a(n-1) not included earlier, otherwise a(n) = the least multiple m*a(n-1) such that m is not a divisor of a(n-1) and m*a(n-1) is not included earlier.

%C This is a variant of A113552.

%C From _Michael De Vlieger_, May 20 2018: (Start)

%C In the table below, we note a cycle that subtends for 41 <= n <= 2^14.

%C Let e = floor(n/8). We write multiple k if the condition is false, or the parity of divisor d if d does not occur in a. We can express a(n) as the product of the smallest four primes as shown below.

%C n (mod 8) k or d 2 3 5 7

%C -------------------------------------------

%C 0 5 2^(e-2) 5 7

%C 1 6 2^(e-1) 3 5 7

%C 2 EVEN 2^(e-1) 5

%C 3 6 2^(e-1) 3 5

%C 4 EVEN 2^e

%C 5 3 2^e 3

%C 6 7 2^e 3 7

%C 7 EVEN 2^(e-1) 7

%C Conjectures:

%C 1. All terms are divisible only by some combination of the smallest 4 primes.

%C 2. Powers 2^e, positive integer e, are at n = {1, 2, 6, 29, 34, 44, 52, 60, 68, ...}; first differences are {1, 4, 23, 5, 10, 8, 8, 8, ...}, and 8 thereafter.

%C 3. For n > 41 such that n (mod 8) = 4, a(n) = 2^((n-4)/8).

%C 4. For n > 26 all terms are even. Odd terms are {1, 3, 5, 15, 7, 21, 35, 105, 9} at indices {1, 4, 8, 11, 14, 17, 21, 24, 26}. (End)

%H Antti Karttunen & Michael De Vlieger, <a href="/A304752/b304752.txt">Table of n, a(n) for n = 1..16384</a>

%e After a(27) = 18 = 2 * 3^2, the next term a(28) is neither 2*18 = 2^2 * 3^2, nor 3*18 = 2 * 3^3 as both 2 and divide 18. But 4 does not divide 18, and 4*18 = 72 haven't yet been used in the sequence, thus a(28) = 72.

%p lim:=60: with(numtheory): membera := proc(val) global a, n: local j: for j from 1 to n-1 do if(a[j]=val)then return true: fi: od: return false: end: a[1]:=1:for n from 2 to lim do d:=sort([divisors(a[n-1])[]]): s:=true: for k from 1 to nops(d) do if(not membera(d[k]))then a[n]:=d[k]:s:=false: break:fi:od: if(s)then for j from 2 do if(not member(j, d) and not membera(j*a[n-1]))then a[n]:=j*a[n-1]:break: fi:od:fi:od: seq(a[n], n=1..lim); # _Nathaniel Johnston_, May 10 2011, given originally for A113552

%p # second Maple program:

%p b:= proc(n) is(n=1) end:

%p a:= proc(n) option remember; local j, l, i, m;

%p j:= a(n-1): l:= sort([numtheory[divisors](j)[]]);

%p for i to nops(l) do if not b(l[i])

%p then b(l[i]):=true; return l[i]

%p fi od;

%p for m while m in l or b(m*j) do od;

%p b(m*j):=true; m*j

%p end: a(1):=1:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, May 22 2018

%t f[s_] := Append[s, d = Divisors[ s[[ -1]]]; If[ Complement[d, s] != {}, Complement[d, s][[1]], k = 2; While[ Mod[ s[[ -1]], k] == 0 || MemberQ[s, k*s[[ -1]]], k++ ]; k*s[[ -1]] ]]; Nest[f, {1}, 60] (* _Robert G. Wilson v_, Aug 20 2006, given originally for A113552 *)

%o (PARI)

%o up_to = (2^14)+1;

%o v304752 = vector(up_to);

%o m_occurrences = Map();

%o k=0; prev=1; for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m_occurrences,d),v304752[n] = d;mapput(m_occurrences,d,n);break)); if(!v304752[n], m = 1; try = prev; while(!(prev%m) || mapisdefined(m_occurrences,try), m++; try = prev*m); mapput(m_occurrences,v304752[n] = try,n)); prev = v304752[n]);

%o A304752(n) = v304752[n];

%o (PARI) A304752(n,a=1,list=List(a)/*set to 0 to get just a(n)*/,U=[])={ for(i=2,n, U=setunion(U,[a]); fordiv(a,d,setsearch(U,d)||[a=-d,break]); if(a>0, for(m=2,oo, a%m && !setsearch(U,m*a)&& (a*=m)&& break),a=-a);list&& listput(list,a); /*a%2&&printf("a(%d)=%d, ",i,a)*/);if(list,list,a)} \\ _M. F. Hasler_, Dec 26 2020

%Y Differs from A113552 for the first time at n=28, where a(28) = 72, while A113552(28) = 90.

%K nonn

%O 1,2

%A _Antti Karttunen_, _Michael De Vlieger_, and _Robert G. Wilson v_, May 19 2018