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 16 results. Next

A095195 T(n,0) = prime(n), T(n,k) = T(n,k-1)-T(n-1,k-1), 0<=k

Original entry on oeis.org

2, 3, 1, 5, 2, 1, 7, 2, 0, -1, 11, 4, 2, 2, 3, 13, 2, -2, -4, -6, -9, 17, 4, 2, 4, 8, 14, 23, 19, 2, -2, -4, -8, -16, -30, -53, 23, 4, 2, 4, 8, 16, 32, 62, 115, 29, 6, 2, 0, -4, -12, -28, -60, -122, -237, 31, 2, -4, -6, -6, -2, 10, 38, 98, 220, 457, 37, 6, 4, 8, 14, 20, 22, 12
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 22 2004

Keywords

Comments

T(n,0)=A000040(n); T(n,1)=A001223(n-1) for n>1; T(n,2)=A036263(n-2) for n>2; T(n,n-1)=A007442(n) for n>1.
Row k of the array (not the triangle) is the k-th differences of the prime numbers. - Gus Wiseman, Jan 11 2025

Examples

			Triangle begins:
   2;
   3,  1;
   5,  2,  1;
   7,  2,  0, -1;
  11,  4,  2,  2,  3;
  13,  2, -2, -4, -6, -9;
Alternative: array form read by antidiagonals:
     2,   3,   5,   7,  11,  13,  17,  19,  23,  29,  31,...
     1,   2,   2,   4,   2,   4,   2,   4,   6,   2,   6,...
     1,   0,   2,  -2,   2,  -2,   2,   2,  -4,   4,  -2,...
    -1,   2,  -4,   4,  -4,   4,   0,  -6,   8,  -6,   0,...
     3,  -6,   8,  -8,   8,  -4,  -6,  14, -14,   6,   4,...
    -9,  14, -16,  16, -12,  -2,  20, -28,  20,  -2,  -8,...
    23, -30,  32, -28,  10,  22, -48,  48, -22,  -6,  10,..,
   -53,  62, -60,  38,  12, -70,  96, -70,  16,  16, -12,...
   115,-122,  98, -26, -82, 166,-166,  86,   0, -28,  28,...
  -237, 220,-124, -56, 248,-332, 252, -86, -28,  56, -98,...
   457,-344,  68, 304,-580, 584,-338,  58,  84,-154, 308,...
		

Crossrefs

Cf. A140119 (row sums).
Below, the inclusive primes (A008578) are 1 followed by A000040. See also A075526.
Rows of the array (columns of the triangle) begin: A000040, A001223, A036263.
Column n = 1 of the array is A007442, inclusive A030016.
The version for partition numbers is A175804, see A053445, A281425, A320590.
First position of 0 is A376678, inclusive A376855.
Absolute antidiagonal-sums are A376681, inclusive A376684.
The inclusive version is A376682.
For composite instead of prime we have A377033, see A377034-A377037.
For squarefree instead of prime we have A377038, nonsquarefree A377046.
Column n = 2 of the array is A379542.

Programs

  • Haskell
    a095195 n k = a095195_tabl !! (n-1) !! (k-1)
    a095195_row n = a095195_tabl !! (n-1)
    a095195_tabl = f a000040_list [] where
       f (p:ps) xs = ys : f ps ys where ys = scanl (-) p xs
    -- Reinhard Zumkeller, Oct 10 2013
  • Maple
    A095195A := proc(n,k) # array, k>=0, n>=0
        option remember;
        if n =0 then
            ithprime(k+1) ;
        else
            procname(n-1,k+1)-procname(n-1,k) ;
        end if;
    end proc:
    A095195 := proc(n,k) # triangle, 0<=k=1
            A095195A(k,n-k-1) ;
    end proc: # R. J. Mathar, Sep 19 2013
  • Mathematica
    T[n_, 0] := Prime[n]; T[n_, k_] /; 0 <= k < n := T[n, k] = T[n, k-1] - T[n-1, k-1]; Table[T[n, k], {n, 1, 12}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, Feb 01 2017 *)
    nn=6;
    t=Table[Differences[Prime[Range[nn]],k],{k,0,nn}];
    Table[t[[j,i-j+1]],{i,nn},{j,i}] (* Gus Wiseman, Jan 11 2025 *)

A376682 Array read by antidiagonals downward where A(n,k) is the n-th term of the k-th differences of the noncomposite numbers (A008578).

Original entry on oeis.org

1, 2, 1, 3, 1, 0, 5, 2, 1, 1, 7, 2, 0, -1, -2, 11, 4, 2, 2, 3, 5, 13, 2, -2, -4, -6, -9, -14, 17, 4, 2, 4, 8, 14, 23, 37, 19, 2, -2, -4, -8, -16, -30, -53, -90, 23, 4, 2, 4, 8, 16, 32, 62, 115, 205, 29, 6, 2, 0, -4, -12, -28, -60, -122, -237, -442, 31, 2, -4, -6, -6, -2, 10, 38, 98, 220, 457, 899
Offset: 0

Views

Author

Gus Wiseman, Oct 15 2024

Keywords

Comments

Row k is the k-th differences of the noncomposite numbers.

Examples

			Array begins:
         n=1:  n=2:  n=3:  n=4:  n=5:  n=6:  n=7:  n=8:  n=9:
  -----------------------------------------------------------
  k=0:    1     2     3     5     7    11    13    17    19
  k=1:    1     1     2     2     4     2     4     2     4
  k=2:    0     1     0     2    -2     2    -2     2     2
  k=3:    1    -1     2    -4     4    -4     4     0    -6
  k=4:   -2     3    -6     8    -8     8    -4    -6    14
  k=5:    5    -9    14   -16    16   -12    -2    20   -28
  k=6:  -14    23   -30    32   -28    10    22   -48    48
  k=7:   37   -53    62   -60    38    12   -70    96   -70
  k=8:  -90   115  -122    98   -26   -82   166  -166    86
  k=9:  205  -237   220  -124   -56   248  -332   252   -86
Triangle begins:
    1
    2    1
    3    1    0
    5    2    1    1
    7    2    0   -1   -2
   11    4    2    2    3    5
   13    2   -2   -4   -6   -9  -14
   17    4    2    4    8   14   23   37
   19    2   -2   -4   -8  -16  -30  -53  -90
   23    4    2    4    8   16   32   62  115  205
   29    6    2    0   -4  -12  -28  -60 -122 -237 -442
   31    2   -4   -6   -6   -2   10   38   98  220  457  899
		

Crossrefs

The version for modern primes (A000040) is A095195.
Initial rows: A008578, A075526, A036263 with 0 prepended.
Column n = 1 is A030016 (modern A007442).
A version for partitions is A175804, cf. A053445, A281425, A320590.
Antidiagonal-sums are A376683 (modern A140119), absolute A376684 (modern A376681).
First position of 0 is A376855 (modern A376678).
For composite instead of prime we have A377033.
For squarefree instead of prime we have A377038, nonsquarefree A377046.
For prime-power instead of composite we have A377051.
A000040 lists the primes, differences A001223, second A036263.

Programs

  • Mathematica
    nn=12;
    t=Table[Take[Differences[NestList[NestWhile[#+1&, #+1,!PrimeQ[#]&]&,1,2*nn],k],nn],{k,0,nn}]
    (* or *)
    nn=12;
    q=Table[If[n==0,1,Prime[n]],{n,0,2nn}];
    Table[Sum[(-1)^(j-k)*Binomial[j,k]*q[[i+k]],{k,0,j}],{j,0,nn},{i,nn}]

Formula

A(i,j) = Sum_{k=0..j} (-1)^(j-k) binomial(j,k) A008578(i+k).

A377047 Antidiagonal-sums of the array A377046(n,k) = n-th term of k-th differences of nonsquarefree numbers (A013929).

Original entry on oeis.org

4, 12, 7, 22, 14, 17, 39, 0, 37, 112, -337, 1103, -2570, 5868, -12201, 24670, -47528, 88283, -155910, 259140, -393399, 512341, -456546, -191155, 2396639, -8213818, 21761218, -50922953, 110269343, -225991348, 444168748, -844390064, 1561482582, -2817844477
Offset: 1

Views

Author

Gus Wiseman, Oct 19 2024

Keywords

Comments

These are the row-sums of the triangle-version of A377046.

Examples

			The third antidiagonal of A377046 is (9, 1, -3), so a(3) = 7.
		

Crossrefs

The version for primes is A140119, noncomposites A376683, composites A377034.
For squarefree instead of nonsquarefree numbers we have A377039.
The absolute value version is A377048.
For leading column we have A377049.
For first position of 0 in each row we have A377050.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers.
A013929 lists the nonsquarefree numbers, differences A078147, seconds A376593.
A073576 counts integer partitions into squarefree numbers, factorizations A050320.

Programs

  • Mathematica
    nn=20;
    t=Table[Take[Differences[NestList[NestWhile[#+1&,#+1,SquareFreeQ[#]&]&,4,2*nn],k],nn],{k,0,nn}];
    Total/@Table[t[[j,i-j+1]],{i,nn},{j,i}]

A377034 Antidiagonal-sums of the array A377033(n,k) = n-th term of the k-th differences of the composite numbers (A002808).

Original entry on oeis.org

4, 8, 10, 8, 14, 14, 11, 24, 10, 20, 37, -10, 56, 26, -52, 260, -659, 2393, -8128, 25703, -72318, 184486, -430901, 933125, -1888651, 3597261, -6479654, 11086964, -18096083, 28307672, -42644743, 62031050, -86466235, 110902085, -110907437, 52379, 483682985
Offset: 1

Views

Author

Gus Wiseman, Oct 17 2024

Keywords

Comments

Row-sums of the triangle version of A377033.

Examples

			The fourth antidiagonal of A377033 is (9, 1, -1, -1), so a(4) = 8.
		

Crossrefs

The version for prime instead of composite is A140119, noncomposite A376683.
This is the antidiagonal-sums of the array A377033, absolute version A377035.
For squarefree instead of composite we have A377039, absolute version A377040.
For nonsquarefree instead of composite we have A377047, absolute version A377048.
For prime-power instead of composite we have A377052, absolute version A377053.
Other arrays of differences: A095195 (prime), A376682 (noncomposite), A377033 (composite), A377038 (squarefree), A377046 (nonsquarefree), A377051 (prime-power).
A000040 lists the primes, differences A001223, second A036263.
A002808 lists the composite numbers, differences A073783, second A073445.
A008578 lists the noncomposites, differences A075526.
Cf. A018252, A065310, A065890, A333254, A376602 (zero), A376603 (nonzero), A376651 (positive), A376652 (negative), A376680, A377036.

Programs

  • Mathematica
    q=Select[Range[100],CompositeQ];
    t=Table[Sum[(-1)^(j-k)*Binomial[j,k]*q[[i+k]],{k,0,j}],{j,0,Length[q]/2},{i,Length[q]/2}];
    Total/@Table[t[[j,i-j+1]],{i,Length[q]/2},{j,i}]

A376681 Row sums of the absolute value of the array A095195(n, k) = n-th term of the k-th differences of the prime numbers (A000040).

Original entry on oeis.org

2, 4, 8, 10, 22, 36, 72, 134, 266, 500, 874, 1418, 2044, 2736, 4626, 15176, 41460, 95286, 196368, 372808, 660134, 1092790, 1682198, 2384724, 3147706, 4526812, 11037090, 36046768, 93563398, 214796426, 452129242, 885186658, 1619323680, 2763448574, 4368014812
Offset: 1

Views

Author

Gus Wiseman, Oct 15 2024

Keywords

Examples

			The fourth row of A095195 is: (7, 2, 0, -1), so a(4) = 10.
		

Crossrefs

For firsts instead of row-sums we have A007442 (modern version of A030016).
This is the absolute version of A140119.
If 1 is considered prime (A008578) we get A376684, absolute version of A376683.
For first zero-positions we have A376678 (modern version of A376855).
For composite instead of prime we have A377035.
For squarefree instead of prime we have A377040, nonsquarefree A377048.
A000040 lists the modern primes, differences A001223, seconds A036263.
A008578 lists the noncomposites, differences A075526, seconds A036263 with 0 prepended.

Programs

  • Mathematica
    nn=15;
    t=Table[Take[Differences[NestList[NestWhile[#+1&, #+1,!PrimeQ[#]&]&,2,2*nn],k],nn],{k,0,nn}]
    Total/@Abs/@Table[t[[j,i-j+1]],{i,nn},{j,i}]

Extensions

More terms from Pontus von Brömssen, Oct 17 2024

A376678 Position of first zero in the n-th differences of the primes, or 0 if it does not appear.

Original entry on oeis.org

0, 0, 2, 7, 69, 13, 47, 58, 9, 43, 3553, 100, 7019, 14082, 68097, 14526, 149677, 2697, 481054, 979719, 631894, 29811, 25340978, 50574254, 7510843, 210829337, 67248861, 224076286, 910615647, 931510269, 452499644, 2880203722, 396680865, 57954439970, 77572822440, 35394938648
Offset: 0

Views

Author

Gus Wiseman, Oct 14 2024

Keywords

Comments

Do the k-th differences of the primes contain a zero for all k > 1?

Examples

			The third differences of the primes begin:
  -1, 2, -4, 4, -4, 4, 0, -6, 8, ...
so a(3) = 7.
		

Crossrefs

If 1 is considered prime (A008578) we get A376855.
The zeros of second differences are A064113, complement A333214.
This is the position at which 0 first appears in row n of A095195.
For composite instead of prime we have A377037.
For squarefree instead of prime we have A377042, nonsquarefree A377050.
For prime-power instead of prime we have A377055.
A000040 lists the primes, first differences A001223, second A036263.

Programs

  • Mathematica
    nn=100000;
    u=Table[Differences[Select[Range[nn],PrimeQ],k],{k,2,16}];
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    m=Table[Position[u[[k]],0][[1,1]],{k,mnrm[Union[First/@Position[u,0]]]}]

Formula

a(n) = A000720(A349643(n)) for n >= 2. - Pontus von Brömssen, Oct 17 2024

Extensions

a(17)-a(32) from Pontus von Brömssen, Oct 17 2024
a(33)-a(35) from Lucas A. Brown, Nov 03 2024

A376684 Antidiagonal-sums of the absolute value of the array A376682(n,k) = n-th term of the k-th differences of the noncomposite numbers (A008578).

Original entry on oeis.org

1, 3, 4, 9, 12, 27, 50, 109, 224, 471, 942, 1773, 3118, 4957, 7038, 9373, 16256, 55461, 150622, 346763, 718972, 1377101, 2462220, 4114987, 6387718, 9112455, 12051830, 17160117, 40946860, 134463917, 349105370, 800713921, 1684145408, 3297536923, 6040907554
Offset: 0

Views

Author

Gus Wiseman, Oct 15 2024

Keywords

Examples

			The fourth antidiagonal of A376682 is: (7, 2, 0, -1, -2), so a(4) = 12.
		

Crossrefs

For the modern primes (A000040) we have A376681, absolute version of A140119.
For firsts instead of row-sums we have A030016, modern A007442.
These are the antidiagonal-sums of the absolute value of A376682 (modern A095195).
This is the absolute version of A376683.
For first zero-positions we have A376855, modern A376678.
A000040 lists the modern primes, differences A001223, seconds A036263.
A008578 lists the noncomposites, first differences A075526.

Programs

  • Mathematica
    nn=12;
    t=Table[Take[Differences[NestList[NestWhile[#+1&,#+1,!PrimeQ[#]&]&,1,2*nn],k],nn],{k,0,nn}];
    Total/@Table[Abs[t[[j,i-j+1]]],{i,nn},{j,i}]

A376855 Position of first 0 in the n-th differences of the noncomposite numbers (A008578), or 0 if it does not appear.

Original entry on oeis.org

0, 0, 1, 8, 70, 14, 48, 59, 10, 44, 3554, 101, 7020, 14083, 68098, 14527, 149678, 2698, 481055, 979720, 631895, 29812, 25340979, 50574255, 7510844, 210829338, 67248862, 224076287, 910615648, 931510270, 452499645, 2880203723, 396680866, 57954439971, 77572822441, 35394938649
Offset: 0

Views

Author

Gus Wiseman, Oct 15 2024

Keywords

Examples

			The third differences of the noncomposite numbers begin: 1, -1, 2, -4, 4, -4, 4, 0, -6, 8, ... so a(3) = 8.
		

Crossrefs

For firsts instead of positions of zeros we have A030016, modern A007442.
These are the first zero-positions in A376682, modern A376678.
For row-sums instead of zero-positions we have A376683, modern A140119.
For absolute row-sums we have A376684, modern A376681.
For composite instead of noncomposite we have A377037.
For squarefree instead of noncomposite we have A377042, nonsquarefree A377050.
For prime-power instead of noncomposite we have A377055.
A000040 lists the modern primes, differences A001223, seconds A036263.
A008578 lists the noncomposite numbers, first differences A075526.

Programs

  • Mathematica
    nn=10000;
    u=Table[Differences[Select[Range[nn],#==1||PrimeQ[#]&],k],{k,2,16}];
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    m=Table[Position[u[[k]],0][[1,1]],{k,mnrm[Union[First/@Position[u,0]]]}]

Extensions

a(16)-a(21) from Alois P. Heinz, Oct 18 2024
a(22)-a(35) from Lucas A. Brown, Nov 03 2024

A377035 Antidiagonal-sums of the absolute value of the array A377033(n,k) = n-th term of the k-th differences of the composite numbers (A002808).

Original entry on oeis.org

4, 8, 10, 12, 14, 18, 21, 28, 34, 40, 47, 74, 96, 110, 138, 286, 715, 2393, 8200, 25731, 72468, 184716, 431575, 934511, 1892267, 3605315, 6494464, 11116110, 18134549, 28348908, 42701927, 62290660, 88313069, 120999433, 159769475, 221775851, 483797879
Offset: 1

Views

Author

Gus Wiseman, Oct 18 2024

Keywords

Examples

			The fourth antidiagonal of A377033 is (9, 1, -1, -1), so a(4) = 12.
		

Crossrefs

The version for prime instead of composite is A376681, absolute version of A140119.
The version for noncomposite is A376684, absolute version of A376683.
This is the antidiagonal-sums of absolute value of the array A377033.
For squarefree instead of composite we have A377040, absolute version of A377039.
For nonsquarefree instead of composite we have A377048, absolute version of A377047.
For prime-power instead of composite we have A377053, absolute version of A377052.
Other arrays of differences: A095195 (prime), A376682 (noncomposite), A377033 (composite), A377038 (squarefree), A377046 (nonsquarefree), A377051 (prime-power).
A000040 lists the primes, differences A001223, seconds A036263.
A002808 lists the composite numbers, differences A073783, seconds A073445.
A008578 lists the noncomposites, differences A075526.
Cf. A018252, A065310, A065890, A333254, A376602 (zero), A376603 (nonzero), A376651 (positive), A376652 (negative), A376680, A377036.

Programs

  • Mathematica
    q=Select[Range[120],CompositeQ];
    t=Table[Sum[(-1)^(j-k)*Binomial[j,k]*q[[i+k]],{k,0,j}],{j,0,Length[q]/2},{i,Length[q]/2}];
    Total/@Table[Abs[t[[j,i-j+1]]],{i,Length[q]/2},{j,i}]

A377039 Antidiagonal-sums of the array A377038(n,k) = n-th term of k-th differences of squarefree numbers (A005117).

Original entry on oeis.org

1, 3, 4, 9, 1, 18, 8, -9, 106, -237, 595, -1170, 2276, -3969, 6640, -10219, 14655, -18636, 19666, -12071, -13056, 69157, -171441, 332756, -552099, 798670, -982472, 901528, -116173, -2351795, 8715186, -23856153, 57926066, -130281007, 273804642, -535390274
Offset: 0

Views

Author

Gus Wiseman, Oct 18 2024

Keywords

Comments

These are row-sums of the triangle-version of A377038.

Examples

			The fourth antidiagonal of A377038 is (6,1,-1,-2,-3), so a(4) = 1.
		

Crossrefs

The version for primes is A140119, noncomposites A376683, composites A377034.
These are the antidiagonal-sums of A377038.
The absolute version is A377040.
For nonsquarefree numbers we have A377047.
For prime-powers we have A377052.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers, complement A013929 (differences A078147).
A073576 counts integer partitions into squarefree numbers, factorizations A050320.
A377041 gives first column of A377038, for primes A007442 or A030016.
A377042 gives first position of 0 in each row of A377038.

Programs

  • Mathematica
    nn=20;
    t=Table[Take[Differences[NestList[NestWhile[#+1&,#+1,!SquareFreeQ[#]&]&,1,2*nn],k],nn],{k,0,nn}];
    Total/@Table[t[[j,i-j+1]],{i,nn},{j,i}]
Showing 1-10 of 16 results. Next