A378187 With p(n) = A002145(n) = n-th non-Pythagorean prime, a(n) is the least k such p(n) + k is a non-Pythagorean prime and 2 p(n) + k - 3 is a Pythagorean prime; and a(n) = 0 if there is no such k.
4, 12, 12, 12, 24, 12, 24, 12, 12, 36, 12, 24, 48, 24, 60, 12, 48, 72, 12, 36, 192, 12, 60, 24, 12, 48, 12, 12, 108, 48, 60, 24, 72, 72, 168, 36, 24, 12, 84, 48, 24, 48, 108, 24, 24, 36, 12, 12, 12, 24, 60, 48, 60, 156, 48, 60, 84, 12, 24, 60, 84, 12, 84, 36
Offset: 1
Keywords
Examples
3 + 4 = 7, the least non-Pythagorean prime after 3, and 3 + 7 - 3 = 7, a Pythagorean prime, so a(1) = 4.
Programs
-
Mathematica
s = Select[Prime[Range[450]], Mod[#, 4] == 3 &] a[n_] := Select[Range[200], MemberQ[s, s[[n]] + #] && PrimeQ[2 s[[n]] + # - 3] &, 1] Flatten[Table[a[n], {n, 1, 140}]]