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-20 of 32 results. Next

A072764 Tabular N X N -> N bijection induced by Lisp/Scheme function 'cons' combining the two planar binary trees/general trees/parenthesizations encoded by A014486(X) and A014486(Y).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 4, 8, 16, 14, 5, 17, 19, 42, 15, 9, 18, 44, 51, 43, 37, 10, 20, 47, 126, 52, 121, 38, 11, 21, 53, 135, 127, 149, 122, 39, 12, 22, 56, 154, 136, 385, 150, 123, 40, 13, 45, 60, 163, 155, 413, 386, 151, 124, 41, 23, 46, 128, 177, 164, 475, 414, 387, 152
Offset: 0

Views

Author

Antti Karttunen Jun 12 2002

Keywords

Crossrefs

Inverse permutation: A072765. a(n) = A069770(A072766(n)). Also transpose of A072766, i.e. a(n) = A072766(A038722(n)). The upper triangular region: A072773. Projection functions are A072771 ('car') & A072772 ('cdr'). The sizes of the corresponding Catalan structures: A072768. The first row: A057548, the first column: A072795, diagonal: A083938. Cf. also A080300, A025581, A002262.

Extensions

a(0)=0 prepended by Sean A. Irvine, Oct 25 2024

A249741 Sieve of Eratosthenes minus one: a(n) = A083221(n+1) - 1.

Original entry on oeis.org

1, 3, 2, 5, 8, 4, 7, 14, 24, 6, 9, 20, 34, 48, 10, 11, 26, 54, 76, 120, 12, 13, 32, 64, 90, 142, 168, 16, 15, 38, 84, 118, 186, 220, 288, 18, 17, 44, 94, 132, 208, 246, 322, 360, 22, 19, 50, 114, 160, 252, 298, 390, 436, 528, 28, 21, 56, 124, 202, 318, 376, 492, 550, 666, 840, 30, 23, 62, 144, 216, 340, 402, 526, 588, 712, 898, 960, 36, 25
Offset: 1

Views

Author

Antti Karttunen, Nov 15 2014

Keywords

Examples

			The top left corner of the array:
   1,   3,   5,    7,    9,   11,   13,   15,   17,   19,   21,   23,   25,
   2,   8,  14,   20,   26,   32,   38,   44,   50,   56,   62,   68,   74,
   4,  24,  34,   54,   64,   84,   94,  114,  124,  144,  154,  174,  184,
   6,  48,  76,   90,  118,  132,  160,  202,  216,  258,  286,  300,  328,
  10, 120, 142,  186,  208,  252,  318,  340,  406,  450,  472,  516,  582,
  12, 168, 220,  246,  298,  376,  402,  480,  532,  558,  610,  688,  766,
  16, 288, 322,  390,  492,  526,  628,  696,  730,  798,  900, 1002, 1036,
  18, 360, 436,  550,  588,  702,  778,  816,  892, 1006, 1120, 1158, 1272,
  22, 528, 666,  712,  850,  942,  988, 1080, 1218, 1356, 1402, 1540, 1632,
  28, 840, 898, 1072, 1188, 1246, 1362, 1536, 1710, 1768, 1942, 2058, 2116,
...
		

Crossrefs

Inverse: A249742.
Transpose: A114881.
Row 1: A005408, Column 1: A006093, Main diagonal: A249743.

Programs

Formula

a(n) = A083221(n+1) - 1.
As a composition of related permutations:
a(n) = A114881(A038722(n)).
a(n) = A249811(A135764(n)).

A020703 Take the sequence of natural numbers (A000027) and reverse successive subsequences of lengths 1,3,5,7,...

Original entry on oeis.org

1, 4, 3, 2, 9, 8, 7, 6, 5, 16, 15, 14, 13, 12, 11, 10, 25, 24, 23, 22, 21, 20, 19, 18, 17, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 81, 80, 79, 78, 77
Offset: 1

Views

Author

N. J. A. Sloane, May 02 2000

Keywords

Comments

Arrange A000027, the natural numbers, into a (square) spiral, say clockwise as shown in A068225. Read the numbers from the resulting counterclockwise spiral of the same shape that also begins with 1 and this sequence results. - Rick L. Shepherd, Aug 04 2006
Contribution from Hieronymus Fischer, Apr 30 2012: (Start)
The sequence may also be defined as follows: a(1)=1, a(n)=m^2 (where m^2 is the least square > a(k) for 1<=k
A reordering of the natural numbers.
The sequence is self-inverse in that a(a(n))=n.
(End)

Examples

			a(2)=4=2^2, since 2^2 is the least square >2=a(1) and the minimal number not yet in the sequence is 2>1=a(1);
a(8)=6=a(7)-1, since the minimal number not yet in the sequence (=5) is <=7=a(7).
		

References

  • R. Honsberger, "Ingenuity in Mathematics", Table 10.4 on page 87.
  • Suggested by correspondence with Michael Somos.

Crossrefs

A self-inverse permutation of the natural numbers.

Programs

  • Mathematica
    Flatten[Table[Range[n^2,(n-1)^2+1,-1],{n,10}]] (* Harvey P. Dale, Jan 10 2016 *)
    With[{nn=20},Flatten[Reverse/@TakeList[Range[nn^2],Range[1,nn,2]]]] (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Jan 28 2019 *)
  • PARI
    a(n)=local(t); if(n<1,0,t=sqrtint(n-1); 2*(t^2+t+1)-n)

Formula

Contribution from Hieronymus Fischer, Apr 30 2012: (Start)
a(n)=a(n-1)-1, if a(n-1)-1 > 0 is not in the set {a(k)| 1<=k
a(n)=n for n=k(k+1)+1, k>=0.
a(n+1)=(sqrt(a(n)-1)+2)^2, if a(n)-1 is a square, a(n+1)=a(n)-1, else.
a(n)=2*(floor(sqrt(n-1))+1)*floor(sqrt(n-1))-n+2. (End)

A373662 a(n) = (1 + (n+1)^2 - (n-2)*(-1)^n)/2.

Original entry on oeis.org

2, 5, 9, 12, 20, 23, 35, 38, 54, 57, 77, 80, 104, 107, 135, 138, 170, 173, 209, 212, 252, 255, 299, 302, 350, 353, 405, 408, 464, 467, 527, 530, 594, 597, 665, 668, 740, 743, 819, 822, 902, 905, 989, 992, 1080, 1083, 1175, 1178, 1274, 1277, 1377, 1380, 1484, 1487, 1595
Offset: 1

Author

Wesley Ivan Hurt, Jun 12 2024

Keywords

Comments

Fill an array with the natural numbers n = 1,2,... along diagonals in alternating 'down' and 'up' directions. a(n) is row 2 of the boustrophedon-style array (see example).
In general, row k is given by (1+t^2+(n-k)*(-1)^t)/2, t = n+k-1. Here, k=2.

Examples

			       [ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [ 7] [ 8] [ 9] [10] [11] [12]
  [ 1]   1    3    4   10   11   21   22   36   37   55   56   78   ...
  [ 2]   2    5    9   12   20   23   35   38   54   57   77   ...
  [ 3]   6    8   13   19   24   34   39   53   58   76   ...
  [ 4]   7   14   18   25   33   40   52   59   75   ...
  [ 5]  15   17   26   32   41   51   60   74   ...
  [ 6]  16   27   31   42   50   61   73   ...
  [ 7]  28   30   43   49   62   72   ...
  [ 8]  29   44   48   63   71   ...
  [ 9]  45   47   64   70   ...
  [10]  46   65   69   ...
  [11]  66   68   ...
  [12]  67   ...
        ...
		

Crossrefs

For rows k = 1..10: A131179 (k=1) n>0, this sequence (k=2), A373663 (k=3), A374004 (k=4), A374005 (k=5), A374007 (k=6), A374008 (k=7), A374009 (k=8), A374010 (k=9), A374011 (k=10).
Row n=2 of A056011.
Column k=2 of A056023.

Programs

  • Magma
    [(1 + (n+1)^2 - (n-2)*(-1)^n)/2: n in [1..80]];
    
  • Mathematica
    k := 2; Table[(1 + (n+k-1)^2 + (n-k) (-1)^(n+k-1))/2, {n, 80}]
  • Python
    def A373662(n): return ((n+1)*(n+2)-1 if n&1 else n*(n+1)+5)>>1 # Chai Wah Wu, Jun 23 2024

Formula

a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
a(n) = A131179(n+1) + (-1)^n.
G.f.: -x*(2*x^4-3*x^3+3*x+2)/((x+1)^2*(x-1)^3). - Alois P. Heinz, Jun 12 2024

A072766 Transpose of A072764, 'cons' with arguments swapped.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 5, 14, 16, 8, 9, 15, 42, 19, 17, 10, 37, 43, 51, 44, 18, 11, 38, 121, 52, 126, 47, 20, 12, 39, 122, 149, 127, 135, 53, 21, 13, 40, 123, 150, 385, 136, 154, 56, 22, 23, 41, 124, 151, 386, 413, 155, 163, 60, 45, 24, 107, 125, 152, 387, 414, 475, 164
Offset: 0

Author

Antti Karttunen, Jun 12 2002

Keywords

Crossrefs

Inverse permutation: A072767. a(n) = A069770(A072764(n)). Also transpose of A072764, i.e. a(n) = A072764(A038722(n)). Projection functions are A072772 & A072771. The sizes of the corresponding Catalan structures: A072768. The first column: A057548, the first row: A072795. Cf. also A025581, A002262.

Extensions

a(0)=0 prepended by Sean A. Irvine, Oct 25 2024

A246275 Square array A246278 minus 1.

Original entry on oeis.org

1, 3, 2, 5, 8, 4, 7, 14, 24, 6, 9, 26, 34, 48, 10, 11, 20, 124, 76, 120, 12, 13, 44, 54, 342, 142, 168, 16, 15, 32, 174, 90, 1330, 220, 288, 18, 17, 80, 64, 538, 186, 2196, 322, 360, 22, 19, 74, 624, 118, 1572, 246, 4912, 436, 528, 28, 21, 62, 244, 2400, 208, 2872, 390, 6858, 666, 840, 30
Offset: 1

Author

Antti Karttunen, Aug 21 2014

Keywords

Examples

			The top-left corner of the array:
   1,     3,     5,     7,     9,    11,    13,    15,    17,   ...
   2,     8,    14,    26,    20,    44,    32,    80,    74,   ...
   4,    24,    34,   124,    54,   174,    64,   624,   244,   ...
   6,    48,    76,   342,    90,   538,   118,  2400,   846,   ...
  10,   120,   142,  1330,   186,  1572,   208, 14640,  1858,   ...
  12,   168,   220,  2196,   246,  2872,   298, 28560,  3756,   ...
  ...
		

Crossrefs

Inverse permutation: A246276.
Transpose: A246273.
One less than A246278.
Related permutations: A038722, A246675, A246676.
Cf. also A003961.

Programs

Formula

a(n) = A246278(n+1)-1.
As a composition of related permutations:
a(n) = A246273(A038722(n)).

Extensions

Formula edited slightly because of changed starting offset of A246278. - Antti Karttunen, Jan 27 2015

A286101 Square array A(n,k) read by antidiagonals: A(n,k) = T(gcd(n,k), lcm(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table.

Original entry on oeis.org

1, 2, 2, 4, 5, 4, 7, 16, 16, 7, 11, 12, 13, 12, 11, 16, 46, 67, 67, 46, 16, 22, 23, 106, 25, 106, 23, 22, 29, 92, 31, 191, 191, 31, 92, 29, 37, 38, 211, 80, 41, 80, 211, 38, 37, 46, 154, 277, 379, 436, 436, 379, 277, 154, 46, 56, 57, 58, 59, 596, 61, 596, 59, 58, 57, 56, 67, 232, 436, 631, 781, 862, 862, 781, 631, 436, 232, 67, 79, 80, 529, 212, 991, 302, 85, 302, 991, 212, 529, 80, 79
Offset: 1

Author

Antti Karttunen, May 03 2017

Keywords

Comments

The array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Examples

			The top left 12 X 12 corner of the array:
   1,   2,   4,   7,   11,   16,   22,   29,   37,   46,   56,   67
   2,   5,  16,  12,   46,   23,   92,   38,  154,   57,  232,   80
   4,  16,  13,  67,  106,   31,  211,  277,   58,  436,  529,   94
   7,  12,  67,  25,  191,   80,  379,   59,  631,  212,  947,  109
  11,  46, 106, 191,   41,  436,  596,  781,  991,   96, 1486, 1771
  16,  23,  31,  80,  436,   61,  862,  302,  193,  467, 2146,  142
  22,  92, 211, 379,  596,  862,   85, 1541, 1954, 2416, 2927, 3487
  29,  38, 277,  59,  781,  302, 1541,  113, 2557,  822, 3829,  355
  37, 154,  58, 631,  991,  193, 1954, 2557,  145, 4006, 4852,  706
  46,  57, 436, 212,   96,  467, 2416,  822, 4006,  181, 5996, 1832
  56, 232, 529, 947, 1486, 2146, 2927, 3829, 4852, 5996,  221, 8647
  67,  80,  94, 109, 1771,  142, 3487,  355,  706, 1832, 8647,  265
		

Crossrefs

Cf. A000124 (row 1 and column 1), A001844 (main diagonal).

Programs

Formula

A(n,k) = T(gcd(n,k), lcm(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table, that is, as a pairing function from N x N to N.
A(n,k) = A(k,n), or equivalently, a(A038722(n)) = a(n). [Array is symmetric.]

A286364 Compound filter: a(n) = P(A286361(n), A286363(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 2, 1, 7, 3, 2, 2, 3, 2, 5, 1, 3, 7, 2, 3, 16, 2, 2, 2, 10, 3, 29, 2, 3, 5, 2, 1, 16, 3, 5, 7, 3, 2, 5, 3, 3, 16, 2, 2, 12, 2, 2, 2, 7, 10, 5, 3, 3, 29, 5, 2, 16, 3, 2, 5, 3, 2, 67, 1, 21, 16, 2, 3, 16, 5, 2, 7, 3, 3, 14, 2, 16, 5, 2, 3, 121, 3, 2, 16, 21, 2, 5, 2, 3, 12, 5, 2, 16, 2, 5, 2, 3, 7, 67, 10, 3, 5, 2, 3, 23, 3, 2, 29, 3, 5, 5, 2, 3
Offset: 1

Author

Antti Karttunen, May 08 2017

Keywords

Comments

This sequence packs the values of A286361(n) and A286363(n) to a single value with the pairing function A000027. These two components essentially give the prime signature of 4k+1 part and the prime signature of 4k+3 part, and they can be accessed from a(n) with functions A002260 and A004736. For example, A004431 lists all such numbers that the first component is larger than one and the second component is a perfect square.

Programs

  • Python
    from sympy import factorint
    from operator import mul
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def A(n, k):
        f = factorint(n)
        return 1 if n == 1 else reduce(mul, [1 if i%4==k else i**f[i] for i in f])
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def a(n): return T(a046523(n/A(n, 1)), a046523(n/A(n, 3))) # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286364 n) (* (/ 1 2) (+ (expt (+ (A286361 n) (A286363 n)) 2) (- (A286361 n)) (- (* 3 (A286363 n))) 2)))
    

Formula

a(n) = (1/2)*(2+((A286361(n)+A286363(n))^2) - A286361(n) - 3*A286363(n)).
Other identities. For all n >= 1:
a(A267099(n)) = A038722(a(n)).

A246273 Transpose of square array A246275.

Original entry on oeis.org

1, 2, 3, 4, 8, 5, 6, 24, 14, 7, 10, 48, 34, 26, 9, 12, 120, 76, 124, 20, 11, 16, 168, 142, 342, 54, 44, 13, 18, 288, 220, 1330, 90, 174, 32, 15, 22, 360, 322, 2196, 186, 538, 64, 80, 17, 28, 528, 436, 4912, 246, 1572, 118, 624, 74, 19, 30, 840, 666, 6858, 390, 2872, 208, 2400, 244, 62, 21
Offset: 1

Author

Antti Karttunen, Aug 21 2014

Keywords

Examples

			The top-left corner of the array:
   1,     2,     4,     6,    10,    12,    16,    18,    22,   ...
   3,     8,    24,    48,   120,   168,   288,   360,   528,   ...
   5,    14,    34,    76,   142,   220,   322,   436,   666,   ...
   7,    26,   124,   342,  1330,  2196,  4912,  6858, 12166,   ...
   9,    20,    54,    90,   186,   246,   390,   550,   712,   ...
  11,    44,   174,   538,  1572,  2872,  5490,  8302, 15340,   ...
  ...
		

Crossrefs

Inverse permutation: A246274.
Transpose: A246275.
Other related permutations: A038722, A054582, A246675, A246676.
One less than A246279.
Cf. A114881.

Programs

Formula

a(n) = A246279(n) - 1.
As a composition of related permutations:
a(n) = A246275(A038722(n)).
a(n) = A246676(A054582(n-1)).

A286102 Square array A(n,k) read by antidiagonals: A(n,k) = T(lcm(n,k), gcd(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table.

Original entry on oeis.org

1, 3, 3, 6, 5, 6, 10, 21, 21, 10, 15, 14, 13, 14, 15, 21, 55, 78, 78, 55, 21, 28, 27, 120, 25, 120, 27, 28, 36, 105, 34, 210, 210, 34, 105, 36, 45, 44, 231, 90, 41, 90, 231, 44, 45, 55, 171, 300, 406, 465, 465, 406, 300, 171, 55, 66, 65, 64, 63, 630, 61, 630, 63, 64, 65, 66, 78, 253, 465, 666, 820, 903, 903, 820, 666, 465, 253, 78, 91, 90, 561, 230, 1035, 324, 85, 324, 1035, 230, 561, 90, 91
Offset: 1

Author

Antti Karttunen, May 03 2017

Keywords

Comments

The array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Examples

			The top left 12 X 12 corner of the array:
   1,   3,   6,  10,   15,   21,   28,   36,   45,   55,   66,   78
   3,   5,  21,  14,   55,   27,  105,   44,  171,   65,  253,   90
   6,  21,  13,  78,  120,   34,  231,  300,   64,  465,  561,  103
  10,  14,  78,  25,  210,   90,  406,   63,  666,  230,  990,  117
  15,  55, 120, 210,   41,  465,  630,  820, 1035,  101, 1540, 1830
  21,  27,  34,  90,  465,   61,  903,  324,  208,  495, 2211,  148
  28, 105, 231, 406,  630,  903,   85, 1596, 2016, 2485, 3003, 3570
  36,  44, 300,  63,  820,  324, 1596,  113, 2628,  860, 3916,  375
  45, 171,  64, 666, 1035,  208, 2016, 2628,  145, 4095, 4950,  739
  55,  65, 465, 230,  101,  495, 2485,  860, 4095,  181, 6105, 1890
  66, 253, 561, 990, 1540, 2211, 3003, 3916, 4950, 6105,  221, 8778
  78,  90, 103, 117, 1830,  148, 3570,  375,  739, 1890, 8778,  265
		

Crossrefs

Cf. A000217 (row 1 and column 1), A001844 (main diagonal).

Programs

Formula

A(n,k) = T(lcm(n,k), gcd(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table, that is, as a pairing function from N x N to N.
A(n,k) = A(k,n), or equivalently, a(A038722(n)) = a(n). [Array is symmetric.]
Previous Showing 11-20 of 32 results. Next