login
Numbers of the form q1^b1 * q2^b2 * q3^b3 * q4^b4 * q5^b5 * ... where q1=5, q2=13, q3=17, q4=29, q5=37, ... (A002144) and b1 >= b2 >= b3 >= b4 >= b5 >= ....
14

%I #53 Feb 16 2025 08:32:42

%S 1,5,25,65,125,325,625,1105,1625,3125,4225,5525,8125,15625,21125,

%T 27625,32045,40625,71825,78125,105625,138125,160225,203125,274625,

%U 359125,390625,528125,690625,801125,1015625,1185665,1221025,1373125,1795625

%N Numbers of the form q1^b1 * q2^b2 * q3^b3 * q4^b4 * q5^b5 * ... where q1=5, q2=13, q3=17, q4=29, q5=37, ... (A002144) and b1 >= b2 >= b3 >= b4 >= b5 >= ....

%C 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.

%C Least integer "mod 4 prime signature" values that are the hypotenuse of at least one primitive Pythagorean triple. - _Ray Chandler_, Aug 26 2004

%C See A097751 for definition of "mod 4 prime signature"; terms of A097752 with all prime factors of form 4*k+1.

%C Sequence A006339 (Least hypotenuse of n distinct Pythagorean triangles) is a subset of this sequence. - _Ruediger Jehn_, Jan 13 2022

%H Ray Chandler, <a href="/A054994/b054994.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PythagoreanTriple.html">Pythagorean Triple</a>

%F Sum_{n>=1} 1/a(n) = Product_{n>=1} 1/(1 - 1/A006278(n)) = 1.2707219403... - _Amiram Eldar_, Oct 20 2020

%e 1=5^0, 5=5^1, 25=5^2, 65=5*13, 125=5^3, 325=5^2*13, 625=5^4, etc.

%t 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 *)

%o (PARI) list(lim)=

%o {

%o my(u=[1], v=List(), w=v, pr, t=1);

%o forprime(p=5,,

%o if(p%4>1, next);

%o t*=p;

%o if(t>lim, break);

%o listput(w,t)

%o );

%o for(i=1,#w,

%o pr=1;

%o for(e=1,logint(lim\=1,w[i]),

%o pr*=w[i];

%o for(j=1,#u,

%o t=pr*u[j];

%o if(t>lim, break);

%o listput(v,t)

%o )

%o );

%o if(w[i]^2<lim, u=Set(concat(Vec(v),u)); v=List());

%o );

%o Set(concat(Vec(v),u));

%o } \\ _Charles R Greathouse IV_, Dec 11 2016

%o (Python)

%o def generate_A054994():

%o """generate arbitrarily many elements of the sequence.

%o TO_DO is a list of pairs (radius, exponents) where

%o "exponents" is a weakly decreasing sequence, and

%o radius == prod(prime_4k_plus_1(i)**j for i,j in enumerate(exponents))

%o An example entry is (5525, (2, 1, 1)) because 5525 = 5**2 * 13 * 17.

%o """

%o TO_DO = {(1,())}

%o while True:

%o radius, exponents = min(TO_DO)

%o yield radius #, exponents

%o TO_DO.remove((radius, exponents))

%o TO_DO.update(successors(radius,exponents))

%o def successors(radius,exponents):

%o # try to increase each exponent by 1 if possible

%o for i,e in enumerate(exponents):

%o if i==0 or exponents[i-1]>e:

%o # can add 1 in position i without violating monotonicity

%o yield (radius*prime_4k_plus_1(i), exponents[:i]+(e+1,)+exponents[i+1:])

%o if exponents==() or exponents[-1]>0: # add new exponent 1 at the end:

%o yield (radius*prime_4k_plus_1(len(exponents)), exponents+(1,))

%o from sympy import isprime

%o primes_congruent_1_mod_4 = [5] # will be filled with 5,13,17,29,37,...

%o def prime_4k_plus_1(i): # the i-th prime that is congruent to 1 mod 4

%o while i>=len(primes_congruent_1_mod_4): # generate primes on demand

%o n = primes_congruent_1_mod_4[-1]+4

%o while not isprime(n): n += 4

%o primes_congruent_1_mod_4.append(n)

%o return primes_congruent_1_mod_4[i]

%o for n,radius in enumerate(generate_A054994()):

%o if n==34:

%o print(radius)

%o break # print the first 35 elements

%o print(radius, end=", ")

%o # _Günter Rote_, Sep 12 2023

%Y Subsequence of A097752.

%Y Cf. A002144, A006278, A006339, A071383, A097751, A097752, A097753, A097754, A097755, A097756.

%K easy,nonn,changed

%O 1,2

%A Bernard Altschuler (Altschuler_B(AT)bls.gov), May 30 2000

%E More terms from _Henry Bottomley_, Mar 14 2001