OFFSET
1,2
COMMENTS
This sequence is related to Pythagorean triples regarding the number of hypotenuses which are in a particular number of total Pythagorean triples and a particular number of primitive Pythagorean triples.
Least integer "mod 4 prime signature" values that are the hypotenuse of at least one primitive Pythagorean triple. - Ray Chandler, Aug 26 2004
See A097751 for definition of "mod 4 prime signature"; terms of A097752 with all prime factors of form 4*k+1.
Sequence A006339 (Least hypotenuse of n distinct Pythagorean triangles) is a subset of this sequence. - Ruediger Jehn, Jan 13 2022
LINKS
Ray Chandler, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Pythagorean Triple
FORMULA
Sum_{n>=1} 1/a(n) = Product_{n>=1} 1/(1 - 1/A006278(n)) = 1.2707219403... - Amiram Eldar, Oct 20 2020
EXAMPLE
1=5^0, 5=5^1, 25=5^2, 65=5*13, 125=5^3, 325=5^2*13, 625=5^4, etc.
MATHEMATICA
maxTerm = 10^15; (* this limit gives ~ 500 terms *) maxNumberOfExponents = 9; (* this limit has to be increased until the number of reaped terms no longer changes *) bmax = Ceiling[ Log[ maxTerm]/Log[q]]; q = Reap[For[k = 0 ; cnt = 0, cnt <= maxNumberOfExponents, k++, If[PrimeQ[4*k + 1], Sow[4*k + 1]; cnt++]]][[2, 1]]; Clear[b]; b[maxNumberOfExponents + 1] = 0; iter = Sequence @@ Table[{b[k], b[k + 1], bmax[[k]]}, {k, maxNumberOfExponents, 1, -1}]; Reap[ Do[an = Product[q[[k]]^b[k], {k, 1, maxNumberOfExponents}]; If[an <= maxTerm, Print[an]; Sow[an]], Evaluate[iter]]][[2, 1]] // Flatten // Union (* Jean-François Alcover, Jan 18 2013 *)
PROG
(PARI) list(lim)=
{
my(u=[1], v=List(), w=v, pr, t=1);
forprime(p=5, ,
if(p%4>1, next);
t*=p;
if(t>lim, break);
listput(w, t)
);
for(i=1, #w,
pr=1;
for(e=1, logint(lim\=1, w[i]),
pr*=w[i];
for(j=1, #u,
t=pr*u[j];
if(t>lim, break);
listput(v, t)
)
);
if(w[i]^2<lim, u=Set(concat(Vec(v), u)); v=List());
);
Set(concat(Vec(v), u));
} \\ Charles R Greathouse IV, Dec 11 2016
(Python)
def generate_A054994():
"""generate arbitrarily many elements of the sequence.
TO_DO is a list of pairs (radius, exponents) where
"exponents" is a weakly decreasing sequence, and
radius == prod(prime_4k_plus_1(i)**j for i, j in enumerate(exponents))
An example entry is (5525, (2, 1, 1)) because 5525 = 5**2 * 13 * 17.
"""
TO_DO = {(1, ())}
while True:
radius, exponents = min(TO_DO)
yield radius #, exponents
TO_DO.remove((radius, exponents))
TO_DO.update(successors(radius, exponents))
def successors(radius, exponents):
# try to increase each exponent by 1 if possible
for i, e in enumerate(exponents):
if i==0 or exponents[i-1]>e:
# can add 1 in position i without violating monotonicity
yield (radius*prime_4k_plus_1(i), exponents[:i]+(e+1, )+exponents[i+1:])
if exponents==() or exponents[-1]>0: # add new exponent 1 at the end:
yield (radius*prime_4k_plus_1(len(exponents)), exponents+(1, ))
from sympy import isprime
primes_congruent_1_mod_4 = [5] # will be filled with 5, 13, 17, 29, 37, ...
def prime_4k_plus_1(i): # the i-th prime that is congruent to 1 mod 4
while i>=len(primes_congruent_1_mod_4): # generate primes on demand
n = primes_congruent_1_mod_4[-1]+4
while not isprime(n): n += 4
primes_congruent_1_mod_4.append(n)
return primes_congruent_1_mod_4[i]
for n, radius in enumerate(generate_A054994()):
if n==34:
print(radius)
break # print the first 35 elements
print(radius, end=", ")
# Günter Rote, Sep 12 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Bernard Altschuler (Altschuler_B(AT)bls.gov), May 30 2000
EXTENSIONS
More terms from Henry Bottomley, Mar 14 2001
STATUS
approved