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

A376468 Triangle T read by rows: T(n, k) = (n^2 - 2*n + 3 - (-1)^n + n^2 mod 8) / 2 + 4*k.

Original entry on oeis.org

1, 2, 6, 3, 7, 11, 4, 8, 12, 16, 5, 9, 13, 17, 21, 10, 14, 18, 22, 26, 30, 15, 19, 23, 27, 31, 35, 39, 20, 24, 28, 32, 36, 40, 44, 48, 25, 29, 33, 37, 41, 45, 49, 53, 57, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96
Offset: 0

Views

Author

Werner Schulte, Sep 23 2024

Keywords

Comments

This triangle seen as a sequence yields a permutation of the natural numbers. For similar triangles see A000027 (seen as a triangle), A074147, and A367844 (row reversed).

Examples

			Triangle T(n, k) for 0 <= k <= n starts:
n \k :   0   1   2   3   4   5   6   7   8   9  10  11
======================================================
   0 :   1
   1 :   2   6
   2 :   3   7  11
   3 :   4   8  12  16
   4 :   5   9  13  17  21
   5 :  10  14  18  22  26  30
   6 :  15  19  23  27  31  35  39
   7 :  20  24  28  32  36  40  44  48
   8 :  25  29  33  37  41  45  49  53  57
   9 :  34  38  42  46  50  54  58  62  66  70
  10 :  43  47  51  55  59  63  67  71  75  79  83
  11 :  52  56  60  64  68  72  76  80  84  88  92  96
  etc.
		

Crossrefs

Programs

  • Mathematica
    Table[Range[#, #+n*4, 4] & [(Mod[n^2, 8] + n*(n-2) - (-1)^n + 3)/2], {n, 0, 15}] (* Paolo Xausa, Nov 13 2024 *)
  • PARI
    T(n,k)=(n^2-2*n+3-(-1)^n+n^2%8)/2+4*k
    
  • Python
    from math import comb, isqrt
    def A376468(n): return ((a:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)))*(a-2)+3+(1 if a&1 else -1)+(a**2&7)>>1)+(n-comb(a+1,2)<<2) # Chai Wah Wu, Nov 12 2024

Formula

T(n, k) = T(n, k-1) + 4.
T(n+4, 0) = T(n, n) + 4 for n > 3.
T(2*n, n) = 2 * (n^2 + n + 1) - (-1)^n = A001844(n) + 1 - (-1)^n.
Showing 1-1 of 1 results.