OFFSET
1,1
COMMENTS
LINKS
A. Tripathi, On Pythagorean triples containing a fixed integer, Fib. Q., 46/47 (2008/2009), 331-340. See Theorem 8.
FORMULA
p or 2p with p prime and p = 3 mod 4, with 4 added to the sequence, in ascending order.
MATHEMATICA
t={}; Do[If[(PrimeQ[n] && Mod[n, 4] == 3) || (PrimeQ[n/2] && Mod [n/2, 4] == 3), t = Join[t, {n}]], {n, 445}]; t = Insert[t, 4, 2]
(* Positions of the ones in A046081; based on program by Jean-François Alcover *)
a[1] = 0; a[n_] := Module[{f}, f = Select[FactorInteger[n], Mod[#[[1]], 4] == 1 &][[All, 2]]; (DivisorSigma[0, If[OddQ[n], n, n/2]^2] - 1)/2 + (Times @@ (2*f + 1) - 1)/2]; arr = Array[a, 445]; fl = Flatten[Position[arr, 1]]
PROG
(Python)
from itertools import count, islice
from sympy import isprime
def A374846_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:n==4 or (isprime(n) and n&3==3) or (isprime(n>>1) and n&7==6), count(max(startvalue, 1)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Manfred Boergens, Jul 22 2024
STATUS
approved