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.
%I A306440 #41 Mar 29 2019 21:06:32 %S A306440 0,1,1,1,1,1,2,0,1,1,1,1,2,0,1,1,1,0,2,0,2,1,1,1,1,0,1,0,1,1,3,0,1,1, %T A306440 0,1,4,0,0,1,1,1,1,0,2,0,1,0,2,0,1,1,1,1,2,0,2,0,1,0,3,0,0,1,0,1,2,0, %U A306440 1,1,1,0,2,0,1,1,0,0,2,0,2,1,1,1,2,0,1,0,1,1,3,0,1,0,0,1 %N A306440 Number of different ways of expressing 2*n as (p - 1)*(q - 1), where p < q are primes. %C A306440 If 2*n-1 is an odd prime then a(n) > 0. %C A306440 If a(n) > 0 then 2n+1 is in A323550. %C A306440 Given any distinct odd primes p_1, ..., p_m, Dickson's conjecture implies that there are infinitely many m such that m/(p_i-1) + 1 is prime for all i. Thus the sequence should be unbounded. - _Robert Israel_, Mar 29 2019 %H A306440 Robert Israel, <a href="/A306440/b306440.txt">Table of n, a(n) for n = 0..10000</a> %F A306440 a(6k+1) = 0 for k > 0 because 12k+2 can't be written as (p-1)(q-1) except for k = 0 with p = 2, q = 3: If q > 3, then q-1 is congruent to 0 or 4 (mod 6), and no p = 2, p = 3 (=> q-1 = 6k+1) or p > 3 is possible. - _M. F. Hasler_, Feb 25 2019 %e A306440 a(2) = 1 because 2*2 = 4 can only be expressed as (p - 1)*(q - 1) with primes p = 2 and q = 5. %e A306440 a(6) = 2 because for 2*6 = 12, there are only two possible ordered pairs of distinct primes (p,q), (2,13) and (3,7), such that 12 = (p - 1)*(q - 1). %p A306440 f:= proc(n) local t; %p A306440 nops(select(t -> t^2<2*n and isprime(t+1) and isprime(2*n/t+1), numtheory:-divisors(2*n))) %p A306440 end proc: %p A306440 map(f, [$0..200]); # _Robert Israel_, Mar 18 2019 %t A306440 a[n_]:=Module[{k=0},Do[Do[If[2n==(Prime[i]-1)*(Prime[j]-1),k++],{i,1,j-1}],{j,2,PrimePi[2n]+1}];Return[k]]; %t A306440 Table[a[j],{j,0,128}] %o A306440 (PARI) A306440(n,d,c)={forprime(p=2,sqrtint(-(n>0)+n*=2)+1,n%(p-1)==0 && isprime(n/(p-1)+1) && c++ && d && printf("%d-1=(%d-1)*(%d-1) [%d], ",n+1,p,n/(p-1)+1,c));c} \\ Give 1 as 2nd optional arg (d=debug) to get a list of all decompositions. - _M. F. Hasler_, Feb 25 2019 %o A306440 (PARI) a(n) = if(n==0, return(0)); my(d=divisors(n<<1)); d+=vector(#d, i, 1); sum(i=1, #d\2, isprime(d[i]) && isprime(d[#d-i+1])) \\ for finding lots of terms or a(n) for large n. \\ _David A. Corneth_, Mar 18 2019 %Y A306440 Cf. A323550. %K A306440 nonn %O A306440 0,7 %A A306440 _Andres Cicuttin_, Feb 15 2019