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.

A071391 Least number m such that sigma(m) + phi(m) = n or 0 if no such number exists.

This page as a plain text file.
%I A071391 #12 Jul 30 2020 00:30:32
%S A071391 0,1,0,2,0,3,0,0,4,5,0,0,0,6,0,0,0,0,8,0,0,10,0,0,0,13,0,0,0,14,0,12,
%T A071391 0,17,0,0,0,19,16,0,0,0,0,21,18,22,0,0,0,20,25,0,0,26,0,0,0,27,0,0,0,
%U A071391 31,0,0,0,0,0,24,0,34,0,35,0,37,0,0,0,38,32,30,0,41,0,0,0,43,0,0,0,0,0,0
%N A071391 Least number m such that sigma(m) + phi(m) = n or 0 if no such number exists.
%H A071391 David A. Corneth, <a href="/A071391/b071391.txt">Table of n, a(n) for n = 1..10000</a>
%F A071391 a(n) = Min{x; A000203(x)+A000010(x)=n} or a(n) = 0 if no solution exists.
%e A071391 n=256: a(256) = 110, sigma(110) + phi(110) = 216 + 40 = 256 = n and no positive integer k < 110 has sigma(k) + phi(k) = 256.
%t A071391 f[x_] := DivisorSigma[1, x]+EulerPhi[x] t=Table[0, {100}]; Do[c=f[n]; If[c<101&&t[[c]]==0, t[[c]]=n], {n, 1, 1000000}]; t
%o A071391 (PARI) a(n) = for(m=1, n, if(sigma(m)+eulerphi(m)==n, return(m))); 0; \\ _Jinyuan Wang_, Jul 29 2020
%o A071391 (PARI) first(n) = { my(v = vector(n)); for(i = 1, n, c = sigma(i) + eulerphi(i); if(c <= n, if(v[c] == 0, v[c] = i ) ) ); v } \\ _David A. Corneth_, Jul 30 2020
%Y A071391 Cf. A000010, A000203, A065387, A051612, A071390.
%K A071391 nonn,easy
%O A071391 1,4
%A A071391 _Labos Elemer_, May 23 2002