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.

A097586 Table T(n,n) read by rows: T(1,1)=0; then if n even T(n,1)=T(n-1,1)+2 and if n odd T(n,1)=T(n-2,1)+T(n-1,1)-1 then T(n,j)=T(n,j-1) + 2^floor((n+1)/2).

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 3, 11, 19, 27, 35, 43, 51, 59, 67, 75, 5, 13, 21, 29, 37, 45, 53, 61, 69, 77, 7, 23, 39, 55, 71, 87, 103, 119, 135, 151, 9, 25, 41, 57, 73
Offset: 1

Views

Author

Pierre CAMI, Sep 20 2004

Keywords

Comments

Integers > 1 appear exactly twice, 0 and 1 only once. Consecutive primes with gap 4 are consecutive in rows 3 or 4
The sequence contains the first 10 elements of row n=1, then the first 10 elements of row n=2, then the first 10 elements of row n=3 etc. The array is not read in full, not by diagonals and not as a lower or upper triangle. - R. J. Mathar, May 01 2024

Examples

			    0     2     4     6     8    10    12    14    16    18
    2     4     6     8    10    12    14    16    18    20
    1     5     9    13    17    21    25    29    33    37
    3     7    11    15    19    23    27    31    35    39
    3    11    19    27    35    43    51    59    67    75
    5    13    21    29    37    45    53    61    69    77
    7    23    39    55    71    87   103   119   135   151
    9    25    41    57    73    89   105   121   137   153
   15    47    79   111   143   175   207   239   271   303
   17    49    81   113   145   177   209   241   273   305
   31    95   159   223   287   351   415   479   543   607
   33    97   161   225   289   353   417   481   545   609
   63   191   319   447   575   703   831   959  1087  1215
   65   193   321   449   577   705   833   961  1089  1217
  127   383   639   895  1151  1407  1663  1919  2175  2431
  129   385   641   897  1153  1409  1665  1921  2177  2433
  255   767  1279  1791  2303  2815  3327  3839  4351  4863
  257   769  1281  1793  2305  2817  3329  3841  4353  4865
		

Programs

  • Maple
    A097586 := proc(n,k)
        if n < 1 then
            0 ;
        elif k < 1 then
            0 ;
        elif k = 1 then
            if n = 1 then
                0;
            elif type(n,'even') then
                procname(n-1,1)+2 ;
            else
                procname(n-2,1)+procname(n-1,1)-1 ;
            end if;
        else
            procname(n,k-1)+2^floor((n+1)/2) ;
        end if;
    end proc:
    for n from 1 to 18 do
    for k from 1 to 10 do
        printf("%5d ",A097586(n,k)) ;
    end do:
    printf("\n") ;
    end do: # R. J. Mathar, May 01 2024

Formula

T(n,j) = j*2^((n + n mod 2)/2) - 2^((n - 1 - (n + 1) mod 2)/2) + (-1)^(n mod 2). - Ctibor O. Zizka, Aug 11 2025