cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-18 of 18 results.

A304435 Numbers n such that n^5 is the sum of two distinct perfect powers > 1 (x^k + y^m; x, y, k, m >= 2).

Original entry on oeis.org

3, 5, 6, 8, 10, 13, 17, 19, 20, 24, 25, 26, 28, 29, 34, 36, 37, 40, 41, 45, 50, 52, 53, 54, 58, 61, 62, 65, 68, 73, 74, 75, 80, 81, 82, 85, 88, 89, 90, 96, 97, 98, 100, 101, 104, 106, 109, 113, 116, 117, 122, 125, 130, 136, 137, 145, 146, 148, 149, 150, 153, 157, 160, 164, 168, 169, 170, 173, 176, 178, 180, 181, 185, 192, 193, 194, 197
Offset: 1

Views

Author

M. F. Hasler, May 25 2018

Keywords

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.

Examples

			3^5 = 3^3 + 6^3; 5^5 = 10^2 + 55^2, 6^5 = 2^5 + 88^2, ...
		

Crossrefs

Cf. A304433, A304434, A001597 (perfect powers).

Programs

  • Maple
    LIM:= 200^5: P:={seq(seq(x^k, k=3..floor(log[x](LIM))), x=2..floor(LIM^(1/3)))}:
    is_A304435:= proc(n) local n5, Pp;  n5:= n^5;  if remove(t -> subs(t, x)<=1 or subs(t, y)<=1 or subs(t, x-y)=0, [isolve(x^2+y^2=n^5)]) <> [] then return true fi;  Pp:= map(t ->n5-t, P minus {n5, n5/2});  (Pp intersect P <> {}) or (select(issqr, Pp) <> {})
    end proc: # adapted from code by Robert Israel for A304434
  • Mathematica
    M = 200; LIM = M^5;
    P = Flatten @ Table[Table[x^k, {k, 3, Floor[Log[x, LIM]]}], {x, 2,Floor[ LIM^(1/3)]}];
    filterQ[n_] := Module[{n5 = n^5, Pp, x, y}, If[Solve[x > 1 && y > 1 && x != y && x^2 + y^2 == n5, {x, y}, Integers] != {}, Return[True]]; Pp = n5 - (P ~Complement~ {n5, n5/2}); (Pp ~Intersection~ P) != {} || Select[Pp, IntegerQ[Sqrt[#]]&] != {}];
    Select[Range[2, M], filterQ] (* Jean-François Alcover, Jun 21 2020, after Maple *)
  • PARI
    N=200;L=N^5;P=List(); for(x=2,sqrtnint(L,3),for(k=3,logint(L,x),listput(P,x^k)));P=Set(P);
    is_A304435(n)={for(i=1,#s=sum2sqr(n=n^5),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))} \\ For sum2sqr() see A133388.

A353589 Number of nondecreasing nonnegative integer quadruples (m,p,q,r) such that m^2 + p^2 + q^2 + r^2 = n^2 and m +- p +- q +- r = +- n.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 4, 2, 2, 4, 4, 4, 4, 3, 4, 6, 2, 5, 8, 5, 4, 6, 8, 5, 4, 7, 6, 9, 4, 6, 12, 6, 2, 12, 10, 9, 8, 7, 10, 10, 4, 9, 12, 9, 8, 17, 10, 9, 4, 9, 14, 16, 6, 10, 18, 17, 4, 16, 12, 12, 12, 11, 12, 17, 2, 16, 24, 13, 10, 18, 18, 13, 8, 14, 14, 26, 10, 17, 20, 14, 4, 23
Offset: 0

Views

Author

M. F. Hasler, Jun 20 2022

Keywords

Comments

Motivated by A354766 and A278085.

Examples

			For n = 1, (0, 0, 0, 1) is the only solution.
For n = 2, (0, 0, 0, 2) and (1, 1, 1, 1) are solutions, with 1 + 1 + 1 - 1 = 2.
		

Crossrefs

Programs

  • PARI
    apply( {A353589(n, show=0, cnt=0, n2=n^2, e=[1,-1]~)=
      for(a=0,sqrtint(n2\4), for(b=a,sqrtint((n2-a^2)\3),
        my(s=[a+b, b-a, a-b, -a-b]); foreach(sum2sqr(n2-a^2-b^2), cd, cd[1] >= b &&
          vecsum(cd)+s[1] >= n && foreach(s, d, (vecsum(cd)+d==n || abs(cd*e+d)==n)&&
            cnt++&& !(show && print1(concat([a, b], cd)))&& break)))); cnt}, [0..99]) \\ See A133388 for sum2sqr().

A304436 Numbers n such that n^6 is the sum of two distinct perfect powers > 1 (x^k + y^m; x, y, k, m >= 2).

Original entry on oeis.org

5, 10, 13, 15, 17, 20, 25, 26, 29, 30, 33, 34, 35, 36, 37, 39, 40, 41, 45, 50, 51, 52, 53, 55, 56, 58, 60, 61, 65, 68, 70, 73, 74, 75, 78, 80, 81, 82, 85, 87, 89, 90, 91, 95, 96, 97, 100, 101, 102, 104, 105, 106, 109, 110, 111, 112, 113, 115, 116, 117, 119, 120, 122, 123, 125, 126, 130, 135, 136, 137, 140, 143, 145, 146, 148, 149, 150
Offset: 1

Views

Author

M. F. Hasler, May 25 2018

Keywords

Comments

Motivated by the search for solutions to a^n + b^(2n+2)/4 = (perfect square), which arises when searching for 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.

Examples

			5^6 = 35^2 + 120^2, 10^6 = 280^2 + 960^2, ...
		

Crossrefs

Cf. A304433, A304434, A304435, A001597 (perfect powers).

Programs

  • Maple
    LIM:=200^6: P:={seq(seq(x^k, k=3..floor(log[x](LIM))), x=2..floor(LIM^(1/3)))}:
    is_A304436:= proc(n) local N, S;  N:= n^6;  if remove(t -> subs(t, x)<=1 or subs(t, y)<=1 or subs(t, x-y)=0, [isolve(x^2+y^2=N)]) <> [] then return true fi;  S:= map(t ->N-t, P minus {N, N/2});  (S intersect P <> {}) or (select(issqr, S) <> {})
    end proc: # adapted from code by Robert Israel for A304434
  • Mathematica
    LIM = 200^6;
    P = Union@ Flatten@ Table[Table[x^k, {k, 3, Floor[Log[x, LIM]]}], {x, 2, Floor[LIM^(1/3)]}];
    filterQ[n_] := Module[{M = n^6, S}, If[Solve[x > 1 && y > 1 && x^2 + y^2 == M, {x, y}, Integers] != {}, Return [True]]; S = M - (P ~Complement~ {M, M/2}); S ~Intersection~ P != {} || Select[S, IntegerQ[Sqrt[#]]&] != {}];
    Reap[For[n = 1, n <= 150, n++, If[filterQ[n], Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Aug 12 2020, after Maple *)
  • PARI
    L=200^6;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=6)={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))} \\ Needs the above P computed up to L >= n^6. For sum2sqr() see A133388.

A257965 Numbers n such that n^3 = a^2 + b^2 and a^3 + b^3 is a square, for some positive integers a and b.

Original entry on oeis.org

2, 32, 125, 162, 512, 1250, 2000, 2592, 4802, 8192, 10125, 13122, 20000, 29282, 32000, 41472, 49000, 57122, 76832, 78125, 92450, 101250, 131072, 152881, 162000, 167042, 207025, 209952, 215306, 260642, 300125, 320000, 388962, 468512, 512000, 559682, 663552
Offset: 1

Views

Author

M. F. Hasler, May 14 2015

Keywords

Comments

A subsequence of A000404.
Two subsequences are given by: n = 2*m^4 with a = b = 2*m^6, and n = 5^3*m^4 with a = 5^4*m^6, b = 2*a.

Programs

  • Mathematica
    L = {}; n = 0; Clear[x, y]; While[n < 5000, n++; If[ And @@ (EvenQ /@ Last /@ Select[FactorInteger[n], Mod[First[#] + 1, 4] == 0 &]) && False =!= (sol = Reduce[n^3 == x^2 + y^2 && x >= y > 0, {x, y}, Integers]), ss = {x, y} /. List@ToRules@sol; If[{} != Select[ss, IntegerQ@ Sqrt@ Total[#^3] &, 1], AppendTo[L, n]; Print@L]]]; L (* Giovanni Resta, May 18 2015 *)
  • PARI
    is(n)={is_A000404(n)&&for(i=1,#T=sum2sqr(n^3),T[i][1]&&issquare(T[i][1]^3+T[i][2]^3)&&return(T[i]))} \\ Uses sum2sqr(), cf. A133388. Returns [a,b] if n is in the sequence, 0 else.

Extensions

Corrected and extended by Giovanni Resta, May 18 2015

A298591 Numbers which are the sum of two distinct perfect powers x^k + y^m with x, y, k, m >= 2.

Original entry on oeis.org

12, 13, 17, 20, 24, 25, 29, 31, 33, 34, 35, 36, 40, 41, 43, 44, 45, 48, 52, 53, 57, 58, 59, 61, 63, 65, 68, 72, 73, 74, 76, 80, 81, 85, 89, 90, 91, 96, 97, 100, 104, 106, 108, 109, 113, 116, 117, 125, 127, 129, 130, 132, 133, 134, 136, 137, 141, 144, 145, 146, 148, 149, 150
Offset: 1

Views

Author

M. F. Hasler, May 26 2018

Keywords

Comments

The number of terms between 2^(n-1) and 2^n-1 is, for n = 1, 2, 3, ...: 0, 0, 0, 2, 6, 17, 24, 69, 129*, 215, 425, 891, 1571, 2994, 5655*, 10535, 20132, 38840, 73510, 140730, 268438*, 514262, ... (For terms with * the next larger power of 2 is in the sequence, so it would be, e.g., ..., 130, 214, ... if we count from 2^n+1 to 2^(n+1).) At 2^22 this corresponds to a density of about 25%, decreasing by about 1% at each power of 2.

Examples

			12 = 2^2 + 2^3, 13 = 2^2 + 3^2, 17 = 2^3 + 3^2, ...
		

Crossrefs

Programs

  • Maple
    N:= 1000: # for all terms <= N
    PP:= {seq(seq(x^k,k=2..floor(log[x](N))),x=2..floor(sqrt(N)))}:
    sort(convert(select(`<=`,{seq(seq(PP[i]+PP[j],i=1..j-1),j=2..nops(PP))},N),list)); # Robert Israel, May 27 2018
  • Mathematica
    max = 150; Table[If[x^k == y^m, Nothing, x^k + y^m], {x, 2, Sqrt[max-4]}, {y, x, Sqrt[max-4]}, {k, 2, Log[2, max-4]}, {m, 2, Log[2, max-4]}] // Flatten // Select[#, # <= max &]& // Union (* Jean-François Alcover, Sep 18 2018 *)
  • PARI
    is(n,A=A076467,s=sum2sqr(n))={for(i=1,#s, vecmin(s[i])>1 && s[i][1]!=s[i][2] && return(1)); for(i=2,#A, n>A[i]||return; ispower(n-A[i]) && A[i]*2!=n && return(1))} \\ A076467 must be computed up to limit n. See A133388 for sum2sqr.

A305024 Minimal number of squares, not all equal to 1, having as sum prime(n), such that their squares also sum to a prime; 0 if no such decomposition exists.

Original entry on oeis.org

0, 0, 2, 4, 3, 2, 2, 3, 4, 2, 4, 2, 2, 3, 7, 2, 5, 4, 4, 4, 2, 4, 3, 2, 3, 3, 5, 3, 4, 5, 4, 3, 2, 3, 2, 4, 2, 4, 4, 3, 3, 2, 4, 4, 4, 4, 3, 4, 3, 4, 3, 4, 3, 3, 2, 4, 2, 4, 3, 2, 3, 2, 4, 4, 2, 4, 4, 4, 3, 2, 3, 4, 4, 2, 3, 4, 3, 2, 2, 2, 3, 2, 4, 3, 4, 3, 3, 4, 2, 4, 3, 4, 4, 3, 3
Offset: 1

Views

Author

M. F. Hasler, May 23 2018

Keywords

Comments

It has been conjectured (cf. A126769) that any prime p >= 5 can be written in a nontrivial way as p = Sum (b_i)^2 such that Sum (b_i)^4 is also prime. This sequence lists the number of required terms b_i for each prime.
The two initial zeros say that this decomposition is not possible for prime(1) = 2 and prime(2) = 3, and are thus conjectured to be the only zeros of the sequence. Since we are interested in the minimal number of terms, we can consider only nonzero b_i >= 1 and min{b_i} >= 2 to avoid the trivial solution b_i = 1 for all i <= k = prime(n).

Examples

			The first two primes, 2 and 3, cannot be written as a sum of squares not all equal to 1, because the smallest such sum is 1^2 + 2^2 = 5. (The empty sum and a one-term sum of a square cannot be prime, either.) Therefore a(1) = a(2) = 0.
The third prime, 5, can be written in exactly one way as a nontrivial sum of two squares, 5 = 1^2 + 2^2, and the sum of the fourth powers is 1^4 + 2^4 = 17, which is again prime. Therefore, a(3) = 2.
The fourth prime, 7, cannot be written as sum of 2 or 3 squares, but only 4 squares, as 7 = 1^2 + 1^2 + 1^2 + 2^2, and it turns out that sum of the fourth powers also yields a prime,  1^4 + 1^4 + 1^4 + 2^4 = 19. Therefore, a(4) = 4.
prime(15) = 47 = 1^2 + 2^2 + 2^2 + 2^2 + 3^2 + 3^2 + 4^2, and the sum of the fourth powers gives the prime 467. Since no smaller number of terms has this property, a(15) = 7.
prime(18) = 61 = 2^2 + 4^2 + 4^2 +5^2, and 2^4 + 4^4 + 4^4 +5^4 = 1153, a prime, and no smaller number of terms has this property, so a(18) = 4.
prime(27) = 103 = 1^2 + 4^2 + 5^2 + 5^2 + 6^2 and 1^4 + 4^4 + 5^4 + 5^4 + 6^4 = 2803, a prime, and no smaller number of terms has this property, so a(27) = 5.
The values 2, 3, 4, 5 appear for the first time at index n = 3, 5, 4, 17, and a(15) = 7. We don't know when the first 6 occurs, nor whether this happens at all.
Conjecture: The sequence is bounded.
Is it possible to show that no term of the sequence is larger than 7?
		

Crossrefs

Programs

  • Maple
    repss:= proc(n,k,i) option remember;
    # lists of k squares >= i^2 summing to n
      if k = 1 then
       if issqr(n) and n >= i^2 then {[sqrt(n)]}
       else {}
       fi
      elif n < k then {}
      else
       `union`(seq(map(t -> [j,op(t)], procname(n-j^2,k-1,j)),j=i..floor(sqrt(n))))
      fi
    end proc:
    f:= proc(n) local p,k,i,S; global Rep;
      p:= ithprime(n);
      for k from 2 do
        S:= select(t -> isprime(convert(map(`^`,t,4),`+`)), repss(p,k,1));
        if nops(S) > 0 then Rep[n]:= S[1]; return k fi
      od
    end proc:
    0,0,seq(f(n),n=3..100); # Robert Israel, Dec 12 2019
  • Mathematica
    a[n_] := Block[{p = Prime@n, c, k=2}, c = Range[Sqrt[p]]^2; While[ kGiovanni Resta, Dec 12 2019 *)
  • PARI
    apply( A305024(n)={n=prime(n); for(k=2, n-3, my(s=sqrtint((n-k)\3+1), t);
        forvec(b=vector(k-2, i, [1,s]), t=vecsum([t^4|t<-b]);
          for(i=1,#s=sum2sqr(n-norml2(b))/* see A133388 for sum2sqr() */,
            s[i][1]>0 && isprime(s[i][1]^4+s[i][2]^4+t) && return(k))/*end for i*/
        , 1/*forvec:increasing*/))}, [1..95]) \\ Bug fixed: M. F. Hasler, Dec 12 2019

Formula

If

Extensions

Corrected by Robert Israel, Dec 12 2019

A357019 a(n) is the largest possible x in n = x^2 - x*y + y^2 with integers x > y >= 0, or 0 if n cannot be expressed in this form.

Original entry on oeis.org

0, 1, 0, 2, 2, 0, 0, 3, 0, 3, 0, 0, 4, 4, 0, 0, 4, 0, 0, 5, 0, 5, 0, 0, 0, 5, 0, 6, 6, 0, 0, 6, 0, 0, 0, 0, 6, 7, 0, 7, 0, 0, 0, 7, 0, 0, 0, 0, 8, 8, 0, 0, 8, 0, 0, 0, 0, 8, 0, 0, 0, 9, 0, 9, 8, 0, 0, 9, 0, 0, 0, 0, 0, 9, 0, 10, 10, 0, 0, 10, 0, 9, 0, 0, 10, 0
Offset: 0

Views

Author

Hugo Pfoertner, Sep 10 2022

Keywords

Crossrefs

Programs

  • PARI
    dloesch(n) = {my(L=List()); foreach([-1,1], qs, my (D=qfbsolve(Qfb(1,qs,1), factor(n), 3), dnp=#D); for (k=1, dnp, if(D[k][1]^2+D[k][2]^2-abs(D[k][1]*D[k][2])==n, listput (L, [abs(D[k][1]),abs(D[k][2])])))); Set(L)};
    for (k=1, 85, my(D=dloesch(k), d=#D, m=0); for (j=1, d, m=max(m,D[j][1]));print1(m,", "))
    
  • Python
    from sympy.abc import x, y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A357019(n): return max((a for a,b in diop_quadratic(x*(x-y)+y**2-n)),default=0) # Chai Wah Wu, Sep 12 2022

A304437 Least x > 0 such that x^2 + y^2 = N^N for some y > 0 and N = A230486(n) (= those N having such a solution).

Original entry on oeis.org

10, 7584, 3198598, 1240110271, 776601600000, 5917593031349125, 20762422068404224, 62654932136711087245, 1088221106880000000000, 1589976606572135812562944, 387094246891633853991317879, 6160133339397357294397161472000, 12456283074641193962390812908965, 441379799993599287569478479003906250
Offset: 1

Views

Author

M. F. Hasler (following an idea from Jacques Tramu), Sep 02 2018

Keywords

Comments

Sequence A230486 lists those N such that N^N is the sum of two nonzero squares. Here we list the smallest x which yields such a solution x^2 + y^2 = N^N, thus necessarily y >= x.

Examples

			See Examples in A230486.
		

Crossrefs

Programs

  • PARI
    for( n=1,199, if( t=sum2sqr(n^n), t[1][0]||(t=t[^1])||next;print1(t[1][1]","))) \\ See A133388 for sum2sqr().
    
  • Python
    from itertools import count, islice
    from sympy import primefactors
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A304437_gen(startvalue=2): # generator of terms
        return map(lambda n:min(min(a,b) for a, b in diop_DN(-1,n**n) if a>0 and b>0), filter(lambda n:all(p&3==1 for p in primefactors(n)) if n&1 else any(p&3==1 for p in primefactors(n)),count(max(startvalue,2))))
    A304437_list = list(islice(A304437_gen(),20)) # Chai Wah Wu, May 15 2023
Previous Showing 11-18 of 18 results.