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.
%I A256017 #32 Mar 05 2020 16:14:45 %S A256017 2,4,9,8,25,18,49,16,27,50,121,156,169,98,75,32,289,54,361,100,147, %T A256017 242,529,696,125,338,81,196,841,930,961,64,363,578,245,1332,1369,722, %U A256017 507,1640,1681,294,1849,484,2115,1058,2209,2544,343,250,867,676,2809,162 %N A256017 Least integer k > n such that all divisors of n are exactly the first divisors of k in increasing order. %C A256017 Gcd(n,k) = n and lcm(n,k) = k; a(n)/n is a prime number. %C A256017 a(n) is alternatively even and odd for n >= 2. A001248 (squares of primes) is a subsequence. %H A256017 Michel Lagneau and Giovanni Resta, <a href="/A256017/b256017.txt">Table of n, a(n) for n = 1..10000</a> (first 600 terms from Michel Lagneau) %F A256017 For p prime, a(p) = p^2. - _Michel Marcus_, Jun 02 2015 %e A256017 a(6)=18 because the divisors of 6 = {1,2,3,6} are the first divisors of 18 = {1,2,3,6,9,18}. %p A256017 with(numtheory):nn:=100: %p A256017 for n from 1 to nn do: %p A256017 lst0:={}:x:=divisors(n):n0:=nops(x):ii:=0: %p A256017 for k from 1 to 10^8 while (ii=0) do: %p A256017 y:=divisors(k):n1:=nops(y):lst1:={}: %p A256017 if n<>k and n1>=n0 then %p A256017 for i from 1 to n0 do %p A256017 lst0:=lst0 union {x[i]}: %p A256017 od: %p A256017 for j from 1 to n0 do %p A256017 lst1:=lst1 union {y[j]}: %p A256017 od: %p A256017 if lst0=lst1 %p A256017 then %p A256017 printf(`%d, `,k):ii:=1: %p A256017 else fi:fi: %p A256017 od: %p A256017 od: %t A256017 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 *) %t A256017 adn[n_]:=Module[{d=Divisors[n],k=n+1,len},len=Length[d];While[Length[ Divisors[ k]]<len||Take[Divisors[k],len]!=d,k++];k]; Array[adn,60] (* _Harvey P. Dale_, Mar 05 2020 *) %o A256017 (PARI) okd(k, d) = {my(dk = divisors(k)); (#dk >= #d) && (d == vector(#d, i, dk[i]));} %o A256017 a(n) = {my(k = n+1); my(d = divisors(n)); while (! okd(k, d), k++); k;} \\ _Michel Marcus_, Jun 02 2015 %Y A256017 Cf. A001248. %K A256017 nonn %O A256017 1,1 %A A256017 _Michel Lagneau_, Jun 01 2015