login
a(n) = smallest number k such that sigma(k + n) = sigma(k) + n, or -1 if no such number exists.
7

%I #22 Jun 26 2024 15:58:22

%S 1,2,3,2,3,2,5,74,3,2,3,2,5,4418,3,2,3,2,5,6,3,2,7

%N a(n) = smallest number k such that sigma(k + n) = sigma(k) + n, or -1 if no such number exists.

%C There are solutions to sigma(k)+n=sigma(k+n) whenever n is the difference between two primes (A030173), e.g. k and k+n are primes. There are other values of n that have solutions (see example).

%C a(23) > 4292000000, if it exists. - _Jud McCranie_, Jan 05 2000

%C The sequence begins: 1, 2, 3, 2, 3, 2, 5, 74, 3, 2, 3, 2, 5, 4418, 3, 2, 3, 2, 5, 6, 3, 2, 7, ?, 5, ?, 3, 2, 3, 2, 7, ?, 5, 18, 3, 2, 5, 44, 3, 2, 3, 2, 5, ?, 3, 2, 7, ?, 5, 3315, 3, 2, 7, ?, 5, ?, 3, 2, 3, 2, 7, ?, 5, ?, 3, 2, 5, ?, 3, 2, 3, 2, 7, 18, 5, ?, 3, 2, 5, ?, 3, 2, 7, ?, 5, ?, 3, 2, 13, ?, 7, ?, 5, 32, 3, 2, 5 where the other missing terms (designated by "?") are > 10^9, if they exist. - _Jud McCranie_, Jan 08 2000

%C The "other" values of n are the odd n such that n+2 is not prime. For these n, in order for sigma(k) or sigma(n+k) to be odd, either k or n+k must be a square or twice a square. Examples: for n=7, n+k=9^2; for n=13, k=2*47^2 and for n=19, n+k=5^2. Using this idea, it is easy to show that if a(23) exists it is greater than 10^12. - _T. D. Noe_, Sep 24 2007

%F a(2n) = A020483(n) = A054906(n) - _T. D. Noe_, Sep 24 2007

%e sigma(74+7) = 121 = sigma(74)+7, so a(7) = 74.

%t Table[k=1; While[DivisorSigma[1,k+n] != DivisorSigma[1,k]+n, k++ ]; k, {n,22}] - _T. D. Noe_, Sep 24 2007

%o (PARI) a(n) = {my(k=1); while(sigma(k+n) != sigma(k) + n, k++); k;} \\ _Michel Marcus_, May 23 2018

%Y Cf. A000203, A020483, A030173, A054906.

%K nonn,hard,nice,more

%O 0,2

%A _Robert G. Wilson v_