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

A242309 a(n) = A211384(2n)/A211384(n).

Original entry on oeis.org

3, 2, 3, 3, 3, 2, 3, 4, 6, 6, 9, 9, 9, 8, 6, 5, 6, 4, 6, 7, 6, 5, 6, 6, 6, 8, 8, 9, 12, 12, 12, 14, 13, 12, 15, 18, 18, 12, 18, 20, 21, 20, 21, 21, 21, 20, 21, 20, 21, 24, 24, 20, 27, 26, 27, 20, 20, 16, 18, 21, 21, 21, 19, 18, 27, 30, 33, 33, 33, 48, 51, 42
Offset: 1

Views

Author

J. Lowell, May 10 2014

Keywords

Examples

			a(11) = 9 because A211384(22) = 198 and A211384(11) = 22 and 198/22 = 9.
		

Crossrefs

Cf. A211384.

Programs

  • Maple
    b:= proc(n) b(n):= `if`(n<3, 2*n-1, (h-> ceil((b(n-1)+1)/h)*h)
        (ilcm(map(b, numtheory[divisors](n) minus {1, n})[]))) end:
    a:= n-> b(2*n)/b(n):
    seq(a(n), n=1..100);  # Alois P. Heinz, May 20 2014
  • Mathematica
    b[1] = 1; b[2] = 3; b[n_] := b[n] = (Ceiling[(b[n-1]+1)/#]*#&)[LCM @@ Map[b, Most[Divisors[n]]]];
    a[n_] := b[2n]/b[n];
    Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Mar 27 2017, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, May 10 2014

A222208 a(1) = 1, a(2) = 3; for n>2, a(n) = smallest number not in {a(1), ..., a(n-1)} such that a(n) is divisible by a(d) for all divisors d of n.

Original entry on oeis.org

1, 3, 2, 6, 4, 12, 5, 18, 8, 24, 7, 36, 9, 15, 16, 54, 10, 48, 11, 72, 20, 21, 13, 108, 28, 27, 32, 30, 14, 96, 17, 162, 42, 60, 40, 144, 19, 33, 90, 216, 22, 120, 23, 84, 64, 39, 25, 324, 35, 168, 50, 270, 26, 192, 56, 180, 44, 126, 29, 288, 31, 51, 80, 486
Offset: 1

Views

Author

Alois P. Heinz, Feb 12 2013

Keywords

Comments

Permutation of the natural numbers A000027 with inverse permutation A222209.

Crossrefs

Programs

  • Haskell
    import Data.List (delete)
    a222208 n = a222208_list !! (n-1)
    a222208_list = 1 : 3 : f 3 (2 : [4 ..]) where
       f u vs = g vs where
         g (w:ws) = if all (== 0) $ map ((mod w) . a222208) $ a027751_row u
                       then w : f (u + 1) (delete w vs) else g ws
    -- Reinhard Zumkeller, Feb 13 2013
  • Maple
    b:= proc(n) false end:
    a:= proc(n) option remember; local h, i;
          if n<3 then h:= 2*n-1 else a(n-1); h:= ilcm(map(a,
             numtheory[divisors](n) minus {1, n})[]) fi;
          for i while b(i*h) do od;
          b(i*h):= true; i*h
        end:
    seq(a(n), n=1..100);
  • Mathematica
    a[1] = 1; a[2] = 3; a[n_] := a[n] = Module[{d, s, c, k}, d = Divisors[n] ~Complement~ {1, n}; For[s = Sort[Array[a, n-1]]; c = Complement[ Range[ Last[s]], s]; k = If[c == {}, Last[s]+1, First[c]], True, k++, If[FreeQ[s, k], If[AllTrue[d, Divisible[k, a[#]]&], Return[k]]]]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 22 2017 *)

A222209 Inverse of permutation in A222208.

Original entry on oeis.org

1, 3, 2, 5, 7, 4, 11, 9, 13, 17, 19, 6, 23, 29, 14, 15, 31, 8, 37, 21, 22, 41, 43, 10, 47, 53, 26, 25, 59, 28, 61, 27, 38, 67, 49, 12, 71, 73, 46, 35, 79, 33, 83, 57, 89, 97, 101, 18, 103, 51, 62, 69, 107, 16, 109, 55, 74, 113, 127, 34, 131, 137, 121, 45, 139
Offset: 1

Views

Author

Alois P. Heinz, Feb 12 2013

Keywords

Comments

Permutation of the natural numbers A000027 with inverse permutation A222208.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a222209 = (+ 1) . fromJust . (`elemIndex` a222208_list)
    -- Reinhard Zumkeller, Feb 13 2013
  • Maple
    b:= proc(n) false end:
    g:= proc(n) option remember; local h, i;
          if n<3 then h:= 2*n-1 else g(n-1); h:= ilcm(map(g,
             numtheory[divisors](n) minus {1, n})[]) fi;
          for i while b(i*h) do od;
          b(i*h):= true; i*h
        end:
    a:= proc() local t, a; t, a:= -1, proc() -1 end;
          proc(n) local h;
            while a(n) = -1 do
              t:= t+1; h:= g(t);
              if a(h) = -1 then a(h):= t fi
            od; a(n)
          end
        end():
    seq(a(n), n=1..100);
  • Mathematica
    terms = 100; b[1] = 1; b[2] = 3; b[n_] := b[n] = Module[{d, s, c, k}, d = Divisors[n] ~Complement~ {1, n}; For[s = Sort[Array[b, n - 1]]; c = Complement[ Range[ Last[s]], s]; k = If[c == {}, Last[s] + 1, First[c]], True, k++, If[FreeQ[s, k], If[AllTrue[d, Divisible[k, b[#]] &], Return[k]]]]]; a[n_] := a[n] = For[k = 1, True, k++, If[b[k] == n, Return[k]]]; Array[a, terms] (* Jean-François Alcover, Feb 22 2018 *)

A242410 a(1)=1 and for n>1, a(n) is the smallest number greater than a(n-1) such that a(n) is not divisible by a(d) for any divisor d of n (except 1 and n).

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 29, 31, 33, 34, 37, 38, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 57, 58, 59, 60, 61, 62, 63, 64, 67, 68, 71, 73, 77, 79, 81, 82, 83, 84
Offset: 1

Views

Author

J. Lowell, May 13 2014

Keywords

Comments

Contains the primes (A000040). - Robert Israel, Jul 05 2017

Examples

			a(4) cannot be 4 because 4 is divisible by a(2) = 2. a(24) cannot be 25 because 25 is divisible by a(4) = 5.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember; local Q,k;
         Q:= map(procname, numtheory:-divisors(n) minus {1,n});
         for k from procname(n-1) + 1 do
           if andmap(t -> (k mod t > 0), Q) then return k fi
         od
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Jul 05 2017
  • Mathematica
    a = {1}; Do[k = a[[n - 1]] + 1; While[AnyTrue[Most@ Rest@ Divisors@ n, Divisible[k, a[[#]] ] &], k++]; AppendTo[a, k], {n, 2, 61}]; a (* Michael De Vlieger, Jul 05 2017 *)
  • PARI
    okd(k, vd) = {for (i=1, #vd, if ((k % vd[i]) == 0, return (0));); return (1);}
    fnext(n, va) = {d = divisors(n); vd = vector(#d-2, i, va[d[i+1]]); k = va[n-1]+1; while (! okd(k, vd), k++); k;}
    lista(nn) = {va = vector(nn); va[1] = 1; for (n=2, nn, va[n] = fnext(n, va);); va;} \\ Michel Marcus, May 17 2014
Showing 1-4 of 4 results.