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

A064766 Fill up an infinite triangular array by rows by successively writing numbers 1, then 1 up to 2*3/2, then 1 up to 3*4/2, then 1 up to 4*5/2 and so on, at the k-th step writing the numbers from 1 up to the k-th triangular number. The final elements of the rows of this infinite triangle form the sequence.

Original entry on oeis.org

1, 2, 2, 6, 5, 1, 8, 1, 10, 20, 10, 22, 7, 21, 36, 16, 33, 6, 25, 45, 11, 33, 56, 14, 39, 65, 14, 42, 71, 10, 41, 73, 1, 35, 70, 106, 23, 61, 100, 4, 45, 87, 130, 21, 66, 112, 159, 36, 85, 135, 186, 48, 101, 155, 210, 56, 113, 171, 230, 59, 120, 182, 245, 56, 121, 187
Offset: 0

Views

Author

Floor van Lamoen, Oct 18 2001

Keywords

Comments

An alternative, equivalent, definition: Let T(i) = [1,2,3,...,i*(i+1)/2], and let S be the concatenation of T(1), T(2), ... Create a triangle by partitioning S into rows of lengths 1, 2, 3, ... The right-hand elements of the rows of this triangle form the new sequence.

Examples

			The first few stages in the construction of the triangular array are:
1
then
..1
.1.2.
3
then
...1
..1.2
.3.1.2
3.4.5.6
then
.....1
....1.2
...3.1.2
..3.4.5.6
.1.2.3.4.5
6.7.8.9.10.
The right-most diagonal forms the sequence: 1,2,2,6,5,...
		

Crossrefs

Mini-index to these sequences: A064766, A064865, A064866, A065221-A655234 are all of the same type. See A064766 for a detailed explanation.

Programs

  • Mathematica
    With[{nn=75},TakeList[Flatten[Range[1,#]&/@Accumulate[Range[nn]]],Range[nn]][[;;,-1]]] (* Harvey P. Dale, Oct 31 2024 *)

Extensions

Edtied by N. J. A. Sloane, Oct 31 2024

A064865 Fill a triangular array by rows by writing numbers 1, then 1 up to 2^2, then 1 up to 3^2, then 1 up to 4^2 and so on. The final elements of the rows form the sequence.

Original entry on oeis.org

1, 2, 1, 5, 1, 7, 14, 6, 15, 25, 11, 23, 36, 14, 29, 45, 13, 31, 50, 6, 27, 49, 72, 15, 40, 66, 93, 21, 50, 80, 111, 22, 55, 89, 124, 16, 53, 91, 130, 1, 42, 84, 127, 171, 20, 66, 113, 161, 210, 35, 86, 138, 191, 245, 44, 100, 157, 215, 274, 45, 106, 168, 231, 295, 36
Offset: 1

Views

Author

Floor van Lamoen, Oct 08 2001

Keywords

Comments

Does every number appear at least once? Do some numbers like 1 appear infinitely often? - Robert G. Wilson v, Oct 10 2001
Difference between n-th triangular number and largest square pyramidal number (A000330) less than it. - Franklin T. Adams-Watters, Sep 11 2006

Examples

			The triangle begins:
....1
...1.2
..3.4.1
.2.3.4.5
6.7.8.9.1
		

Crossrefs

Table: A064866.
Mini-index to these sequences: A064766, A064865, A064866, A065221-A655234 are all of the same type. See A064766 for a detailed explanation.

Programs

  • Mathematica
    a = {}; Do[a = Append[a, Table[i, {i, 1, n^2} ]], {n, 1, 100} ]; a = Flatten[a]; Do[Print[a[[n(n + 1)/2]]], {n, 1, 100} ]
    With[{nn=20},TakeList[Flatten[Table[Range[n^2],{n,nn}]],Range[Floor[ (Sqrt[8*nn^3+12*nn^2+4*nn+3]/Sqrt[3]-1)/2]]]][[All,-1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 04 2020 *)
  • Python
    from sympy import integer_nthroot
    def A064865(n): return 1+(k:=(n*(n+1)>>1)-1)-(r:=(m:=integer_nthroot(3*k, 3)[0])-(6*kChai Wah Wu, Nov 05 2024

Formula

a(n) = n(n+1)/2 - max_{p(m) < n(n+1)/2} p(m), where p(m) = m(m+1)(2m+1)/6. - Franklin T. Adams-Watters, Sep 11 2006

Extensions

More terms from Robert G. Wilson v, Oct 10 2001

A065221 Fill a triangular array by rows by writing numbers 1 up to b(0), 1 up to b(1), etc., where b(n) are the pentagonal numbers. The final elements of the rows form a(n).

Original entry on oeis.org

1, 2, 5, 4, 9, 3, 10, 18, 5, 15, 26, 3, 16, 30, 45, 10, 27, 45, 64, 14, 35, 57, 80, 12, 37, 63, 90, 1, 30, 60, 91, 123, 11, 45, 80, 116, 153, 15, 54, 94, 135, 177, 10, 54, 99, 145, 192, 240, 42, 92, 143, 195, 248, 15, 70, 126, 183, 241, 300, 30, 91, 153, 216, 280, 345, 35
Offset: 0

Views

Author

Floor van Lamoen, Oct 22 2001

Keywords

Examples

			The array begins
....1
...1.2
..3.4.5
.1.2.3.4
5.6.7.8.9
		

Crossrefs

Cf. A000326.
Mini-index to these sequences: A064766, A064865, A064866, A065221-A655234 are all of the same type. See A064766 for a detailed explanation.

A074279 n appears n^2 times.

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
Offset: 1

Views

Author

Jon Perry, Sep 21 2002

Keywords

Comments

Since the last occurrence of n comes one before the first occurrence of n+1 and the former is at Sum_{i=0..n} i^2 = A000330(n), we have a(A000330(n)) = a(n*(n+1)*(2n+1)/6) = n and a(1+A000330(n)) = a(1+(n*(n+1)*(2n+1)/6)) = n+1. So the current sequence is, loosely speaking, the inverse function of the square pyramidal sequence A000330. A000330 has many alternative formulas, thus yielding many alternative formulas for the current sequence. - Jonathan Vos Post, Mar 18 2006
Partial sums of A253903. - Jeremy Gardiner, Jan 14 2018

Examples

			This can be viewed also as an irregular table consisting of successively larger square matrices:
  1;
  2, 2;
  2, 2;
  3, 3, 3;
  3, 3, 3;
  3, 3, 3;
  4, 4, 4, 4;
  4, 4, 4, 4;
  4, 4, 4, 4;
  4, 4, 4, 4;
  etc.
When this is used with any similarly organized sequence, a(n) is the index of the matrix in whose range n is. A121997(n) (= A237451(n)+1) and A238013(n) (= A237452(n)+1) would then yield the index of the column and row within that matrix.
		

Crossrefs

Programs

  • Mathematica
    Table[n, {n, 0, 6}, {n^2}] // Flatten (* Arkadiusz Wesolowski, Jan 13 2013 *)
  • PARI
    A074279_vec(N=9)=concat(vector(N,i,vector(i^2,j,i))) \\ Note: This creates a vector; use A074279_vec()[n] to get the n-th term. - M. F. Hasler, Feb 17 2014
    
  • PARI
    a(n) = my(k=sqrtnint(3*n,3)); k + (6*n > k*(k+1)*(2*k+1)); \\ Kevin Ryde, Sep 03 2025
    
  • Python
    from sympy import integer_nthroot
    def A074279(n): return (m:=integer_nthroot(3*n,3)[0])+(6*n>m*(m+1)*((m<<1)+1)) # Chai Wah Wu, Nov 04 2024

Formula

For 1 <= n <= 650, a(n) = floor((3n)^(1/3)+1/2). - Mikael Aaltonen, Jan 05 2015
a(n) = 1 + floor( t(n) + 1 / ( 12 * t(n) ) - 1/2 ), where t(n) = (sqrt(3888*(n-1)^2-1) / (8*3^(3/2)) + 3 * (n-1)/2 ) ^(1/3). - Mikael Aaltonen, Mar 01 2015
a(n) = floor(t + 1/(12*t) + 1/2), where t = (3*n - 1)^(1/3). - Ridouane Oudra, Oct 30 2023
a(n) = m+1 if n > m(m+1)(2m+1)/6 and a(n) = m otherwise where m = floor((3n)^(1/3)). - Chai Wah Wu, Nov 04 2024
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 (A003881). - Amiram Eldar, Jun 30 2025

Extensions

Offset corrected from 0 to 1 by Antti Karttunen, Feb 08 2014

A237451 Zero-based column index to irregular tables organized as successively larger square matrices.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2014

Keywords

Comments

With sequences constructed of successively larger square matrices (cf. A074279), a(n) will return the distance of n from the left edge of the matrix that n is located in, with 0 standing for the leftmost column (please see the Example section).
A237452 gives the corresponding row index.
A238013 and A121997 give these same row and column indices, starting the numbering with index 1. - M. F. Hasler, Feb 17 2014

Examples

			This irregular table begins as:
0;
0,1;
0,1;
0,1,2;
0,1,2;
0,1,2;
0,1,2,3;
0,1,2,3;
0,1,2,3;
0,1,2,3;
0,1,2,3,4;
0,1,2,3,4;
0,1,2,3,4;
0,1,2,3,4;
0,1,2,3,4;...
		

Crossrefs

Programs

  • Python
    from sympy import integer_nthroot
    def A237451(n): return (n-(k:=(m:=integer_nthroot(3*n,3)[0])+(6*n>m*(m+1)*((m<<1)+1)))*(k-1)*((k<<1)-1)//6-1)%k # Chai Wah Wu, Nov 04 2024
  • Scheme
    (define (A237451 n) (modulo (-1+ (A064866 n)) (A074279 n)))
    

Formula

a(n) = (A064866(n)-1) modulo A074279(n).
a(n) = A121997(n)-1. - M. F. Hasler, Feb 16 2014

A237452 Zero-based row index to irregular tables organized as successively larger square matrices.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2014

Keywords

Comments

With sequences constructed of successively larger kxk square matrices (cf. A074279), a(n) will return the distance of n from the top edge of the matrix that n is located in, with 0 standing for the topmost row in that matrix (please see the Example section).
A237451 gives the corresponding column index.
A238013 and A121997 give these same row and column indices, but starting the numbering with index 1. - M. F. Hasler, Feb 17 2014

Examples

			This irregular table begins as:
0;
0,0;
1,1;
0,0,0;
1,1,1;
2,2,2;
0,0,0,0;
1,1,1,1;
2,2,2,2;
3,3,3,3;
0,0,0,0,0;
1,1,1,1,1;
2,2,2,2,2;
3,3,3,3,3;
4,4,4,4,4;
...
		

Crossrefs

Programs

  • Python
    from sympy import integer_nthroot
    def A237452(n): return (n-1-(k:=(m:=integer_nthroot(3*n,3)[0])+(6*n>m*(m+1)*((m<<1)+1)))*(k-1)*((k<<1)-1)//6)//k # Chai Wah Wu, Nov 04 2024
  • Scheme
    (define (A237452 n) (floor->exact (/ (-1+ (A064866 n)) (A074279 n))))
    

Formula

a(n) = floor((A064866(n)-1)/A074279(n)).
a(n) = A238013(n)-1. - M. F. Hasler, Feb 16 2014

A194048 Natural interspersion of A000330, a rectangular array, by antidiagonals.

Original entry on oeis.org

1, 5, 2, 14, 6, 3, 30, 15, 7, 4, 55, 31, 16, 8, 9, 91, 56, 32, 17, 18, 10, 140, 92, 57, 33, 34, 19, 11, 204, 141, 93, 58, 59, 35, 20, 12, 285, 205, 142, 94, 95, 60, 36, 21, 13, 385, 286, 206, 143, 144, 96, 61, 37, 22, 23
Offset: 1

Views

Author

Clark Kimberling, Aug 13 2011

Keywords

Comments

See A194029 for definitions of natural fractal sequence and natural interspersion. Every positive integer occurs exactly once (and every pair of rows intersperse), so that as a sequence, A194048 is a permutation of the positive integers; its inverse is A194049.

Examples

			Northwest corner:
1...5...14...30...55
2...6...15...31...56
3...7...16...32...57
4...8...17...33...58
9...18..34...59...95
		

Crossrefs

Programs

  • Mathematica
    Remove["Global`*"];
    z = 30;
    c[k_] := k (k + 1) (2 k + 1)/6;
    c = Table[c[k], {k, 1, z}]  (* A000330 *)
    f[n_] := If[MemberQ[c, n], 1, 1 + f[n - 1]]
    f = Table[f[n], {n, 1, 500}]  (* fractal sequence [A064866] *)
    r[n_] := Flatten[Position[f, n]]
    t[n_, k_] := r[n][[k]]
    TableForm[Table[t[n, k], {n, 1, 7}, {k, 1, 7}]]
    p = Flatten[Table[t[k, n - k + 1], {n, 1, 10}, {k, 1, n}]]  (* A194048 *)
    q[n_] := Position[p, n]; Flatten[Table[q[n], {n, 1, 70}]] (* A194049 *)

A367077 Determinant of the n X n matrix whose terms are the n^2 values of isprime(x) from 1 to n^2.

Original entry on oeis.org

0, -1, -1, 0, 1, 0, -2, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -15, 0, 0, 0, 0, 0, 400, 0, -196, 0, 0, 0, 0, 0, 4224, 0, 0, 0, -44304, 0, -537138, 0, 0, 0, -4152330, 0, 0, 0, 0, 0, -59171526, 0, 0, 0, 0, 0, -1681340912, 0, 330218571840, 0, 0, 0, 0, 0, -349982854480, 0, 0, 0
Offset: 1

Views

Author

Andres Cicuttin, Nov 05 2023

Keywords

Comments

Traces of these matrices are A221490.
Consider the sequence b(n) defined as 0 when a(n) is 0 and 1 otherwise. What is the value of the limit as n approaches infinity of Sum_{j<=n} b(j)/n provided that this limit exists?

Examples

			For n=4, we consider the first n^2=16 terms of the characteristic function of primes (A010051): (0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0). These terms form a matrix by arranging them in 4 consecutive subsequences of 4 terms each:
  0, 1, 1, 0;
  1, 0, 1, 0;
  0, 0, 1, 0;
  1, 0, 0, 0;
and the determinant of this matrix is zero, so a(4)=0.
		

Crossrefs

Programs

  • Mathematica
    mat[n_,i_,j_]:=Boole[PrimeQ[(i-1)*n+j]];
    a[n_]:=Det@Table[mat[n,i,j],{i,1,n},{j,1,n}];
    Table[a[n],{n,1,70}]
  • PARI
    a(n) = matdet(matrix(n, n, i, j, isprime((i-1)*n+j))); \\ Michel Marcus, Nov 07 2023
    
  • Python
    from sympy import Matrix, isprime
    def A367077(n): return Matrix(n,n,[int(isprime(i)) for i in range(1,n**2+1)]).det() # Chai Wah Wu, Nov 16 2023

A367133 Rank of the n X n matrix whose terms are the n^2 values of isprime(x) from 1 to n^2.

Original entry on oeis.org

0, 2, 3, 3, 5, 3, 7, 5, 7, 5, 11, 5, 11, 7, 9, 9, 16, 7, 19, 9, 13, 11, 23, 9, 20, 13, 19, 13, 29, 9, 31, 17, 21, 17, 25, 13, 37, 19, 25, 17, 41, 13, 43, 21, 25, 23, 47, 17, 43, 21, 33, 25, 53, 19, 41, 25, 37, 29, 59, 17, 61, 31, 37, 33, 49, 21, 67, 33, 45, 25
Offset: 1

Views

Author

Andres Cicuttin, Nov 06 2023

Keywords

Comments

Traces of these matrices are A221490.

Examples

			For n=4, we consider the first n^2=16 terms of the characteristic function of primes (A010051): (0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0). These terms form a matrix by arranging them in 4 consecutive subsequences of 4 terms each:
  0, 1, 1, 0;
  1, 0, 1, 0;
  0, 0, 1, 0;
  1, 0, 0, 0;
and the largest square submatrix with a nonzero determinant within this matrix is of dimension 3. Therefore, the rank is 3, and so a(4)=3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local i; LinearAlgebra:-Rank(Matrix(n,n,[seq(`if`(isprime(i),1,0),i=1..n^2)])) end proc:
    map(f, [$1..100]); # Robert Israel, Nov 11 2023
  • Mathematica
    mat[n_,i_,j_]:=Boole[PrimeQ[(i-1)*n+j]];
    a[n_]:=MatrixRank@Table[mat[n,i,j],{i,1,n},{j,1,n}];
    Table[a[n],{n,1,70}]
  • PARI
    a(n) = matrank(matrix(n, n, i, j, isprime((i-1)*n+j))); \\ Michel Marcus, Nov 07 2023
    
  • Python
    from sympy import Matrix, isprime
    def A367133(n): return Matrix(n,n,[int(isprime(i)) for i in range(1,n**2+1)]).rank() # Chai Wah Wu, Nov 16 2023

A065228 Fill a triangular array by rows by writing numbers 1 up to b(0), 1 up to b(1), etc., where b(n) are the square numbers. The first elements of the rows form a(n).

Original entry on oeis.org

1, 1, 3, 2, 6, 2, 8, 15, 7, 16, 1, 12, 24, 1, 15, 30, 46, 14, 32, 51, 7, 28, 50, 73, 16, 41, 67, 94, 22, 51, 81, 112, 23, 56, 90, 125, 17, 54, 92, 131, 2, 43, 85, 128, 172, 21, 67, 114, 162, 211, 36, 87, 139, 192, 246, 45, 101, 158, 216, 275, 46, 107, 169, 232, 296, 37
Offset: 0

Views

Author

Floor van Lamoen, Oct 22 2001

Keywords

Crossrefs

Mini-index to these sequences: A064766, A064865, A064866, A065221-A655234 are all of the same type. See A064766 for a detailed explanation.
Showing 1-10 of 24 results. Next