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.

Showing 1-2 of 2 results.

A055616 Numbers, with an even number of digits, that are the sum of the squares of their two halves (leading zeros allowed only for the second half).

Original entry on oeis.org

1233, 8833, 990100, 94122353, 1765038125, 2584043776, 7416043776, 8235038125, 9901009901, 116788321168, 123288328768, 876712328768, 883212321168, 999900010000, 13793103448276, 15348303604525, 84651703604525, 86206903448276, 91103202846976, 92318202663025
Offset: 1

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Comments

The sequence is infinite since it contains several infinite subsequences (see A055617, etc.).
If x = A*10^n+B is an element not beginning with 9, then (10^n-A)*10^n+B is another (e.g. 1233 <-> 8833).
Numbers that can be written as n = A*10^d + B with 10^(d-1) <= A < 10^d, 0 <= B < 10^d, and A^2 + B^2 = n. - Robert Israel, May 10 2015

Examples

			8833 is ok, since 8833 = 88^2 + 33^2.
		

Crossrefs

Cf. A064942 for the number of solutions, where leading zeros are allowed.

Programs

  • Maple
    dmax:= 8: # to get all entries with at most 2*dmax digits
    Res:= NULL:
    for d from 2 to dmax  do
         cands:= map(t -> subs(t,[x,y]), [isolve(x^2 + y^2 = 10^(2*d)+1)]);
         cands:= select(t -> t[1]::even and t[1]>=0 and t[2]>0, cands);
         cands:= map(t -> ([(10^d + t[1])/2, (t[2]+1)/2], [(10^d-t[1])/2, (t[2]+1)/2]), cands);
         cands:= select(t -> (t[1]>= 10^(d-1) and t[1] < 10^d and t[2] <= 10^d), cands);
         Res:= Res, op(map(t -> 10^d*t[1]+t[2], cands));
    od:
    sort([Res]); # Robert Israel, May 10 2015
  • Mathematica
    fQ[n_] := Block[{d = IntegerDigits@ n}, If[OddQ[Length@ d], False, Plus[FromDigits[Take[d, Length[d]/2]]^2, FromDigits[Take[d, -Length[d]/2]]^2]] == n]; Select[Range@ 1000000, fQ] (* Michael De Vlieger, May 09 2015 *)
  • PARI
    select( {is_A055616(n, L=logint(n,10))=L%2 && n==norml2(divrem(n,10^(L\/2)))}, [1..10^5]) \\ M. F. Hasler, Dec 20 2024
    for(L=1,oo, for(n=10^L,10^L++, is_A055616(n)&& print1(n", "))) \\ slow beyond 10^6
  • Python
    def a():
      n = 1
      while n < 10**6:
        st = str(n)
        if len(st) % 2 == 0:
          s1 = st[:int(len(st)/2)]
          s2 = st[int(len(st)/2):int(len(st))]
          if int(s1)**2+int(s2)**2 == int(st):
            print(n,end=', ')
            n += 1
          else:
            n += 1
        else:
          n = 10*n
    a()
    # Derek Orr, Jul 08 2014
    

Extensions

Definition corrected by Derek Orr, Jul 09 2014

A064942 Decimal numbers n such that after possibly prefixing leading 0's to n, the resulting number n' can be broken into 2 numbers of equal length, n' = xy, such that x^2+y^2 = n (y may also have leading zeros).

Original entry on oeis.org

1, 1233, 8833, 10100, 990100, 5882353, 94122353, 99009901, 100010000, 1765038125, 2584043776, 7416043776, 8235038125, 9901009901, 48600220401, 116788321168, 123288328768, 601300773101, 876712328768, 883212321168, 990100990100
Offset: 1

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Comments

If A*10^m+B is an element, then so is (10^m-A)*10^m+B (e.g. 1233 <-> 8833 or 010100 <-> 990100)
Since A^2+B^2 = A*10^m+B can be written as 10^(2*m)+1 = (2*A-10^m)^2 + (2*B-1)^2 the number of solutions with 2*m digits (necessary leading zeros count) can be reduced to finding the ways 10^(2*m)+1 can be written as sum of 2 squares. For the following results, see A002654. Since 10^(2*m)+1 is odd and has no prime factors of the form 4*r+3 the number of ways writing 10^(2*m)+1 as sum of 2 squares is just tau(10^(2*m)+1) (order matters). Since changing the order does not lead to a new solution (2*A-10^m is always the even square and 2*B-1 is always the odd square) and since the trivial 10^(2*m)+1 = (10^m)^2 + 1^2 leads to the ambiguous A = 0 and B = 1 there are only tau(10^(2*m)+1)/2-1 relevant ways. Because of the transformation from A to (10^m-A) every of these possibilities leads to a pair of solutions. So the number of solutions with 2*m digits is tau(10^(2*m)+1)-2, see A064943

Examples

			8833 = 88^2 + 33^2, 5882353 = 0588^2 + 2353^2.
		

Crossrefs

Cf. A064943 for the number of solutions, A055616 for the solutions where leading zeros are not allowed, A055617, A055618, A055619 for some infinite subsequences and A002654 for finding the number of ways writing an integer as sum of two squares.
A101311 is another version.

Programs

  • Maple
    with (numtheory): for m from 1 to 10 do: for i in sum2sqr(10^(2*m)+1) do: if i[1] > 1 and i[1] < 10^m then if type(i[1],odd) then a := (i[2]+10^m)/2: b := (i[1]+1)/2: else a := (i[1]+10^m)/2: b := (i[2]+1)/2: fi: print("Length =", 2*m, "Solution =", (10^m-a)*10^m+b): print(Length = 2*m, Solution = a*10^m+b): fi: od: od:

Extensions

Edited by N. J. A. Sloane, Jul 31 2007
Showing 1-2 of 2 results.