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.

A256017 Least integer k > n such that all divisors of n are exactly the first divisors of k in increasing order.

Original entry on oeis.org

2, 4, 9, 8, 25, 18, 49, 16, 27, 50, 121, 156, 169, 98, 75, 32, 289, 54, 361, 100, 147, 242, 529, 696, 125, 338, 81, 196, 841, 930, 961, 64, 363, 578, 245, 1332, 1369, 722, 507, 1640, 1681, 294, 1849, 484, 2115, 1058, 2209, 2544, 343, 250, 867, 676, 2809, 162
Offset: 1

Views

Author

Michel Lagneau, Jun 01 2015

Keywords

Comments

Gcd(n,k) = n and lcm(n,k) = k; a(n)/n is a prime number.
a(n) is alternatively even and odd for n >= 2. A001248 (squares of primes) is a subsequence.

Examples

			a(6)=18 because the divisors of 6 = {1,2,3,6} are the first divisors of 18 = {1,2,3,6,9,18}.
		

Crossrefs

Cf. A001248.

Programs

  • Maple
    with(numtheory):nn:=100:
    for n from 1 to nn do:
    lst0:={}:x:=divisors(n):n0:=nops(x):ii:=0:
      for k from 1 to 10^8 while (ii=0) do:
       y:=divisors(k):n1:=nops(y):lst1:={}:
        if n<>k and n1>=n0 then
        for i from 1 to n0 do
        lst0:=lst0 union {x[i]}:
        od:
         for j from 1 to n0 do
         lst1:=lst1 union {y[j]}:
         od:
         if lst0=lst1
         then
         printf(`%d, `,k):ii:=1:
         else fi:fi:
         od:
        od:
  • Mathematica
    a[n_]:=If[n==1, 2, Block[{k= 2*n,f,d,m}, f = FactorInteger @n; If[1 == Length@f, f[[1,1]]^(1 + f[[1,2]]), d = Divisors@ n; m = Length@ d; While[ Take[ Divisors@ k, m] != d, k += n]; k]]]; Array[a, 1000] (* Giovanni Resta, Jun 01 2015 *)
    adn[n_]:=Module[{d=Divisors[n],k=n+1,len},len=Length[d];While[Length[ Divisors[ k]]Harvey P. Dale, Mar 05 2020 *)
  • PARI
    okd(k, d) = {my(dk = divisors(k)); (#dk >= #d) && (d == vector(#d, i, dk[i]));}
    a(n) = {my(k = n+1); my(d = divisors(n)); while (! okd(k, d), k++); k;} \\ Michel Marcus, Jun 02 2015

Formula

For p prime, a(p) = p^2. - Michel Marcus, Jun 02 2015