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-6 of 6 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

A101311 Decimal numbers n such that after possibly prefixing a leading 0 to n, the resulting number n' can be broken into 2 strings of the same length, n' = xy, such that x^2+y^2 = n.

Original entry on oeis.org

1, 1233, 8833, 10100, 990100, 5882353, 94122353, 1765038125, 2584043776, 7416043776, 8235038125, 116788321168, 123288328768, 876712328768, 883212321168, 7681802663025, 8896802846976, 13793103448276
Offset: 1

Views

Author

Colin Barker, Jul 31 2007, Aug 01 2007

Keywords

Comments

Define a map s_2(n) as follows. If n has an even number of digits, say n = abcdef, the map is n -> s_2(n) := (ab)^2+(cd)^2+(ef)^2. If n has an odd number of digits, say n = abcde, the map is n -> s_2(n) = a^2+(bc)^2+(de)^2. The sequence {s_2(n), n >= 0} does not have its own entry in the OEIS because it begins {0, 1, ..., 9801, 1, 2, 5, ...} and agrees with A000290 for the first 100 terms. There are exactly three numbers such that s_2(n) = n, namely 1, 1233, 8833. - N. J. A. Sloane and Pieter Post, May 11 2015

Examples

			1233 is in the sequence because 12^2+33^2 = 1233.
5882353 is in the sequence because 588^2+2353^2 = 5882353.
		

Crossrefs

See A064942 for another version.

A258482 Positive numbers n with concatenations n=x//y such that n=x^2-y^2.

Original entry on oeis.org

100, 147, 10000, 13467, 1000000, 1010100, 1016127, 1034187, 1140399, 1190475, 1216512, 1300624, 1334667, 1416767, 1484847, 1530900, 100000000, 102341547, 102661652, 116604399, 133346667, 159809775, 10000000000, 10101010100, 13333466667, 14848484847
Offset: 1

Views

Author

Pieter Post, May 31 2015

Keywords

Comments

The terms in this sequence have only an odd number of digits. If they would have an even number of digits both parts would have the same length. The maximum difference x^2 - y^2 would be (10^m-1)^2 - 1^2, which is (10^m-2)*10^m. But this is always less than (10^m-1)^2 + 1, so m never equals x^2 - y^2.
For example m=3: 999^2 - 1^2 < 999001.
The terms in this sequence all start with the digit '1'. Suppose they would start with the digit '2' (or more) the smallest possiblity of x^2 - y^2 would be (2*10^m)^2 - (10^m-1)^2 = 3*10^2*m + 2*10^m-1, but this is always more than 2*10^2*m + 10^3-1, so m never equals x^2 - y^2.
For example m=3: 2000^2 - 999^2 > 2000999.
This sequence has an infinite subsequence, since (10^m+(10^m+2)/3)*10^m+(2*10^m+1)/3 equals (10^m+(10^m+2)/3)^2 - ((2*10^m+1)/3)^2 for every positive m.
For example m=3: 1334667 = 1334^2 - 667^2.
This set is a subset of A113797.

Examples

			147 is a member, since 147 = 14^2 - 7^2.
1484847 is a member, since 1484847 = 1484^2- 847^2.
48 is a member of A113797 since 48 = |4^2 - 8^2|, but 48 is not equal to 4^2 - 8^2, so 48 is not a member of this sequence.
		

Crossrefs

Programs

  • PARI
    isok(n) = {d = digits(n); if (#d > 1, for (k=1, #d-1, vba = Vecrev(vector(k, i, d[i])); vbb = Vecrev(vector(#d-k, i, d[k+i])); da = sum(i=1, #vba, vba[i]*10^(i-1)); db = sum(i=1, #vbb, vbb[i]*10^(i-1)); if (da^2 - db^2 == n, return(1));););} \\ Michel Marcus, Jun 14 2015
  • Python
    for p in range(1, 7):
        for i in range(10**p, 10**(p + 1)):
            c = 10**(int((p - 1) / 2) + 1)
            a, b = i // c, i % c
            if i == a**2 - b**2:
                print(i, end=",")
    

Formula

n=x*10^d+y, where 10^(d-1)<=x<10^d and 0<=y<10^d and n=x^2-y^2.

Extensions

More terms from Giovanni Resta, Jun 14 2015

A064943 Number of integers with 2*n digits that are the sum of the squares of their halves (leading zeros count; 1 does not, to avoid the ambiguity 1 = 0^2 + 1^2 = 00^2 + 01^2 = 000^2 + 001^2 = ...).

Original entry on oeis.org

0, 2, 2, 2, 6, 6, 14, 30, 6, 14, 14, 6, 6, 14, 126, 14, 14, 62, 6, 14, 126, 14, 14, 510, 126, 14, 62, 30, 30, 62, 6, 6, 254, 14, 2046, 30, 126, 62, 126, 510, 6, 254, 6, 14, 2046, 14, 14, 254, 30, 254, 2046, 254, 30, 254, 4094, 510, 2046, 126, 6, 254, 30, 126, 2046, 14
Offset: 1

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Comments

Is there any n > 1 with a(n) = 0? This is equivalent to the question of whether there is any prime of the form 10^(2*n)+1 other than 10^(2*1)+1 = 101. If such a prime exists, n must be a power of 2. Up to now no such prime is known.
68 is the smallest n where a(n) is not a power of two minus 2 (a(68)=22) since (10^136)+1 is the smallest integer among the 10^(2*n)+1 which is not squarefree (10^136+1 = 17^2 * P7 * P11 * P117, so tau(10^136+1) = 24).

Examples

			a(5) = 6 because 1765038125 = 17650^2 + 38125^2, 2584043776 = 25840^2+43776^2, 7416043776 = 74160^2+43776^2, 8235038125 = 82350^2+38125^2, 9901009901 = 99010^2+09901^2, 99009901 = 00990^2+09901^2 (the last one counts as a 10-digit number). Alternatively: a(5) = tau(10^(2*5)+1) - 2 = tau(101*3541*27961) - 2 = 8 - 2 = 6.
		

Crossrefs

Cf. A064942 and A002654 for the derivation of the formula.

Formula

a(n) = tau(10^(2*n)+1) - 2.

A178530 Numbers k with the property that there exist nonnegative integers a and b such that k = concat(a,b) = a^2+b^2.

Original entry on oeis.org

0, 1, 100, 101, 1233, 8833, 10100, 990100, 5882353, 94122353, 1765038125, 2584043776, 7416043776, 8235038125, 116788321168, 123288328768, 876712328768, 883212321168, 7681802663025, 8896802846976, 13793103448276, 15348303604525, 84651703604525, 86206903448276, 91103202846976, 92318202663025, 106058810243728
Offset: 1

Views

Author

Karsten Meyer, Dec 23 2010

Keywords

Comments

The sum of two numbers a1 and a2 that share a common b has the form of 10^j. Example: 12 + 88 = 100
The ordered pair of the final digit of a and b is always one of (0,0), (0,1), (0,5), (0,6), (2,3), (8,3), (2,8), or (8,8).
If b has k decimal digits, then (2a - 10^k)^2 + (2b - 1)^2 = 10^(2k) + 1 giving a way for efficient computation of many terms. - Max Alekseyev, Aug 17 2013

Examples

			0 = 0^2+0^2 [this seems a bit far-fetched. - _N. J. A. Sloane_, Dec 23 2010]
1=0^2+1^2 [ditto]
100=10^2+0^2.
101=10^2+1^2.
1233=12^2+33^2.
		

Crossrefs

See A055616, A064942, A101311 for closely related sequences.

Programs

  • Mathematica
    Sort[Reap[Do[n=a^2+b^2; If[n==FromDigits[Join[IntegerDigits[a], IntegerDigits[b]]], Sow[n]], {a,0, 1000}, {b, 0, 1000}]][[2, 1]]]

Extensions

Edited by N. J. A. Sloane, Dec 23 2010
a(11)-a(14) from Nathaniel Johnston, Jan 03 2011
Terms a(15) onward from Max Alekseyev, Aug 17 2013

A259316 Numbers n such that the result of n multiplied by the reversal of n can be split into two numbers a and b of equal length (if the length is odd a leading zero is allowed), where a + b equals n (b can also have a leading zero).

Original entry on oeis.org

1, 9, 54, 55, 99, 999, 2727, 3222, 7777, 8272, 9999, 12466, 22222, 25912, 39114, 75880, 87777, 87804, 93357, 99999, 124660, 142857, 181818, 185185, 189189, 230769, 231868, 324675, 390313, 412587, 428274, 443926, 503866, 513513, 533169, 568468
Offset: 1

Views

Author

Pieter Post, Jun 24 2015

Keywords

Comments

All rep'n'-digits have infinite subsequence, except the rep'n'-digits 3 (mod 9) and 6 (mod 9).
For 'n' is 1, we have the Kaprekar numbers (A145875), the repdigit numbers.
If length is 1 (mod 9), repdigit 1 is part of the sequence, 1111111111*1111111111 = 1234567900987654321 => 123456790 + 987654321 = 1111111111.
If length is 2 (mod 9), repdigit 5 is part of the sequence, 55555555555*55555555555 = 3086419753024691358025 => 30864197530 + 24691358025 = 5555555555.
If length is 4 (mod 9), repdigit 7 is part of the sequence, 7777 * 7777 = 60481729 => 6048 + 1729 = 7777.
If length is 5 (mod 9), repdigit 2 is part of the sequence.
If length is 7 (mod 9), repdigit 4 is part of the sequence.
If length is 8 (mod 9), repdigit 8 is part of the sequence.
Repdigit 9 is part of this sequence in every length.
For 'n' is 2, we have numbers where two digits are repeated, like 52525252.
The rep2-digits which are divisible by 9 have the following infinite subsequences:
If length is 2 (mod 22), rep2-digit 54 is a part of this sequence, 545454545454545454545454 * 454545454545454545454545 = 247933884297520661157024297520661157024793388430 => 247933884297520661157024 + 297520661157024793388430 = 545454545454545454545454
If length is 4 (mod 22), rep2-digit 27 is a part of this sequence.
If length is 6 (mod 22), rep2-digit 18 is a part of this sequence.
If length is 8 (mod 22), rep2-digit 63 is a part of this sequence.
If length is 10 (mod 22), rep2-digit 90 is a part of this sequence.
If length is 14 (mod 22), rep2-digit 36 is a part of this sequence.
If length is 16 (mod 22), rep2-digit 81 is a part of this sequence.
If length is 18 (mod 22), rep2-digit 72 is a part of this sequence.
If length is 20 (mod 22), rep2-digit 45 is a part of this sequence.
Other rep2-digits also have infinite subsequences with length l (mod 198).
Example: rep2-digit 52 has length 8: 52525252 * 25252525 = 1326395239261300 => 13263952 + 39261300 = 52525252, the next length is 206.

Examples

			124660 is a term. Indeed 124660*66421 = 8280041860 and 82800 + 41860 = 124660.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{c, d, len}, c = n FromDigits@ Reverse@ IntegerDigits@ n; d = IntegerDigits@ c; len = Length@ d; If[OddQ@ len, d = PadLeft[d, len + 1]; len++]; n == FromDigits@ Take[d, len/2] + FromDigits@ Take[d, -len/2]]; Select[Range@ 1000000, fQ] (* Michael De Vlieger, Jul 20 2015 *)
  • Python
    def sod(n,m):
        kk = 0
        while n > 0:
            kk= kk+(n%m)
            n =int(n//m)
        return kk
    uu=1
    for a in range (1,9):
        for n in range (10**(a-1)+1, 10**a):
            y=int(str(n)[::-1])
            ll=int(len(str(n*y))/2+0.5)
            u=sod(n*y,10**ll)
            if n==u:
                print (n)
    
  • Python
    # for rep2-digit
    for f in range (12,98):
        aa=1
        for i in range(1,200):
            aa=10**(2*i)+aa
            c=f*aa
            cc=str(c*int(str(c)[::-1]))
            l=int(len(cc)/2)
            cc1,cc2=int(cc[0:l]),int(cc[l:2*l+1])
            if c==cc1+cc2:
                print (c)

Extensions

Missing a(21) from Giovanni Resta, Jul 19 2015
Showing 1-6 of 6 results.