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-10 of 23 results. Next

A157424 Triangle read by rows, A157423 * (A052284 * 0^(n-k)).

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 3, 0, 1, 0, 1, 0, 0, 5, 1, 0, 1, 0, 1, 0, 0, 7, 1, 1, 0, 1, 0, 3, 0, 0, 11, 1, 1, 1, 0, 2, 0, 5, 0, 0, 0, 17, 0, 1, 1, 1, 0, 3, 0, 7, 0, 0, 27, 1, 0, 1, 1, 2, 0, 5, 0, 11, 0, 0, 40
Offset: 1

Views

Author

Gary W. Adamson & Mats Granvik, Feb 28 2009

Keywords

Comments

Row sums = A052284 starting at n=1: (1, 1, 1, 2, 3, 5, 7, 11, 17,...). As a property of eigentriangles, sum of n-th row terms = rightmost term of next row.

Examples

			First few rows of the triangle =
1;
0, 1;
0, 0, 1;
1, 0, 0, 1;
0, 1, 0, 0, 2;
1, 0, 1, 0, 0, 3;
0, 1, 0, 1, 0, 0, 5;
1, 0, 1, 0, 2, 0, 0, 7;
1, 1, 0, 1, 0, 3, 0, 0, 11;
1, 1, 1, 0, 2, 0, 5,0, 0, 17;
0, 1, 1, 1, 0, 3, 0, 7, 0, 0, 27;
1, 0, 1, 1, 2, 0, 5, 0, 11, 0, 0, 40;
0, 1, 0, 1, 2, 3, 0, 7, 0, 17, 0, 0, 61;
1, 0, 1, 0, 2, 3, 5, 0, 11, 0, 27, 0, 0, 92;
...
Example: row 5 = (0, 1, 0, 0, 2) = termwise products of (0, 1, 0, 0, 1) and
(1, 1, 1, 1, 2); where (0, 1, 0, 0, 2) = row 5 of triangle A157423 and
(1, 1, 1, 1, 2) = the first 5 terms of A052284.
		

Crossrefs

Formula

Triangle read by rows, A157423 * (A052284 * 0^(n-k)). A157423 = an infinite lower triangular matrix with A005171 in every column. (A052284 * 0^(n-k)) = an infinite lower triangular matrix with A052284: (1, 1, 1, 1, 2, 3, 5, 7, 11, 17, 27,...) as the main diagonal and the rest zeros.

A005171 Characteristic function of nonprimes: 0 if n is prime, else 1.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Number of orbits of length n in map whose periodic points are A023890. - Thomas Ward
Characteristic function of nonprimes A018252. - Jonathan Vos Post, Dec 30 2007
Triangle A157423 = A005171 in every column. A052284 = INVERT transform of A005171, and the eigensequence of triangle A157423. - Gary W. Adamson, Feb 28 2009

References

  • Douglas Hofstadter, Fluid Concepts and Creative Analogies: Computer Models of the Fundamental Mechanisms of Thought.

Crossrefs

Programs

  • Haskell
    a005171 = (1 -) . a010051  -- Reinhard Zumkeller, Mar 30 2014
    
  • Maple
    A005171 := proc(n)
        if isprime(n) then
            0 ;
        else
            1 ;
        end if;
    end proc: # R. J. Mathar, May 26 2017
  • Mathematica
    a[n_] := If[PrimeQ@ n, 0, 1]; Array[a, 105] (* Robert G. Wilson v, Jun 20 2011 *)
    nn = 105; t[n_, k_] :=  t[n, k] = If[n == k, 1, If[k == 1, 1 - Product[t[n, k + i], {i, 1, n - 1}], If[Mod[n, k] == 0, t[n/k, 1], 1], 1]]; Table[t[n, 1], {n, 1, nn}] (* Mats Granvik, Sep 21 2013 *)
  • PARI
    a(n)=if(n<1, 0, !isprime(n)) /* Michael Somos, Jun 08 2005 */
    
  • Python
    from sympy import isprime
    def a(n): return int(not isprime(n))
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Oct 28 2021

Formula

a(n) = (1/n)* Sum_{ d divides n } mu(d)*A023890(n/d). E.g., a(6) = 1 since the 6th term of A023890 is 7 and the first term is 1. [edited by Michel Marcus, Dec 14 2023]
a(n) = 1 - A010051(n). - Jonathan Vos Post, Dec 30 2007
a(n) equals the first column in a table T defined by the recurrence: If n = k then T(n,k) = 1 else if k = 1 then T(n,k) = 1 - Product_{k divides n} of T(n,k), else if k divides n then T(n,k) = T(n/k,1). This is true since T(n,k) = 0 when k divides n and n/k is prime which results in Product_{k divides n} = 0 for the composite numbers and where k ranges from 2 to n. Therefore there is a remaining 1 in the expression 1-Product_{k divides n}, in the first column. Provided below is a Mathematica program as an illustration. - Mats Granvik, Sep 21 2013
a(n) = A057427(A239968(n)). - Reinhard Zumkeller, Mar 30 2014
a(n) = Sum_{d|n} A033273(d)*A008683(n/d). - Ridouane Oudra, Jul 03 2025

A341480 Number of ways to write n as an ordered sum of 3 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 3, 0, 3, 3, 3, 9, 4, 9, 12, 12, 15, 21, 19, 27, 30, 30, 39, 42, 46, 54, 60, 61, 75, 72, 91, 90, 108, 99, 129, 123, 142, 147, 168, 156, 201, 180, 217, 213, 246, 235, 279, 255, 304, 297, 336, 327, 375, 342, 412, 390, 447, 423, 492, 453, 529, 507, 573, 538, 630, 579
Offset: 3

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 3):
    seq(a(n), n=3..65);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 65; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^3, {x, 0, nmax}], x] // Drop[#, 3] &

Formula

G.f. g(x)^3 where g(x) is the G.f. of A005171.

A341481 Number of ways to write n as an ordered sum of 4 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 4, 0, 4, 6, 4, 16, 8, 18, 28, 25, 40, 50, 56, 76, 92, 98, 136, 147, 176, 212, 240, 272, 328, 352, 420, 471, 524, 592, 668, 747, 808, 938, 996, 1127, 1232, 1354, 1456, 1658, 1720, 1966, 2052, 2279, 2408, 2700, 2772, 3144, 3232, 3568, 3740, 4117, 4228, 4722
Offset: 4

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 4):
    seq(a(n), n=4..58);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 58; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^4, {x, 0, nmax}], x] // Drop[#, 4] &

Formula

G.f. g(x)^4, where g(x) is the G.f. of A005171.

A341482 Number of ways to write n as an ordered sum of 5 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 5, 0, 5, 10, 5, 25, 15, 30, 55, 45, 85, 105, 126, 180, 220, 260, 360, 415, 510, 650, 745, 915, 1101, 1270, 1525, 1800, 2045, 2440, 2780, 3225, 3660, 4250, 4771, 5465, 6185, 6930, 7840, 8816, 9790, 11015, 12240, 13505, 15146, 16595, 18385, 20240, 22325, 24255
Offset: 5

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 5):
    seq(a(n), n=5..55);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 55; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^5, {x, 0, nmax}], x] // Drop[#, 5] &

A341483 Number of ways to write n as an ordered sum of 6 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 6, 0, 6, 15, 6, 36, 26, 45, 96, 75, 156, 201, 242, 375, 456, 586, 816, 987, 1256, 1656, 1962, 2512, 3102, 3717, 4616, 5577, 6612, 8067, 9516, 11283, 13372, 15678, 18378, 21412, 24966, 28719, 33388, 38244, 43872, 50248, 57288, 64914, 74074, 83328, 94248
Offset: 6

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 6):
    seq(a(n), n=6..53);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 53; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^6, {x, 0, nmax}], x] // Drop[#, 6] &

A341484 Number of ways to write n as an ordered sum of 7 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 7, 0, 7, 21, 7, 49, 42, 63, 154, 119, 259, 357, 420, 707, 861, 1169, 1666, 2072, 2752, 3703, 4557, 5999, 7637, 9422, 12089, 14931, 18354, 22904, 27825, 33866, 41328, 49539, 59753, 71386, 85071, 100800, 119455, 140448, 164794, 193179, 224826, 261464, 303422
Offset: 7

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 7):
    seq(a(n), n=7..52);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 52; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^7, {x, 0, nmax}], x] // Drop[#, 7] &

A341485 Number of ways to write n as an ordered sum of 8 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 8, 0, 8, 28, 8, 64, 64, 84, 232, 182, 400, 596, 680, 1232, 1520, 2128, 3144, 3970, 5504, 7532, 9584, 12945, 16920, 21464, 28288, 35778, 45264, 57856, 72024, 90036, 112456, 138140, 170600, 208874, 254192, 309088, 373584, 449731, 539408, 645584, 767776
Offset: 8

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 8):
    seq(a(n), n=8..51);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 51; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^8, {x, 0, nmax}], x] // Drop[#, 8] &

A341486 Number of ways to write n as an ordered sum of 9 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 9, 0, 9, 36, 9, 81, 93, 108, 333, 270, 585, 945, 1047, 2016, 2547, 3612, 5571, 7101, 10227, 14256, 18621, 25830, 34497, 44955, 60610, 78480, 101754, 133092, 169380, 217008, 276852, 347967, 439272, 549786, 683244, 849528, 1047678, 1288017, 1577934
Offset: 9

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 9):
    seq(a(n), n=9..50);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 50; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^9, {x, 0, nmax}], x] // Drop[#, 9] &

A224344 Number T(n,k) of compositions of n using exactly k primes (counted with multiplicity); triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 2, 5, 1, 3, 8, 5, 5, 13, 13, 1, 7, 23, 27, 7, 11, 39, 52, 25, 1, 17, 65, 99, 66, 9, 27, 106, 186, 151, 41, 1, 40, 177, 340, 323, 133, 11, 61, 293, 608, 666, 358, 61, 1, 92, 482, 1076, 1330, 867, 236, 13, 142, 781, 1894, 2581, 1971, 737, 85, 1
Offset: 0

Views

Author

Alois P. Heinz, May 23 2013

Keywords

Examples

			A(5,1) = 8: [2,1,1,1], [1,2,1,1], [1,1,2,1], [1,1,1,2], [3,1,1], [1,3,1], [1,1,3], [5].
Triangle T(n,k) begins:
   1;
   1;
   1,   1;
   1,   3;
   2,   5,   1;
   3,   8,   5;
   5,  13,  13,   1;
   7,  23,  27,   7;
  11,  39,  52,  25,   1;
  17,  65,  99,  66,   9;
  27, 106, 186, 151,  41,  1;
  40, 177, 340, 323, 133, 11;
  ...
		

Crossrefs

Column k=0 gives: A052284.
Row sums are: A011782.
Row lengths are: A008619.
T(floor(n/2)) = A093178(n).
T(2n,n-1) = A001844(n-1) for n>0.

Programs

  • Maple
    T:= proc(n) option remember; local j; if n=0 then 1
          else []; for j to n do zip((x, y)->x+y, %,
          [`if`(isprime(j), 0, NULL), T(n-j)], 0) od; %[] fi
        end:
    seq(T(n), n=0..16);
  • Mathematica
    zip[f_, x_List, y_List, z_] :=  With[{m = Max[Length[x], Length[y]]},  Thread[f[PadRight[x, m, z], PadRight[y, m, z]]]]; T[n_] := T[n] =  Module[{j, pc}, If[n == 0, {1}, pc = {}; For[j = 1, j <= n, j++, pc = zip[Plus, pc, Join[If[PrimeQ[j], {0}, {}], T[n-j]], 0]]; pc]]; Table[T[n], {n, 0, 16}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)

Formula

Sum_{k=1..floor(n/2)} k * T(n,k) = A102291(n).
Showing 1-10 of 23 results. Next