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.

A304752 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.

Original entry on oeis.org

1, 2, 6, 3, 12, 4, 20, 5, 10, 30, 15, 60, 420, 7, 14, 42, 21, 84, 28, 140, 35, 70, 210, 105, 630, 9, 18, 72, 8, 24, 120, 40, 240, 16, 48, 336, 56, 168, 840, 280, 1680, 80, 480, 32, 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
Offset: 1

Views

Author

Keywords

Comments

This is a variant of A113552.
From Michael De Vlieger, May 20 2018: (Start)
In the table below, we note a cycle that subtends for 41 <= n <= 2^14.
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.
n (mod 8) k or d 2 3 5 7
-------------------------------------------
0 5 2^(e-2) 5 7
1 6 2^(e-1) 3 5 7
2 EVEN 2^(e-1) 5
3 6 2^(e-1) 3 5
4 EVEN 2^e
5 3 2^e 3
6 7 2^e 3 7
7 EVEN 2^(e-1) 7
Conjectures:
1. All terms are divisible only by some combination of the smallest 4 primes.
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.
3. For n > 41 such that n (mod 8) = 4, a(n) = 2^((n-4)/8).
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)

Examples

			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.
		

Crossrefs

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

Programs

  • Maple
    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
    # second Maple program:
    b:= proc(n) is(n=1) end:
    a:= proc(n) option remember; local j, l, i, m;
          j:= a(n-1): l:= sort([numtheory[divisors](j)[]]);
          for i to nops(l) do if not b(l[i])
            then b(l[i]):=true; return l[i]
          fi od;
          for m while m in l or b(m*j) do od;
          b(m*j):=true; m*j
        end: a(1):=1:
    seq(a(n), n=1..100);  # Alois P. Heinz, May 22 2018
  • Mathematica
    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 *)
  • PARI
    up_to = (2^14)+1;
    v304752 = vector(up_to);
    m_occurrences = Map();
    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]);
    A304752(n) = v304752[n];
    
  • 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