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

A227418 Array A(n,k) with all numbers m such that 3*m^2 +- 3^k is a square and their corresponding square roots, read by downward antidiagonals.

Original entry on oeis.org

0, 1, 1, 0, 2, 4, 3, 3, 7, 15, 0, 6, 12, 26, 56, 9, 9, 21, 45, 97, 209, 0, 18, 36, 78, 168, 362, 780, 27, 27, 63, 135, 291, 627, 1351, 2911, 0, 54, 108, 234, 504, 1086, 2340, 5042, 10864, 81, 81, 189, 405, 873, 1881, 4053, 8733, 18817, 40545
Offset: 0

Views

Author

Richard R. Forberg, Sep 02 2013

Keywords

Comments

Array is analogous to A228405 in goal and structure, with key differences.
Left column is A001353. Top row (not in OEIS) interleaves 0 with the powers of 3, as: 0, 1, 0, 3, 0, 9, 0, 27, 0, 81.
Either or both may be used as initializing values. See Formula section.
The left column is the second binomial transform of the top row. The intermediate transform sequence is A002605, not present in this array.
The columns of the array hold all values, in sequential order, of numbers m such that 3*m^2 + 3^k or 3*m^2 - 3^k are squares, and their corresponding square roots in the next column, which then form the "next round" of m values for column k+1.
For example: A(n,0) are numbers such that 3*m^2 + 1 are squares, the integer square roots of each are in A(n,1), which are then numbers m such that 3*m^2 - 3 are squares, with those square roots in A(n,2), etc. The sign alternates for each increment of k, etc. No integer square roots exist for the opposite sign in a given column, regardless of n.
Also, A(n,1) are values of m such that floor(m^2/3) is square, with the corresponding square roots given by A(n,0).
A(n,k)/A(n,k-2) = 3; A(n,k)/A(n,k-1) converges to sqrt(3) for large n.
A(n,k)/A(n-1,k) converges to 2 + sqrt(3) for large n.
Several ways of combining the first few columns give OEIS sequences:
A(n,0) + A(n,1) = A001835; A(n,1) + A(n,2)= A001834; A(n,2) + A(n,3) = A082841;
A(n,0)*A(n,1)/2 = A007655(n); A(n+2,0)*A(n+1,1) = A001922(n);
A(n,0)*A(n+1,1) = A001921(n); A(n,0)^2 + A(n,1)^2 = A103974(n);
A(n,1)^2 - A(n,0)^2 = A011922(n); (A(n+2,0)^2 + A(n+1,1)^2)/2 = A122770(n) = 2*A011916(n).
The main diagonal (without initial 0) = 2*A090018. The first subdiagonal = abs(A099842). First superdiagonal = A141041.
A001353 (in left column) are the only initializing set of numbers where the recursive square root equation (see below) produces exclusively integer values, for all iterations of k. For any other initial values only even iterations (at k = 2, 4, ...) produce integers.

Examples

			The array, A(n, k), begins as:
    0,    1,    0,    3,    0,     9,     0,    27, ... see A000244;
    1,    2,    3,    6,    9,    18,    27,    54, ... A038754;
    4,    7,   12,   21,   36,    63,   108,   189, ... A228879;
   15,   26,   45,   78,  135,   234,   405,   702, ...
   56,   97,  168,  291,  504,   873,  1512,  2619, ...
  209,  362,  627, 1086, 1881,  3258,  5643,  9774, ...
  780, 1351, 2340, 4053, 7020, 12159, 21060, 36477, ...
Antidiagonal triangle, T(n, k), begins as:
   0;
   1,  1;
   0,  2,   4;
   3,  3,   7,  15;
   0,  6,  12,  26,  56;
   9,  9,  21,  45,  97,  209;
   0, 18,  36,  78, 168,  362,  780;
  27, 27,  63, 135, 291,  627, 1351, 2911;
   0, 54, 108, 234, 504, 1086, 2340, 5042, 10864;
  81, 81, 189, 405, 873, 1881, 4053, 8733, 18817, 40545;
		

Crossrefs

Programs

  • Magma
    function A(n,k)
      if k lt 0 then return 0;
      elif n eq 0 then return Round((1/2)*(1-(-1)^k)*3^((k-1)/2));
      elif k eq 0 then return Evaluate(ChebyshevSecond(n), 2);
      else return 2*A(n, k-1) - A(n-1, k-1);
      end if; return A;
    end function;
    A227418:= func< n,k | A(k, n-k) >;
    [A227418(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Oct 09 2022
    
  • Mathematica
    A[n_, k_]:= If[k<0, 0, If[k==0, ChebyshevU[n-1, 2], 2*A[n, k-1] - A[n-1, k-1]]];
    T[n_, k_]:= A[k, n-k];
    Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Oct 09 2022 *)
  • SageMath
    def A(n,k):
        if (k<0): return 0
        elif (k==0): return chebyshev_U(n-1,2)
        else: return 2*A(n, k-1) - A(n-1, k-1)
    def A227418(n, k): return A(k, n-k)
    flatten([[A227418(n,k) for k in range(n+1)] for n in range(15)]) # G. C. Greubel, Oct 09 2022

Formula

If using the left column and top row to initialize, then: A(n,k) = 2*A(n, k-1) - A(n-1, k-1).
If using only the top row to initialize, then: A(n,k) = 4*A(n-1,k) - A(n-2,k).
If using the left column to initialize, then: A(n,k) = sqrt(3*A(n,k-1) + (-3)^(k-1)), for all n, k > 0.
Other internal relationships that apply are: A(2*n-1, 2*k) = A(n,k)^2 - A(n-1,k)^2;
A(n+1,k) * A(n,k+1) - A(n+1, k+1) * A(n,k) = (-3)^k, for all n, k > 0.
A(n, 0) = A001353(n).
A(n, 1) = A001075(n).
A(n, 2) = A005320(n).
A(n, 3) = A151961(n).
A(1, k) = A038754(k).
A(n, n) = 2*A090018(n), for n > 0 (main diagonal).
A(n, n+1) = A141041(n-1) (superdiagonal).
A(n+1, n) = abs(A099842(n)) (subdiagonal).
From G. C. Greubel, Oct 09 2022: (Start)
T(n, 0) = (1/2)*(1-(-1)^n)*3^((n-1)/2).
T(n, 1) = A038754(n-1).
T(n, 2) = A228879(n-2).
T(2*n-1, n-1) = A141041(n-1).
T(2*n, n) = 2*A090018(n-1), n > 0.
T(n, n-4) = 3*A005320(n-4).
T(n, n-3) = 3*A001075(n-3).
T(n, n-2) = 3*A001353(n-2).
T(n, n-1) = A001075(n-1).
T(n, n) = A001353(n).
Sum_{k=0..n-1} T(n, k) = A084156(n).
Sum_{k=0..n} T(n, k) = A084156(n) + A001353(n). (End)

Extensions

Offset corrected by G. C. Greubel, Oct 09 2022

A377000 Array read by ascending antidiagonals: T(n,k) = number of n-esthetic numbers with k digits.

Original entry on oeis.org

1, 2, 1, 3, 3, 1, 4, 5, 4, 1, 5, 7, 8, 6, 1, 6, 9, 12, 13, 8, 1, 7, 11, 16, 21, 21, 12, 1, 8, 13, 20, 29, 36, 34, 16, 1, 9, 15, 24, 37, 52, 63, 55, 24, 1, 10, 17, 28, 45, 68, 94, 108, 89, 32, 1, 11, 19, 32, 53, 84, 126, 169, 189, 144, 48, 1, 12, 21, 36, 61, 100, 158, 232, 305, 324, 233, 64, 1
Offset: 2

Views

Author

Paolo Xausa, Oct 12 2024

Keywords

Comments

A number is n-esthetic if, when written in base n, adjacent digits differ by 1: see De Koninck and Doyon (2009), where T(n,k) is denoted by N_q(r).

Examples

			Array begins (cf. De Koninck and Doyon (2009), table on p. 155):
  n\k| 1   2   3   4    5    6    7    8     9    10  ...
  -------------------------------------------------------
   2 | 1,  1,  1,  1,   1,   1,   1,   1,    1,    1, ... = A000012
   3 | 2,  3,  4,  6,   8,  12,  16,  24,   32,   48, ... = A029744 (from n = 2)
   4 | 3,  5,  8, 13,  21,  34,  55,  89,  144,  233, ... = A000045 (from n = 4)
   5 | 4,  7, 12, 21,  36,  63, 108, 189,  324,  567, ... = A228879
   6 | 5,  9, 16, 29,  52,  94, 169, 305,  549,  990, ...
   7 | 6, 11, 20, 37,  68, 126, 232, 430,  792, 1468, ...
   8 | 7, 13, 24, 45,  84, 158, 296, 557, 1045, 1966, ...
   9 | 8, 15, 28, 53, 100, 190, 360, 685, 1300, 2475, ...
  10 | 9, 17, 32, 61, 116, 222, 424, 813, 1556, 2986, ... = A090994
  ...                                               \______ A152086 (main diagonal)
		

Crossrefs

Cf. A000012 (row n = 2), A029744 (row n = 3), A000045 (row n = 4), A228879 (row n = 5), A090994 (row n = 10).
Cf. A102699, A152086 (main diagonal).
Diagonal above the main diagonal appears to be A206603.

Programs

  • Mathematica
    A377000[n_, k_] := Round[2^k/(n+1)*Sum[If[m != (n+1)/2, Cos[#]^k*(Cot[#] + Csc[#])^2 & [Pi*m/(n+1)], 0], {m, 1, n, 2}]];
    Table[A377000[n-k+1, k], {n, 2, 15}, {k, n-1}]
  • Python
    from itertools import count, islice
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A377000_N(q,r,i):
        if r==1 and i==0: return 0
        if r==1: return 1
        if q==2: return r+i&1^1
        if i == 0: return A377000_N(q,r-1,1)
        if i == q-1: return A377000_N(q,r-1,q-2)
        return A377000_N(q,r-1,i-1)+A377000_N(q,r-1,i+1)
    def A377000_T(n,k): return sum(A377000_N(n,k,i) for i in range(n))
    def A377000_gen(): # generator of terms
        for n in count(2):
            for k in range(1,n):
                yield A377000_T(n-k+1,k)
    A377000_list = list(islice(A377000_gen(),100)) # Chai Wah Wu, Oct 21 2024

Formula

All of the following formulas are taken from De Koninck and Doyon (2009).
T(n,k) = 2^k/(n+1) * Sum_{m=1..n, m odd, m != (n+1)/2} cos(p)^k*(cot(p) + csc(p))^2, where p = Pi*m/(n+1).
T(n,1) = n - 1.
T(2,k) = 1.
T(3,k) = 2^((k+1)/2) if k is odd, 3*2^((k-2)/2) if k is even = A029744(k+1).
T(4,k) = A000045(k+3).
T(5,k) = 4*3^((k-1)/2) if k is odd, 7*3^((k-2)/2) if k is even = A228879(k-1).
Conjectures from Chai Wah Wu, Oct 21 2024: (Start)
Conjecture 1: For even n, T(n,k) is the number of meaningful differential operations of the k-th order on the space R^(n-1).
Conjecture 2: For each n, the row T(n,k) satisfies a linear recurrence. For example:
T(6,k) = T(6,k-1) + 2*T(6,k-2) - T(6,k-3) for k > 3 (A090990).
T(7,k) = 4*T(7,k-2) - 2*T(7,k-4) for k > 4.
T(8,k) = T(8,k-1) + 3*T(8,k-2) - 2*T(8,k-3) - T(8,k-4) for k > 4 (A090992).
T(9,k) = 5*T(9,k-2) - 5*T(9,k-4) for k > 4.
T(10,k) = T(10,k-1) + 4*T(10,k-2) - 3*T(10,k-3) - 3*T(10,k-4) + T(10,k-5) for k > 5.
T(11,k) = 6*T(11,k-2) - 9*T(11,k-4) + 2*T(11,k-6) for k > 6.
T(12,k) = T(12,k-1) + 5*T(12,k-2) - 4*T(12,k-3) - 6*T(12,k-4) + 3*T(12,k-5) + T(12,k-6) for k > 6 (A129638).
...
Note that for even n, Conjecture 1 implies Conjecture 2 due to (Malesevic, 1998).
Conjecture 3: T(n,n-2) = A182555(n-2). (End)
Showing 1-2 of 2 results.