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.

A343751 A(n,k) is the sum of all compositions [c_1, c_2, ..., c_k] of n into k nonnegative parts encoded as Product_{i=1..k} prime(i)^(c_i); square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 1, 5, 4, 0, 1, 10, 19, 8, 0, 1, 17, 69, 65, 16, 0, 1, 28, 188, 410, 211, 32, 0, 1, 41, 496, 1726, 2261, 665, 64, 0, 1, 58, 1029, 7182, 14343, 11970, 2059, 128, 0, 1, 77, 2015, 20559, 93345, 112371, 61909, 6305, 256, 0, 1, 100, 3478, 54814, 360612, 1139166, 848506, 315850, 19171, 512, 0
Offset: 0

Views

Author

Alois P. Heinz, Apr 27 2021

Keywords

Examples

			A(1,3) = 10 = 5 + 3 + 2, sum of encoded compositions [0,0,1], [0,1,0], [1,0,0].
A(4,2) = 211 = 81 + 54 + 36 + 24 + 16, sum of encoded compositions [0,4], [1,3], [2,2], [3,1], [4,0].
Square array A(n,k) begins:
  1,  1,    1,     1,      1,        1,        1, ...
  0,  2,    5,    10,     17,       28,       41, ...
  0,  4,   19,    69,    188,      496,     1029, ...
  0,  8,   65,   410,   1726,     7182,    20559, ...
  0, 16,  211,  2261,  14343,    93345,   360612, ...
  0, 32,  665, 11970, 112371,  1139166,  5827122, ...
  0, 64, 2059, 61909, 848506, 13379332, 89131918, ...
		

Crossrefs

Columns k=0-4 give: A000007, A000079, A001047(n+1), A016273, A025931.
Rows n=0-2 give: A000012, A007504, A357251.
Main diagonal gives A332967.

Programs

  • Maple
    A:= proc(n, k) option remember; `if`(n=0, 1,
         `if`(k=0, 0, add(ithprime(k)^i*A(n-i, k-1), i=0..n)))
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..10);
    # second Maple program:
    A:= proc(n, k) option remember; `if`(n=0, 1,
         `if`(k=0, 0, ithprime(k)*A(n-1, k)+A(n, k-1)))
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..10);
  • Mathematica
    A[n_, k_] := A[n, k] = If[n == 0, 1,
         If[k == 0, 0, Prime[k] A[n-1, k] + A[n, k-1]]];
    Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Nov 06 2021, after 2nd Maple program *)

Formula

A(n,k) = [x^n] Product_{i=1..k} 1/(1-prime(i)*x).
A(n,k) = A124960(n+k,k) for k >= 1.

A124960 Triangle read by rows: T(n,k) = p(k)*T(n-1,k) + T(n-1,k-1) (1 <= k <= n), where p(k) denotes the k-th prime.

Original entry on oeis.org

1, 2, 1, 4, 5, 1, 8, 19, 10, 1, 16, 65, 69, 17, 1, 32, 211, 410, 188, 28, 1, 64, 665, 2261, 1726, 496, 41, 1, 128, 2059, 11970, 14343, 7182, 1029, 58, 1, 256, 6305, 61909, 112371, 93345, 20559, 2015, 77, 1, 512, 19171, 315850, 848506, 1139166, 360612, 54814, 3478, 100, 1
Offset: 1

Views

Author

Gary W. Adamson, Nov 13 2006

Keywords

Examples

			Triangle starts:
   1;
   2,   1;
   4,   5,   1;
   8,  19,  10,   1;
  16,  65,  69,  17,  1;
  32, 211, 410, 188, 28, 1;
		

Crossrefs

T(2n,n) gives A332967 (for n>0).

Programs

  • Magma
    function T(n,k)
      if k lt 1 or k gt n then return 0;
      elif n eq 1 and k eq 1 then return 1;
      else return NthPrime(k)*T(n-1,k) + T(n-1,k-1);
      end if;
      return T;
    end function;
    [T(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Nov 19 2019
    
  • Maple
    T:=proc(n,k): if n=1 and k=1 then 1 elif k<1 or k>n then 0 else ithprime(k)*T(n-1,k)+T(n-1,k-1) fi end: for n from 1 to 11 do seq(T(n,k),k=1..n) od; # yields sequence in triangular form
  • Mathematica
    T[n_, k_]:= T[n, k]= If[n==1 && k==1 , 1, If[k<1 || k>n, 0, Prime[k]*T[n-1, k] + T[n-1, k-1] ]]; Table[T[n, k], {n,12}, {k, n}]//Flatten (* G. C. Greubel, Nov 19 2019 *)
  • PARI
    T(n,k) = if(n==1 && k==1, 1, if(k<1 || k>n, 0, prime(k)*T(n-1, k) + T(n-1, k-1) )); \\ G. C. Greubel, Nov 19 2019
    
  • Sage
    @CachedFunction
    def T(n,k):
        if (k<1 or k>n): return 0
        elif (n==1 and k==1): return 1
        else: return nth_prime(k)*T(n-1, k) + T(n-1, k-1)
    [[T(n,k) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Nov 19 2019

Extensions

Edited by N. J. A. Sloane, Nov 29 2006

A330394 Irregular triangle T(n,k) read by rows in which n-th row lists in increasing order all integers m such that Omega(m) = n and each prime factor p of m has index pi(p) <= n.

Original entry on oeis.org

1, 2, 4, 6, 9, 8, 12, 18, 20, 27, 30, 45, 50, 75, 125, 16, 24, 36, 40, 54, 56, 60, 81, 84, 90, 100, 126, 135, 140, 150, 189, 196, 210, 225, 250, 294, 315, 350, 375, 441, 490, 525, 625, 686, 735, 875, 1029, 1225, 1715, 2401, 32, 48, 72, 80, 108, 112, 120, 162
Offset: 0

Views

Author

Robert Price, Mar 03 2020

Keywords

Comments

Positive integers not in T are: 3, 5, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 25, 26, 28, 29, ... .
Row n has exactly one squarefree member: primorial(n) = A002110(n).
Sorting all terms (except 1) gives A324521.

Examples

			Triangle T(n,k) begins:
  1;
  2;
  4,  6,  9;
  8, 12, 18, 20, 27, 30, 45, 50, 75, 125;
  ...
		

Crossrefs

Column k=1 gives A000079.
Last elements of rows give A307539.
Row lengths give A088218.
Row sums give A332967(n) = A124960(2n,n).
T(n,n) gives A101695(n) for n > 0.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, [1], [seq(
          map(x-> x*ithprime(j), b(n-1, j))[], j=1..i)])
        end:
    T:= n-> sort(b(n$2))[]:
    seq(T(n), n=0..5);  # Alois P. Heinz, Mar 03 2020
  • Mathematica
    t = Table[Union[Apply[Times, Tuples[Prime[Range[n]], {n}], {1}]], {n, 0, 5}];
    t // TableForm
    Flatten[t]
Showing 1-3 of 3 results.