Displaying 1-10 of 17 results found.
a(n) is the number of occurrences of n in A133388.
+20
2
2, 3, 4, 4, 5, 7, 6, 8, 8, 9, 9, 10, 10, 12, 13, 12, 12, 15, 14, 17, 16, 16, 17, 18, 19, 18, 19, 20, 18, 24, 20, 22, 25, 22, 27, 26, 23, 25, 25, 29, 26, 30, 27, 31, 32, 32, 24, 33, 33, 34, 32, 32, 35, 37, 36, 37, 38, 32, 35, 44, 36, 41, 41, 40, 42, 45, 39, 43, 42
PROG
(Python)
from sympy.solvers.diophantine.diophantine import diop_DN
def A356208(n): return sum(1 for m in range(1, (n**2<<1)+1) if n==max((a for a, b in diop_DN(-1, m)), default=0)) # Chai Wah Wu, Sep 08 2022
a(n) is the position of the latest occurrence of n in A133388.
+20
2
2, 8, 18, 32, 41, 72, 98, 128, 162, 181, 242, 288, 313, 392, 421, 512, 514, 648, 722, 761, 882, 968, 1058, 1152, 1201, 1301, 1458, 1568, 1466, 1741, 1922, 2048, 2178, 2056, 2381, 2592, 2594, 2888, 2817, 3121, 3202, 3528, 3698, 3872, 3789, 4232, 4418, 4608, 4802, 4804, 5101
PROG
(Python)
from sympy.solvers.diophantine.diophantine import diop_DN
for m in range(n**2<<1, 0, -1):
if n==max((a for a, b in diop_DN(-1, m)), default=0):
Number of partitions of n into 2 squares.
+10
66
1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0
COMMENTS
Number of ways of writing n as a sum of 2 (possibly zero) squares when order does not matter.
Number of similar sublattices of square lattice with index n.
REFERENCES
J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 339
LINKS
R. T. Bumby, Sums of four squares, in Number theory (New York, 1991-1995), 1-8, Springer, New York, 1996.
J. H. Conway, E. M. Rains and N. J. A. Sloane, On the existence of similar sublattices, Canad. J. Math. 51 (1999), 1300-1306 ( Abstract, pdf, ps).
FORMULA
a(n) = card { { a,b } c N | a^2+b^2 = n }. - M. F. Hasler, Nov 23 2007
Let f(n)= the number of divisors of n that are congruent to 1 modulo 4 minus the number of its divisors that are congruent to 3 modulo 4, and define delta(n) to be 1 if n is a perfect square and 0 otherwise. Then a(n)=1/2 (f(n)+delta(n)+delta(1/2 n)). - Ant King, Oct 05 2010
EXAMPLE
25 = 3^2+4^2 = 5^2, so a(25) = 2.
MAPLE
A000161 := proc(n) local i, j, ans; ans := 0; for i from 0 to n do for j from i to n do if i^2+j^2=n then ans := ans+1 fi od od; RETURN(ans); end; [ seq( A000161(i), i=0..50) ];
MATHEMATICA
Length[PowersRepresentations[ #, 2, 2]] &/@Range[0, 150] (* Ant King, Oct 05 2010 *)
PROG
(PARI) a(n)=sum(i=0, n, sum(j=0, i, if(i^2+j^2-n, 0, 1))) \\ for illustrative purpose
(Haskell)
a000161 n =
sum $ map (a010052 . (n -)) $ takeWhile (<= n `div` 2) a000290_list
a000161_list = map a000161 [0..]
(Python)
from math import prod
from sympy import factorint
f = factorint(n)
return int(not any(e&1 for e in f.values())) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f.items()))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1) if n else 1 # Chai Wah Wu, Sep 08 2022
Least index m>0 such that A136117(n)- A000326(m) is again a pentagonal number.
+10
11
5, 4, 7, 12, 19, 17, 25, 20, 10, 28, 45, 42, 39, 17, 37, 21, 36, 35, 13, 33, 65, 28, 67, 32, 52, 40, 74, 31, 70, 85, 35, 16, 60, 70, 77, 68, 42, 30, 105, 76, 59, 26, 74, 49, 115, 19, 125, 115, 102, 110, 92, 56, 103, 29, 145, 100, 114, 77, 92, 47, 63, 108, 152, 95, 22, 116
EXAMPLE
a(1)=5 is the least integer m>0 such that A136117(1)-P(m) is a pentagonal number, namely P(7)-P(5)=70-35=35=P(5).
a(2)=4 is the least integer m>0 such that A136117(2)-P(m) is a pentagonal number, namely P(8)-P(4)=92-22=70=P(7).
PROG
(PARI) A136118vect(n, i=-1)=vector(n, k, until(0, for(j=2, #n=sum2sqr((i+=6)^2+1), n[j]%6==[5, 5]||next; n=n[j]; break(2))); n[1]\6+1) /* This uses sum2sqr(), cf. A133388. Below some simpler but much slower code. */
my(P= A000326(n)=n*(3*n-1)/2, isPent(t)=P(sqrtint(t*2\3)+1)==t); for(i=1, 299, for(j=1, (i+1)\sqrt(2), isPent(P(i)-P(j))&print1(j", ")||next(2)))
Numbers of the form a^4 + b^6, with integers a, b > 0.
+10
9
2, 17, 65, 80, 82, 145, 257, 320, 626, 689, 730, 745, 810, 985, 1297, 1354, 1360, 2025, 2402, 2465, 3130, 4097, 4112, 4160, 4177, 4352, 4721, 4825, 5392, 6497, 6562, 6625, 7290, 8192, 10001, 10064, 10657, 10729, 14096, 14642, 14705, 15370, 15626, 15641, 15706, 15881
COMMENTS
Although it is easy to produce many terms of this sequence, it is nontrivial to check whether a very large number is of this form. Maybe the most efficient way is to consider decompositions of n into sums of two positive squares (see sum2sqr in A133388), and check if one of the terms is a third power and the other a fourth power.
PROG
(PARI) is(n, k=4, m=6)=for(b=1, sqrtnint(n-1, m), ispower(n-b^m, k)&&return(b)) \\ Returns b > 0 if n is in the sequence, else 0.
is(n, L=sum2sqr(n))={for(i=1, #L, L[i][1]&&for(j=1, 2, ispower(L[i][j], 3)&&issquare(L[i][3-j])&&return(L[i][j])))} \\ See A133388 for sum2sqr(). Much faster than the above for n >> 10^30.
A303374(L=10^5, k=4, m=6, S=[])={for(a=1, sqrtnint(L-1, m), for(b=1, sqrtnint(L-a^m, k), S=setunion(S, [a^m+b^k]))); S}
Pentagonal numbers ( A000326) which are the sum of 2 other positive pentagonal numbers.
+10
6
70, 92, 852, 925, 1247, 1426, 1926, 2625, 3577, 5192, 6305, 6501, 7107, 7740, 7957, 8177, 8626, 9560, 10292, 12927, 13207, 14652, 15555, 16172, 18095, 20475, 20827, 21901, 22265, 22632, 23002, 23751, 24130, 28497, 29330, 31032, 33227, 33675
COMMENTS
It is conjectured that every integer and hence every pentagonal number, greater than 33066, hence greater than A000326(149) = 33227, can be represented as the sum of three pentagonal numbers. - Jonathan Vos Post, Dec 18 2007
EXAMPLE
a(1)=70=P(7) is the least pentagonal number which can be written as sum of two other pentagonal numbers, P(7)=P(5)+P(5).
PROG
(PARI) P(n)=n*(3*n-1)>>1 /* a.k.a. A000326 */
isPent(t)=P(sqrtint(t<<1\3)+1)==t
for(i=1, 299, for(j=1, (i+1)\sqrt(2), isPent(P(i)-P(j)) && print1(P(i)", ") || next(2)))
/* The following is much faster, at the cost of implementing sum2sqr(), cf. A133388*/
A136117next(i)=i=sqrtint(i\3*2)*6+5; until(0, for(j=2, #t=sum2sqr((i+=6)^2+1), t[j]%6==[5, 5] && break(2))); i^2\24
A136117vect(n, i)=vector(n, j, i=A136117next(i)) /* 2nd arg =0 by default but allows one to start elsewhere */
Numbers n such that n^3 is the sum of two distinct perfect powers > 1 (x^k + y^m; x, y, k, m >= 2).
+10
5
5, 7, 8, 10, 12, 13, 14, 17, 20, 25, 26, 28, 29, 32, 33, 34, 37, 40, 41, 45, 48, 50, 52, 53, 56, 57, 58, 61, 63, 65, 68, 71, 72, 73, 74, 78, 80, 82, 85, 89, 90, 97, 98, 100, 101, 104, 105, 106, 109, 112, 113, 114, 116, 117, 122, 125, 126, 128
COMMENTS
Motivated by the search of solutions to a^n + b^(2n+2)/4 = (perfect square), which arises when searching solutions to x^n + y^(n+1) = z^(n+2) of the form x = a*z, y = b*z. It turns out that many solutions are of the form a^n = d (b^(n+1) + d), where d is a perfect power.
EXAMPLE
5^3 = 125 = 4^2 + 11^2; 7^3 = 10^2 + 3^5; 8^3 = 13^2 + 7^3, ...
MAPLE
N:= 200: # to get terms <= N
N3:= N^3:
P:= {seq(seq(x^k, k=3..floor(log[x](N3))), x=2..N)}:
filter:= proc(n) local n3, Pp, x, y;
n3:= n^3;
if remove(t -> subs(t, x)<=1 or subs(t, y)<=1 or subs(t, x-y)=0, [isolve(x^2+y^2=n3)]) <> [] then return true fi;
Pp:= map(t ->n3-t, P minus {n3, n3/2});
(Pp intersect P <> {}) or (select(issqr, Pp) <> {})
end proc:
MATHEMATICA
M = 200;
M3 = M^3;
P = Union@ Flatten@ Table[Table[x^k, {k, 3, Floor[Log[x, M3]]}], {x, 2, M}];
filterQ[n_] := Module[{n3, Pp, x, y}, n3 = n^3; If[Solve[x > 1 && y > 1 && x != y && x^2 + y^2 == n3, {x, y}, Integers] != {}, Return[True]]; Pp = n3 - (P ~Complement~ {n3, n3/2}); (Pp ~Intersection~ P) != {} || Select[ Pp, IntegerQ[Sqrt[#]]&] != {}];
PROG
(PARI) L=200^3; P=List(); for(x=2, sqrtnint(L, 3), for(k=3, logint(L, x), listput(P, x^k))); #P=Set(P) \\ This P = A076467 \ {1} = A111231 \ {0} up to limit L.
is(n, e=3)={for(i=1, #s=sum2sqr(n=n^e), vecmin(s[i])>1 && s[i][1]!=s[i][2] && return(1)); for(i=1, #P, n>P[i]||return; ispower(n-P[i])&& P[i]*2 != n && return(1))} \\ The above P must be computed up to L >= n^3. For sum2sqr() see A133388.
Numbers n such that n^4 is the sum of two distinct perfect powers > 1 (x^k + y^m; x, y, k, m >= 2).
+10
5
3, 5, 6, 9, 10, 12, 13, 14, 15, 17, 20, 24, 25, 26, 28, 29, 30, 34, 35, 36, 37, 39, 40, 41, 42, 45, 48, 50, 51, 52, 53, 55, 57, 58, 60, 61, 63, 65, 68, 70, 71, 72, 73, 74, 75, 78, 80, 82, 85, 87, 89, 90, 91, 95, 96, 97, 98, 100, 101, 102, 104, 105, 106, 109, 110, 111, 113
COMMENTS
Motivated by the search of solutions to a^n + b^(2n+2)/4 = (perfect square), which arises when searching solutions to x^n + y^(n+1) = z^(n+2) of the form x = a*z, y = b*z. It turns out that many solutions are of the form a^n = d (b^(n+1) + d), where d is a perfect power.
EXAMPLE
3^4 = 2^5 + 7^2; 5^4 = 7^2 + 24^2, ...
MAPLE
N:= 200: # to get terms <= N
N4:= N^4:
P:= {seq(seq(x^k, k=3..floor(log[x](N4))), x=2..floor(N4^(1/3)))}:
filter:= proc(n) local n4, Pp;
n4:= n^4;
if remove(t -> subs(t, x)<=1 or subs(t, y)<=1 or subs(t, x-y)=0, [isolve(x^2+y^2=n4)]) <> [] then return true fi;
Pp:= map(t ->n4-t, P minus {n4, n4/2});
(Pp intersect P <> {}) or (select(issqr, Pp) <> {})
end proc:
PROG
(PARI) L=200^4; P=List(); for(x=2, sqrtnint(L, 3), for(k=3, logint(L, x), listput(P, x^k))); #P=Set(P) \\ This P = A076467 \ {1} = A111231 \ {0} up to limit L.
is_ A304434(n)={for(i=1, #s=sum2sqr(n=n^4), vecmin(s[i])>1 && s[i][1]!=s[i][2] && return(1)); for(i=1, #P, n>P[i]||return; ispower(n-P[i])&& P[i]*2 != n && return(1))} \\ The above P must be computed up to L >= n^4. For sum2sqr() see A133388.
Indices of pentagonal numbers ( A000326) which are the sum of 2 other positive pentagonal numbers.
+10
4
7, 8, 24, 25, 29, 31, 36, 42, 49, 59, 65, 66, 69, 72, 73, 74, 76, 80, 83, 93, 94, 99, 102, 104, 110, 117, 118, 121, 122, 123, 124, 126, 127, 138, 140, 144, 149, 150, 152, 161, 163, 168, 169, 174, 175, 178, 181, 185, 188, 190, 195, 199, 203, 209, 210, 212, 213
EXAMPLE
a(1)=7 since P(7)=70 is the least pentagonal number which can be written as sum of two other pentagonal numbers, P(7)=P(5)+P(5).
PROG
(PARI) P(n)=n*(3*n-1)>>1 /* a.k.a. A000326 */
isPent(t)=P(sqrtint(t<<1\3)+1)==t
for(i=1, 999, for(j=1, (i+1)\sqrt(2), isPent(P(i)-P(j))&print1(i", ") || next(2)))
/* The following are much faster, at the cost of implementing sum2sqr(), cf. A133388. */
A136116next(i)=i=6*i-1; until(0, for(j=2, #t=sum2sqr((i+=6)^2+1), t[j]%6==[5, 5] && break(2))); i\6+1
A136116vect(n, i=0)=vector(n, j, i=A136116next(i))
Numbers which are the sum of two squared primes in exactly two ways (ignoring order).
+10
3
338, 410, 578, 650, 890, 1010, 1130, 1490, 1730, 1802, 1898, 1970, 2330, 2378, 2738, 3050, 3170, 3530, 3650, 3842, 3890, 4010, 4658, 4850, 5018, 5090, 5162, 5402, 5450, 5570, 5618, 5690, 5858, 6170, 6410, 6530, 6698, 7010, 7178, 7202, 7250, 7850, 7970, 8090
REFERENCES
Stan Wagon, Mathematica in Action, Springer, 2000 (2nd ed.), Ch. 17.5, pp. 375-378.
EXAMPLE
338 = 7^2 + 17^2 = 13^2 + 13^2;
410 = 7^2 + 19^2 = 11^2 + 17^2.
MAPLE
Prime2PairsSum := p -> select(x ->`if`(andmap(isprime, x), true, false), numtheory:-sum2sqr(p)):
for n from 2 to 10^6 do
if nops(Prime2PairsSum(n)) = 2 then print(n, Prime2PairsSum(n)) fi;
od;
MATHEMATICA
Select[Range@10000, Length[Select[ PowersRepresentations[#, 2, 2], And @@ PrimeQ[#] &]] == 2 &] (* Giovanni Resta, Jun 11 2013 *)
PROG
(PARI) select( is_ A226539(n)={#[0|t<-sum2sqr(n), isprime(t[1])&&isprime(t[2])]==2}, [1..10^4]) \\ For more efficiency, apply selection to A045636. See A133388 for sum2sqr(). - M. F. Hasler, Dec 12 2019
CROSSREFS
Cf. A045636 (sum of two squared primes: a superset).
Cf. A214511 (least number having n representations).
Cf. A226562 (restricted to sums decomposed in exactly three ways).
Search completed in 0.010 seconds
|