A154495 a(n+1)-+a(n)=prime, a(n+1)*a(n)=Average of twin prime pairs, a(1)=2,a(2)=9.
2, 9, 20, 33, 40, 141, 298, 435, 536, 687, 884, 1197, 1244, 1665, 1792, 2235, 2486, 2595, 2602, 3765, 3784, 4095, 4148, 4605, 4868, 5061, 5330, 6159, 6220, 6579, 6662, 7119, 7162, 7341, 8288, 10791, 11438, 11859, 12142, 12825, 13274, 14553, 14734
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
A:= 2,9: b:= 9: for i from 3 to 100 do p:= 2: do p:= nextprime(p); k:= b + p; if isprime(b*k+1) and isprime(b*k-1) and isprime(k+b) then A:= A,k; b:= k; break fi od od: A; # Robert Israel, Jan 01 2024
-
Mathematica
a=2;b=9;lst={a,b};Do[If[PrimeQ[n-b]&&PrimeQ[n+b]&&PrimeQ[n*b-1]&&PrimeQ[n*b+1],AppendTo[lst,n];a=b;b=n],{n,b+1,9!}];lst
Extensions
NAME adapted to offset. - R. J. Mathar, Jun 19 2021
Comments