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-9 of 9 results.

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

A257795 Bihappy numbers: numbers that reach 1 under iteration of the sum-of-squares-of-two-digits map s_2.

Original entry on oeis.org

1, 10, 100, 103, 301, 367, 608, 806, 1000, 1030, 1826, 2363, 2618, 2896, 3010, 3056, 3640, 4036, 4498, 4596, 5294, 5630, 6080, 6323, 6703, 6791, 8060, 8484, 9167, 9452, 9628, 9645, 9844, 10000, 10003, 10275, 10300, 10451, 10979, 11241, 11540, 12336, 12770, 12939, 13623, 13929, 14015, 14112, 15104, 15161, 16151, 16286, 17027
Offset: 1

Views

Author

Pieter Post, May 09 2015

Keywords

Comments

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 the squares (A000290) for the first 100 terms. - N. J. A. Sloane, May 10 2015
This sequence is infinite because it contains several infinite subsequences (powers of 10, for example).

Examples

			367 is in the sequence since 3^2+67^2 = 4498 => 44^2+98^2= 11540 => 1^2+15^2+40^2 = 1826 => 18^2+26^2 = 1000 => 10^2+0^2 = 100 => 1^2+0^2 = 1, so in 6 iterations 367 reaches 1.
		

Crossrefs

Cf. A257810 (minimum of the limiting cycle), A007770 (happy numbers), A055616, A000290 (the squares).

Programs

  • PARI
    select( {is_A257795(n,S=[])=!while(1M. F. Hasler, Dec 20 2024

Formula

All 10^k are members of this sequence.
If n is a member each permutation of a set of pairs of digits gives another member.
Placing two zeros between the sets of two digits gives another member.
All other numbers have loops of lengths 1, 2, 4, 5, 6, 10, 14, 35 or 56.
The first number with a loop of length 2 is 51, which reaches the loop (5965, 7706) after 3 iterations.
The first number with a loop of length 4 is 342, loop of 5 is 57, loop of 6 is 389, loop of 10 is 21, loop of 14 is 28, loop of 35 is 2 and the first number with a loop of 56 is 5.
And there are some numbers which end up in a loop of length 1. The first such number is 1233 (= 12^2 + 33^2)
All numbers appear to end up in one of these loops.

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

A055617 a(n)= A*10^(3*n)+B with A=(10^(3*n)-10^n) and B=10^(2*n).

Original entry on oeis.org

990100, 999900010000, 999999000001000000, 999999990000000100000000, 999999999900000000010000000000, 999999999999000000000001000000000000, 999999999999990000000000000100000000000000
Offset: 1

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Examples

			a(2) = (10^6-10^2)*10^6+10^4 = 999900010000.
Note that 999900010000 = 999900^2 + 010000^2 (see A055616).
		

Crossrefs

Subsequence of A055616.

Programs

  • PARI
    a(n) = (10^(3*n)-10^n)*10^(3*n) + 10^(2*n) \\ Michel Marcus, Jul 23 2013

A055618 a(n) = A*10^(4*n-1) + B with A = 990*(10^(4*n)-1)/9999 and B = 990000*(10^(4*n-4)-1)/9999 + 100.

Original entry on oeis.org

990100, 99009900990100, 9900990099009900990100, 990099009900990099009900990100, 99009900990099009900990099009900990100, 9900990099009900990099009900990099009900990100, 990099009900990099009900990099009900990099009900990100
Offset: 1

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Examples

			a(2) = (990*(10^8-1)/9999)*10^7 + 990000*(10^4-1)/9999 + 100 = 99009900990100 = 9900990^2 + 0990100^2.
		

Crossrefs

Subset of A055616.

Programs

  • Maple
    for n from 1 to 15 do printf(`%d,`,(990*(10^(4*n)-1)/9999)*10^(4*n-1)+990000*(10^(4*n-4)-1)/9999+100 ) od:

Extensions

One more term from James Sellers, Sep 28 2001
a(6) corrected by Sean A. Irvine, Mar 29 2022

A055619 a(n) = A*10^(4*n+1)+B with A=99000*(10^(4*n)-1)/9999+10 and B=9900*(10^(4*n)-1)/9999+1.

Original entry on oeis.org

9901009901, 990099010099009901, 99009900990100990099009901, 9900990099009901009900990099009901, 990099009900990099010099009900990099009901
Offset: 1

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Examples

			a(2) = (99000*(10^8-1)/9999+10)*10^9+9900*(10^8-1)/9999+1 = 990099010099009901.
Note that 990099010099009901 = 990099010^2+099009901^2.
		

Crossrefs

Subsequence of A055616.

Programs

  • Magma
    [(100^(2*n+1)+1)^2/101: n in [1..5]]; // Bruno Berselli, Jul 23 2013
  • Mathematica
    Table[(100^(2 n + 1) + 1)^2/101, {n, 5}] (* Bruno Berselli, Jul 23 2013 *)
  • PARI
    a(n) = (99000*(10^(4*n)-1)/9999+10)*10^(4*n+1)+9900*(10^(4*n)-1)/9999+1 \\ Michel Marcus, Jul 23 2013
    

Formula

a(n) = ( 100^(2*n+1) + 1 )^2 / 101. [Bruno Berselli, Jul 23 2013]
G.f.: 101*x*(98029801-1000000010000*x+1000000000000*x^2)/((1-x)*(1-10000*x)*(1-100000000*x)). [Bruno Berselli, Jul 23 2013]

A257810 Smallest number of the cycle in which n ends under iteration of sum-of-the-square-of-two-digits.

Original entry on oeis.org

1, 37, 37, 37, 41, 41, 41, 41, 37, 1, 41, 41, 41, 41, 37, 37, 41, 41, 37, 37, 1268, 41, 41, 41, 41, 41, 41, 1946, 37, 37, 41, 41, 37, 37, 41, 41, 37, 37, 41, 37, 41, 41, 1946, 41, 37, 41, 1946, 37, 41, 41, 5965, 41, 41, 41, 41, 37, 1781, 41, 37, 41, 41, 41, 1268, 41, 41, 37, 37, 41, 37, 41, 41, 41, 41, 5965, 37, 37, 41, 41, 41, 41, 37, 37, 41, 37, 41, 41, 37, 41, 41, 37, 41, 41, 41, 41, 37, 41, 41, 41, 41, 1
Offset: 1

Views

Author

Pieter Post, May 09 2015

Keywords

Comments

For the definition of the 'sum-of-the-square-of-two-digits' see the comment on A257795 where the map is called s_2.
The following statements, densities and conjectures are based on calculations for n = 1..10000.
The map s_2 has fixed points 1, 1233, 3388, ... These are cycles of length 1. For the two four digit numbers see A055616.
Because s_2(3312) = 1233 and s_2(8833) = 3388 one has a(3312) = 1233 and a(8833) = 3388.
The numbers that end under iteration of s_2 in the cycle (1) are called the bihappy numbers (A257795). They have a density of 0.33%.
It is conjectured that iterations of s_2 always end in cycles of finite period length and besides the 1-cycles for fixed points and the bihappy numbers there are ten different cycles of length > 1. The period lengths are: 2, 2, 4, 5, 5, 6, 10, 14, 35 or 56.
Two cycles with a period length of 2: 5965 => 7706 => 5965, first number that reaches this 2-cycle is 51, the second 2-cycle is: 3869 => 6205 => 3869, first number that reaches this 2-cycle is 562. Density of both 2-cycles together is 0.9%.
Cycle with a period length of 4: 3460 => 4756 => 5345 => 4834 => 3460. First number to reach this 4-cycle is 342. Density is 0.69%.
Two cycles with a period length of 5: (1781, 6850, 7124, 5617, 3425, 1781), first number to reach this 5-cycle is 57. And (3770, 6269, 8605, 7421, 5917), first number to reach this 5-cycle is 162. Density of both 5-cycles together is 1.78%.
Cycle with a period length of 6: (4973, 7730, 6829, 5465, 7141, 6722, 4973). First number to reach this 6-cycle is 389. Density exactly 1%.
Cycle with a period length of 10: (1268, 4768, 6833, 5713, 3418, 1480, 6596, 13441, 2838, 2228, 1268). First number to reach this 10-cycle is 21. Density 0.48%.
Cycle with a period length of 14: (1946, 2477, 6505, 4250, 4264, 5860, 6964, 8857, 10993, 8731, 8530, 8125, 7186, 12437, 1946). First number to reach this 14-cycle is 28. Density 5.5%.
Cycle with a period length of 35: (37, 1369, 4930, 3301, 1090, 8200, 6724, 5065, 6725, 5114, 2797, 10138, 1446, 2312, 673, 5365, 7034, 6056, 6736, 5785, 10474, 5493, 11565, 4451, 4537, 3394, 9925, 10426, 693, 8685, 14621, 2558, 3989, 9442, 10600, 37). First number to reach this 35-cycle is 2. Density is 27.89%.
Cycle with a period length of 56: (41, 1681, 6817, 4913, 2570, 5525, 3650, 3796, 10585, 7251, 7785, 13154, 3878, 7528, 6409, 4177, 7610, 5876, 9140, 9881, 16165, 7947, 8450, 9556, 12161, 4163, 5650, 5636, 4432, 2960, 4441, 3617, 1585, 7450, 7976, 12017, 690, 8136, 7857, 9333, 9738, 10853, 2874, 6260, 7444, 7412, 5620, 3536, 2521, 1066, 4456, 5072, 7684, 12832, 1809, 405, 41). First number to reach this 56-cycle is 5. Density 61.38%.

Examples

			s_2^[3](51)=5965, since 51^2 = 2601 => 26^2+1^2 = 677 => 6^2+77^2 = 5965 => 59^2+ 65^2 = 7706 => 77^2+6^2 = 5965. Three iterations are needed to reach the 2-cycle (5965, 7706).
		

Crossrefs

Cf. A257795 (bi-happy numbers: indices of 1s in this sequence), A007770 (happy numbers), A055616 (fixed points of a similar map).

Programs

  • PARI
    apply( {A257810(n)=for(i=0,1, my(S=[n]); while(!setsearch(S, n=norml2(digits(n, 100))), S=setunion(S, [n])); i && n=S[1]); n}, [1..99]) \\ M. F. Hasler, Dec 20 2024

Extensions

Edited by Wolfdieter Lang, Jun 08 2015

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

A257948 Length of cycle in which n ends under iteration of sum-of-squares-of-two-digits map s_2.

Original entry on oeis.org

1, 35, 35, 35, 56, 56, 56, 56, 35, 1, 56, 56, 56, 56, 35, 35, 56, 56, 35, 35, 10, 56, 56, 56, 56, 56, 56, 14, 35, 35, 56, 56, 35, 35, 56, 56, 35, 35, 56, 35, 56, 56, 14, 56, 35, 56, 14, 35, 56, 56, 2, 56, 56, 56, 56, 35, 5, 56, 35, 56, 56, 56, 10, 56, 56, 35, 35, 56, 35, 56, 56, 56, 56, 2, 35, 35, 56, 56, 56, 56, 35, 35, 56, 35, 56, 56, 35, 56, 56, 35, 56, 56, 56, 56, 35, 56, 56, 56, 56, 1
Offset: 1

Views

Author

Pieter Post, May 14 2015

Keywords

Comments

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 following statements, densities and conjectures are based on calculations for n = 1...10000.
The map s_2 has fixed points 1, 1233, 3388. These are cycles of length 1. For the two 4-digit numbers see A055616. There are more numbers that end under iteration of s_2 in 1233 or 3388. Like a(3312) = 1233 or a(3388) = 8833.
The numbers that end under iteration of s_2 in 1 are called the bihappy numbers (A257795). They have a density of 0.33%.
It is conjectured that iterations of s_2 always end in cycles of finite period length and besides the 1-cycles there are ten different cycles of length > 1. The period lengths are 2, 2, 4, 5, 5, 6, 10, 14, 35 or 56.
Two cycles with a period length of 2: 5965 => 7706 => 5965, first number that reaches this 2-cycle is 51, the second 2-cycle is: 3869 => 6205 => 3869, first number that reaches this 2-cycle is 562. Density of both 2-cycles together is 0.9%.
Cycle with a period length of 4: 3460 => 4756 => 5345 => 4834 => 3460. First number to reach this 4-cycle is 342. Density is 0.69%.
Two cycles with a period length of 5: (1781, 6850, 7124, 5617, 3425, 1781), first number to reach this 5-cycle is 57. And (3770, 6269, 8605, 7421, 5917), first number to reach this 5-cycle is 162. Density of both 5-cycles together is 1.78%.
Cycle with a period length of 6: (4973, 7730, 6829, 5465, 7141, 6722, 4973). First number to reach this 6-cycle is 389. Density exactly 1%.
Cycle with a period length of 10: (1268, 4768, 6833, 5713, 3418, 1480, 6596, 13441, 2838, 2228, 1268). First number to reach this 10-cycle is 21. Density 0.48%.
Cycle with a period length of 14: (1946, 2477, 6505, 4250, 4264, 5860, 6964, 8857, 10993, 8731, 8530, 8125, 7186, 12437, 1946). First number to reach this 14-cycle is 28. Density 5.5%.
Cycle with a period length of 35: (37, 1369, 4930, 3301, 1090, 8200, 6724, 5065, 6725, 5114, 2797, 10138, 1446, 2312, 673, 5365, 7034, 6056, 6736, 5785, 10474, 5493, 11565, 4451, 4537, 3394, 9925, 10426, 693, 8685, 14621, 2558, 3989, 9442, 10600, 37). First number to reach this 35-cycle is 2. Density is 27.89%.
Cycle with a period length of 56: (41, 1681, 6817, 4913, 2570, 5525, 3650, 3796, 10585, 7251, 7785, 13154, 3878, 7528, 6409, 4177, 7610, 5876, 9140, 9881, 16165, 7947, 8450, 9556, 12161, 4163, 5650, 5636, 4432, 2960, 4441, 3617, 1585, 7450, 7976, 12017, 690, 8136, 7857, 9333, 9738, 10853, 2874, 6260, 7444, 7412, 5620, 3536, 2521, 1066, 4456, 5072, 7684, 12832, 1809, 405, 41). First number to reach this 56-cycle is 5. Density 61.38%.
Density is calculated over s_2(1) till s_2(10000).

Examples

			s_2^[9](2)= 35, because 2^2=4=>  4^2=16 => 16^2=256 =>   2^2+56^2=3140 =>   31^2+40^2=2561 =>  25^2+61^2=4346 => 43^2+46^2=3965 => 39^2+65^2=5746 => 57^2+46^2=5365=> 53^2+65^2= 7034. Nine iterations are needed to reach the 35-cycle.
s_2^[3](51)=2, since 51^2 = 2601 => 26^2+1^2 = 677 => 6^+77^2 = 5965 => 59^2+ 65^2 = 7706 => 77^2+6^2 = 5965. Three iterations are needed to reach the 2-cycle.
		

Crossrefs

Showing 1-9 of 9 results.