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

A127367 Inverse permutation to A127366.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Let m be the largest number such that n >= m(m+1). If n is even, a(n) = n - m; otherwise a(n) = n + m + 1.
a(A005408(n)) > 0; a(A005843(n)) <= 0. [Reinhard Zumkeller, Oct 12 2011]

Crossrefs

Cf. A002378 (oblong numbers).

Programs

  • Haskell
    a127367 n | even n    = n - m + 1
              | otherwise = n + m
              where m = length $ takeWhile (<= n) a002378_list
    -- Reinhard Zumkeller, Oct 12 2011

A195437 Triangle formed by: 1 even, 2 odd, 3 even, 4 odd... starting with 2.

Original entry on oeis.org

2, 5, 7, 10, 12, 14, 17, 19, 21, 23, 26, 28, 30, 32, 34, 37, 39, 41, 43, 45, 47, 50, 52, 54, 56, 58, 60, 62, 65, 67, 69, 71, 73, 75, 77, 79, 82, 84, 86, 88, 90, 92, 94, 96, 98, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 122, 124, 126, 128, 130, 132
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 12 2011

Keywords

Comments

A127366(T(n,k)) mod 2 = 1;
T(n,k) mod 2 + A000196(T(n,k)) mod 2 = 1;
complement of A133280.

Crossrefs

Cf. A002522 (left edge), A008865 (right edge), A011379 (row sums), A002939 (central terms).

Programs

  • Haskell
    a195437 n k = a195437_tabl !! n !! k
    a195437_tabl = tail $ g 1 1 [0..] where
       g m j xs = (filter ((== m) . (`mod` 2)) ys) : g (1 - m) (j + 2) xs'
         where (ys,xs') = splitAt j xs
    b195437 = bFile' "A195437" (concat $ take 101 a195437_tabl) 0
    -- Reinhard Zumkeller, Nov 23 2011 (fixed), Oct 12 2011
  • Mathematica
    p[n_,k_]:=NestList[#+2&,n,k-1]; Module[{nn=6,ev,od},ev=p@@@Partition[Riffle[Table[ 4n^2-4n+2,{n,nn}],Range[ 1,2nn,2]],2];od=p@@@Partition[Riffle[Table[4n^2+1,{n,nn}],Range[ 2,2nn+1,2]],2];Sort[Flatten[Join[ev,od]]]] (* Harvey P. Dale, Aug 27 2023 *)

A133280 Triangle formed by: 1 even, 2 odd, 3 even, 4 odd, ... starting with zero.

Original entry on oeis.org

0, 1, 3, 4, 6, 8, 9, 11, 13, 15, 16, 18, 20, 22, 24, 25, 27, 29, 31, 33, 35, 36, 38, 40, 42, 44, 46, 48, 49, 51, 53, 55, 57, 59, 61, 63, 64, 66, 68, 70, 72, 74, 76, 78, 80, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120
Offset: 0

Views

Author

Omar E. Pol, Aug 27 2008

Keywords

Comments

This sequence is related to the Connell sequence (A001614).
First member of every row is a square (A000290).
A127366(T(n,k)) mod 2 = 0 or equal parity of T(n,k) and A000196(T(n,k)); complement of A195437. - Reinhard Zumkeller, Oct 12 2011
Written as a square array the main diagonal gives A002943. - Omar E. Pol, Aug 13 2013
Last member of every row is one less than a square (A005563). - Harvey P. Dale, Oct 02 2013

Examples

			Written as a triangle the sequence begins:
    0;
    1,   3;
    4,   6,   8;
    9,  11,  13,  15;
   16,  18,  20,  22,  24;
   25,  27,  29,  31,  33,  35;
   36,  38,  40,  42,  44,  46,  48;
   49,  51,  53,  55,  57,  59,  61,  63;
   64,  66,  68,  70,  72,  74,  76,  78,  80;
   81,  83,  85,  87,  89,  91,  93,  95,  97,  99;
  100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120;
		

Crossrefs

Column 1 is A000290. Right border gives A005563.
Cf. A001614.
Cf. A045991 (row sums). - R. J. Mathar, Jul 20 2009

Programs

  • Haskell
    a133280 n k = a133280_tabl !! n !! k
    a133280_tabl = f 0 1 [0..] where
       f m j xs = (filter ((== m) . (`mod` 2)) ys) : f (1 - m) (j + 2) xs'
         where (ys,xs') = splitAt j xs
    b133280 = bFile' "A133280" (concat $ take 101 a133280_tabl) 0
    -- Reinhard Zumkeller, Oct 12 2011
    
  • Mathematica
    Flatten[Table[Range[(n-1)^2,n^2-1,2],{n,20}]] (* Harvey P. Dale, Oct 02 2013 *)
  • PARI
    T(n,k) = n^2 + 2*k;
    for(n=0,10,for(k=0,n,print1(T(n,k),", "))); \\ Joerg Arndt, Aug 13 2013
    
  • Python
    from math import isqrt
    def A133280(n): return (m:=(n<<1)+1)-((isqrt(m+1<<2)+1)>>1) # Chai Wah Wu, Aug 01 2022

Formula

a(n) = A005408(n) - A002024(n+1). - Ivan N. Ianakiev, Aug 13 2013
T(n,k) = n^2 + 2*k. - Joerg Arndt, Aug 13 2013
Showing 1-3 of 3 results.