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.

A360778 Smallest number k such that n + k is a refactorable number.

This page as a plain text file.
%I A360778 #12 Mar 05 2023 17:08:35
%S A360778 1,0,0,5,4,3,2,1,0,0,2,1,0,5,4,3,2,1,0,5,4,3,2,1,0,11,10,9,8,7,6,5,4,
%T A360778 3,2,1,0,3,2,1,0,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,3,2,1,0,11,10,
%U A360778 9,8,7,6,5,4,3,2,1,0,7,6,5,4,3,2,1,0,3,2,1,0,3,2,1,0
%N A360778 Smallest number k such that n + k is a refactorable number.
%C A360778 a(n) = 0 for n from A033950.
%e A360778 a(0) = 1 because 0 + 1 = 1, the next higher refactorable number.
%e A360778 a(1) = 0 because 1 is refactorable number.
%e A360778 a(2) = 0 because 2 is refactorable number.
%e A360778 a(3) = 5 because 3 + 5 = 8, the next higher refactorable number.
%e A360778 and so on.
%t A360778 a[n_] := Module[{m = n}, While[! Divisible[m, DivisorSigma[0, m]], m++]; m - n]; a[0] = 1; Array[a, 100, 0] (* _Amiram Eldar_, Feb 20 2023 *)
%o A360778 (PARI) a(n) = if (n==0, 1, my(k=0); while ((n+k) % numdiv(n+k), k++); k); \\ _Michel Marcus_, Feb 20 2023
%Y A360778 Cf. A033950.
%K A360778 nonn
%O A360778 0,4
%A A360778 _Ctibor O. Zizka_, Feb 20 2023