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.

A119752 a(1)=2; a(n)=first even number greater than a(n-1) such that a(i)+a(n)+1 is prime for all i=1,2,...,n.

This page as a plain text file.
%I A119752 #18 Mar 06 2023 12:57:02
%S A119752 2,8,14,44,224,638,1274,4004,675404,2203958,3075158,6195234164,
%T A119752 77989711184,4566262987328
%N A119752 a(1)=2; a(n)=first even number greater than a(n-1) such that a(i)+a(n)+1 is prime for all i=1,2,...,n.
%p A119752 R:= [2]: count:= 1:
%p A119752 for k from 4 by 2 while count < 11 do
%p A119752   if isprime(2*k+1) and andmap(isprime, [seq(R[i]+k+1,i=1..count)]) then
%p A119752      R:= [op(R),k]; count:= count+1
%p A119752   fi
%p A119752 od:
%p A119752 R; # _Robert Israel_, Mar 06 2023
%t A119752 Table[If[n == 1, a[1] = 2, j = a[n - 1] + 2; While[a[n] = j; !
%t A119752     AllTrue[Table[a[i] + a[n] + 1, {i, 1, n}], PrimeQ], j += 2]; j]
%t A119752 , {n, 1, 9}] (* _Robert Price_, Apr 03 2019 *)
%o A119752 (PARI) isok(va, k, n) = if (isprime(2*k+1), for (i=1, n-1, if (! isprime(va[i]+k+1), return(0))); return(1));
%o A119752 lista(nn) = my(va=vector(nn)); va[1]=2; for (n=2, nn, my(k=va[n-1]+2); while (!isok(va, k, n), k+=2); va[n] = k); va; \\ _Michel Marcus_, Mar 06 2023
%Y A119752 Cf. A119751.
%K A119752 nonn,more,hard
%O A119752 1,1
%A A119752 _Walter Kehowski_, Jun 17 2006
%E A119752 a(13)-a(14) from _Donovan Johnson_, Mar 23 2008