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 A347982 #31 Sep 25 2021 15:00:08 %S A347982 -1,-1,2,-1,3,-1,5,6,4,8,7,-1,11,10,14,-1,13,12,17,18,15,21,19,-1,9, %T A347982 22,26,20,23,24,29,28,27,33,34,-1,31,35,38,30,37,40,41,32,44,39,43,-1, %U A347982 25,45,46,50,47,42,51,54,55,57,53,-1,59,58,52,-1,62,56,61,63,65,66,67 %N A347982 a(n) is the greatest k, 0 < k < n, such that tau(k) = tau(n), or -1 if no such k exists, where tau is A000005. %C A347982 a(n) = -1 if and only if n is a term in A005179. %H A347982 Amiram Eldar, <a href="/A347982/b347982.txt">Table of n, a(n) for n = 1..10000</a> %e A347982 a(1) = -1 because there is no positive number less than 1 having 1 divisor. %e A347982 a(2) = -1 because 2 is the first prime. %e A347982 a(3) = 2 because 2 is the greatest prime less than 3 and all primes have 2 divisors. %t A347982 a[1] = -1; a[n_] := Module[{k = n - 1, d = DivisorSigma[0, n]}, While[k > 0 && DivisorSigma[0, k] != d, k--]; If[k == 0, -1, k]]; Array[a, 100] (* _Amiram Eldar_, Sep 23 2021 *) %o A347982 (PARI) a(n) = my(nd=numdiv(n)); forstep(k=n-1, 1, -1, if (numdiv(k)==nd, return(k))); return(-1); \\ _Michel Marcus_, Sep 22 2021 %Y A347982 Cf. A000005, A005179, A079427, A079427, A140635. %K A347982 sign %O A347982 1,3 %A A347982 _David James Sycamore_, Sep 22 2021