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.

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

Original entry on oeis.org

2, 3, 5, 7, 6, 13, 10, 19, 14, 29, 21, 37, 20, 43, 33, 34, 24, 61, 67, 30, 73, 57, 44, 40, 52, 101, 63, 85, 109, 74, 93, 86, 137, 76, 149, 111, 157, 163, 60, 173, 88, 117, 105, 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
Offset: 1

Views

Author

Robert Israel, Dec 27 2017

Keywords

Comments

a(n) <= prime(n).

Examples

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

Crossrefs

Cf. A066077.

Programs

  • Maple
    N:= 100: # to get a(1)..a(N)
    for i from 1 to N do T(ithprime(i)):= i od:
    count:= 0:
    for n from 1 while count < N do
    v:= numtheory:-sigma(n);
    if T(v)::posint then
      A[T(v)]:= n;
      T(v):= 0;
        count:= count+1;
      fi
    od:
    seq(A[i],i=1..N);
  • 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
    
  • 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