login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A296375 Least x such that sigma(x) = prime(n)+1, where sigma = A000203. 2

%I #31 Dec 28 2017 00:57:17

%S 2,3,5,7,6,13,10,19,14,29,21,37,20,43,33,34,24,61,67,30,73,57,44,40,

%T 52,101,63,85,109,74,93,86,137,76,149,111,157,163,60,173,88,117,105,

%U 193,197,199,211,84,147,229,90,114,241,96,257,215,136,201,277,281,283,164,172,126,313,317,331,337

%N Least x such that sigma(x) = prime(n)+1, where sigma = A000203.

%C a(n) <= prime(n).

%H Charles R Greathouse IV, <a href="/A296375/b296375.txt">Table of n, a(n) for n = 1..10000</a>

%e For n=5, prime(5)+1 = 12; sigma(x) = 12 for x=6 and x=11, so a(5) = 6.

%p N:= 100: # to get a(1)..a(N)

%p for i from 1 to N do T(ithprime(i)):= i od:

%p count:= 0:

%p for n from 1 while count < N do

%p v:= numtheory:-sigma(n);

%p if T(v)::posint then

%p A[T(v)]:= n;

%p T(v):= 0;

%p count:= count+1;

%p fi

%p od:

%p seq(A[i],i=1..N);

%o (PARI) first(n) = my(res = vector(n), p = 2); for(k=1, n, for(x=2, p, if(sigma(x) == p+1, res[k] = x; break())); p = nextprime(p+1)); res \\ _Iain Fox_, Dec 28 2017

%o (PARI) first(n)=my(v=vector(n),P=primes(n),left=n,t); forfactored(x=2,P[n], t=setsearch(P,sigma(x)-1); if(t && v[t]==0, v[t]=x[1]; if(left--==0, return(v)))) \\ _Charles R Greathouse IV_, Dec 28 2017

%Y Cf. A066077.

%K nonn

%O 1,1

%A _Robert Israel_, Dec 27 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 08:29 EDT 2024. Contains 371905 sequences. (Running on oeis4.)