This site is supported by donations to The OEIS Foundation.

User:Oskar Wieland

From OeisWiki
Jump to: navigation, search

I'm a software developer based in Munich, Germany

Pythagoras triangles

Just as shorthand, this is the proposed function:

int A078644(int64 i)
{
    int result = 0; int64 xx = 4*i*i;
    for(int64 n=1,x=i+i+1;;n++,x++)
    {
        xx += x+x-1; if(xx%n) continue;
        int64 xn = xx/n; if(xn%2 != n%2) continue;
        if((xn-n)/2 > x) result++; else return result;
    }
}

Here's the formatted code, yz represents the hypotenuse, y and z are the legs:

int A000005(int64 i)
{
    int result = 0; int64 xx = 4*i*i;
    for(int64 n=1,x=i+i+1;;n++,x++)
    {
        xx += x+x-1; if(xx%n) continue;
        int64 yz = xx/n; if(yz%2 != n%2) continue;
        int64 y = (yz-n)/2, z = (yz+n)/2; if(y <= x) return result;
        if(GCD(x,GCD(y,z)) == n) result++;
    }
}

int A068068(int64 i)
{
    int result = 0; int64 xx = 4*i*i;
    for(int64 n=1,x=i+i+1;;n++,x++)
    {
        xx += x+x-1; if(xx%n) continue;
        int64 yz = xx/n; if(yz%2 != n%2) continue;
        int64 y = (yz-n)/2, z = (yz+n)/2; if(y <= x) return result;
        if(GCD(x,GCD(y,z)) == 1) result++;
    }
}

Example with radius 24:

1: (49,1200,1201) 
2: (50,624,626)  = 2x (25,312,313)
3: (51,432,435)  = 3x (17,144,145)
4: (52,336,340)  = 4x (13,84,85)
6: (54,240,246)  = 6x (9,40,41)
8: (56,192,200)  = 8x (7,24,25)
9: (57,176,185)
12: (60,144,156) = 12x (5,12,13)
16: (64,120,136) = 8x (8,15,17)
18: (66,112,130) = 2x (33,56,65)
24: (72,96,120)  = 24x (3,4,5)
32: (80,84,116)  = 4x (20,21,29)
A078644(24) = 12, A000005(24) = 8, A068068(24) = 2
A068068 -> number of primitive pythagorean triangles (PPT)
1: (49,1200,1201)
9: (57,176,185)
A000005 -> number where the index (difference between hypotenuse and the 2nd leg) and PPT multiplicator are the same
1: (49,1200,1201)
2: (50,624,626) = 2x (25,312,313)
3: (51,432,435) = 3x (17,144,145)
4: (52,336,340) = 4x (13,84,85)
6: (54,240,246) = 6x (9,40,41)
8: (56,192,200) = 8x (7,24,25)
12: (60,144,156) = 12x (5,12,13)
24: (72,96,120) = 24x (3,4,5)
A078644 -> total number of triangles

Example with radius 25:

1: (51,1300,1301)
2: (52,675,677)
5: (55,300,305)   = 5x (11,60,61)
10: (60,175,185)  = 5x (12,35,37)
25: (75,100,125)  = 25x (3,4,5)
A078644(25) = 5, A000005(25) = 3, A068068(25) = 2

Example with radius 26:

1: (53,1404,1405) 
2: (54,728,730) = 2x (27,364,365)
4: (56,390,394) = 2x (28,195,197)
8: (60,221,229) 
13: (65,156,169) = 13x (5,12,13)
26: (78,104,130) = 26x (3,4,5)
A078644(26) = 6, A000005(26) = 4, A068068(26) = 2

Sequences inside the pentagonal numbers A000326 and A001318

A000326 (not generalized):

  • a(n) = A000326(n+1)-A000326(n)
    Equals A016777 (3n+1)
    1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 55, 58, ...
  • a(n) = A000326(n+2)-A000326(n)
    Equals A016969 (6n+5)
    5, 11, 17, 23, 29, 35, 41, 47, 53, 59, 65, 71, 77, 83, 89, 95, 101, 107, 113, 119, ...
  • a(n) = A000326(n+3)-A000326(n)
    Equals A016777*3
    Equals A017197 (9n+3)
    3, 12, 21, 30, 39, 48, 57, 66, 75, 84, 93, 102, 111, 120, 129, 138, 147, 156, 165, 174, 183, ...
  • a(n) = A000326(n+4)-A000326(n)
    Equals A017641 (12n+10)
    Equals A016969*2
    10, 22, 34, 46, 58, 70, 82, 94, 106, 118, 130, 142, 154, 166, 178, 190, 202, 214, 226, 238, 250, ...
  • a(n) = A000326(n+5)-A000326(n)
    Equals A016777*5
    5, 20, 35, 50, 65, 80, 95, 110, 125, 140, 155, 170, 185, 200, 215, 230, 245, 260, 275, 290, 305, ...
  • a(n) = A000326(n+6)-A000326(n)
    Equals A016969*3
    15, 33, 51, 69, 87, 105, 123, 141, 159, 177, 195, 213, 231, 249, 267, 285, 303,
  • a(n) = A000326(n+7)-A000326(n)
    Equals A016777*7
    7, 28, 49, 70, 91, 112, 133, 154, 175, 196, 217, 238, 259, 280, 301, 322, 343, 364, 385, 406, ...
  • a(n) = A000326(n+8)-A000326(n)
    Equals A016969*4
    20, 44, 68, 92, 116, 140, 164, 188, 212, 236, 260, 284, 308, 332, 356, 380, 404, 428, 452, 476, 500, ...
  • a(n) = A000326(n+9)-A000326(n)
    Equals A016777*9
    9, 36, 63, 90, 117, 144, 171, 198, 225, 252, 279, 306, 333, 360, 387, 414, 441, 468, 495,

A001318 (generalized):

  • a(n) = A001318(n+1)-A001318(n)
    Equals A026741
    a(n) = n if n odd, n/2 if n even
    0, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, ...
  • a(n) = A001318(n+2)-A001318(n)
    Equals A001651 (numbers that are not divisible by 3)
    1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 26, 28, ...
  • a(n) = A001318(n+3)-A001318(n)
    Equals A184418 (convolution square of A040001, without 1)
    a(n) = ((n+1)/2)*5 if n odd, 2n+2 if n even
    2, 5, 6, 10, 10, 15, 14, 20, 18, 25, 22, 30, 26, 35, 30, 40, 34, 45, 38, ...
  • a(n) = A001318(n+4)-A001318(n)
    Equals A007310 (numbers congruent to 1 or 5 mod 6)
    1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 37, 41, 43, 47, 49, 53, 55, ...
  • a(n) = A001318(n+5)-A001318(n)
    a(n) = 4n if n odd, (n/2)*7 if n even
    0, 4, 7, 12, 14, 20, 21, 28, 28, 36, 35, 44, 42, 52, 49, 60, 56, 68, 63, ...
  • a(n) = A001318(n+6)-A001318(n)
    Equals A016051 (numbers of the form 9n+3 or 9n+6)
    Equals 3*A001651
    3, 6, 12, 15, 21, 24, 30, 33, 39, 42, 48, 51, 57, 60, 66, 69, 75, 78, ...
  • a(n) = A001318(n+7)-A001318(n)
    a(n) = 5n if n odd, (n/2)*11 if n even
    0, 5, 11, 15, 22, 25, 33, 35, 44, 45, 55, 55, 66, 65, 77, 75, 88, 85, ...
  • a(n) = A001318(n+8)-A001318(n)
    Equals A091999 (numbers that are congruent to {2, 10} mod 12)
    Equals 2*A007310
    2, 10, 14, 22, 26, 34, 38, 46, 50, 58, 62, 70, 74, 82, 86, 94, 98, 106, 110, 118, ...
  • a(n) = A001318(n+9)-A001318(n)
    a(n) = 7n if n odd, (n/2)*13 if n even
    0, 7, 13, 21, 26, 35, 39, 49, 52, 63, 65, 77, 78, 91, 91, 105, 104, 119, 117, 133, ...
  • a(n) = A001318(n+10)-A001318(n)
    Equals A072703 (last digit of F(n) is 5 where F(n) is the n-th Fibonacci number)
    Equals 5*A001651
    5, 10, 20, 25, 35, 40, 50, 55, 65, 70, 80, 85, 95, 100, 110, 115, 125, 130, 140,
  • a(n) = A001318(n+11)-A001318(n)
    a(n) = 8n if n odd, (n/2)*17 if n even
    0, 8, 17, 24, 34, 40, 51, 56, 68, 72, 85, 88, 102, 104, 119, 120, 136, 136, 153, 152, ...
  • a(n) = A001318(n+12)-A001318(n)
    Equals 3*A007310
    3, 15, 21, 33, 39, 51, 57, 69, 75, 87, 93, 105, 111, 123, 129, 141, 147, 159, 165, ...
  • a(n) = A001318(n+13)-A001318(n)
    a(n) = 10n if n odd, (n/2)*19 if n even
    0, 10, 19, 30, 38, 50, 57, 70, 76, 90, 95, 110, 114, 130, 133, 150, 152, 170, 171, 190, 190, 210, 209, ...
  • a(n) = A001318(n+14)-A001318(n)
    Equals 7*A001651
    7, 14, 28, 35, 49, 56, 70, 77, 91, 98, 112, 119, 133, 140, 154, 161, 175, 182, 196, 203, 217, 224, 238, ...
  • a(n) = A001318(n+15)-A001318(n)
    a(n) = 11n if n odd, (n/2)*23 if n even
    0, 11, 23, 33, 46, 55, 69, 77, 92, 99, 115, 121, 138, 143, 161, 165, 184, 187, 207, 209, 230, 231, 253, ...