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.

A340870 a(n) is the smallest prime p such that p - 1 has 2*n divisors.

This page as a plain text file.
%I A340870 #18 Sep 08 2022 08:46:26
%S A340870 3,7,13,31,113,61,193,211,181,241,13313,421,12289,2113,1009,1321,
%T A340870 2424833,1801,786433,2161,4801,15361,155189249,2521,6481,61441,6301,
%U A340870 8641,3489660929,12241,3221225473,7561,64513,1376257,58321,12601,206158430209,8650753,184321
%N A340870 a(n) is the smallest prime p such that p - 1 has 2*n divisors.
%C A340870 First differs from A080372(n) + 1 for n = 17, where a(17) = 2424833, whereas A080372(17) + 1 = 2162689. - _Hugo Pfoertner_, Jan 26 2021
%F A340870 tau(a(n) - 1) = 2*n.
%e A340870 a(4) = 31 because 31 is the smallest prime p such that p - 1 has 2*4 divisors; tau(30) = 8.
%t A340870 a={}; For[n=1,n<=40,n++,i=1;While[DivisorSigma[0,Prime[i]-1]!=2n,i++];AppendTo[a,Prime[i]]]; a (* _Stefano Spezia_, Jan 25 2021 *)
%o A340870 (Magma) Ax:=func<n|exists(r){m:m in[2..10^7] | IsPrime(m) and #Divisors(m - 1) eq n*#Divisors(m)}select r else 0>; [Ax(n): n in[1..20]]
%o A340870 (PARI) a(n) = my(p=2); while(numdiv(p-1) != 2*n, p=nextprime(p+1)); p; \\ _Michel Marcus_, Jan 25 2021
%Y A340870 Cf. A000005 (tau), A080372, A008328.
%Y A340870 Cf. A066814 (p-1 has n divisors), A340799 (p+1 has 2*n divisors).
%K A340870 nonn
%O A340870 1,1
%A A340870 _Jaroslav Krizek_, Jan 24 2021