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.

User: J. Stauduhar

J. Stauduhar's wiki page.

J. Stauduhar has authored 53 sequences. Here are the ten most recent ones:

A369515 Triangle of hexagons read by row, with right diagonal having in-order odd-indexed primes, left diagonal having 2 followed by the in-order even-indexed primes, and column elements are the least multiple of the prime at the top of the column not already in the sequence, with 0 and 1 prepended.

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 4, 11, 13, 6, 10, 17, 19, 14, 8, 22, 23, 29, 26, 9, 15, 34, 31, 37, 38, 21, 12, 33, 46, 41, 43, 58, 39, 18, 20, 51, 62, 47, 53, 74, 57, 28, 16, 44, 69, 82, 59, 61, 86, 87, 52, 24, 25, 68, 93, 94, 67, 71, 106, 111, 76, 35, 30, 55, 92, 123, 118
Offset: 0

Author

J. Stauduhar, Jan 25 2024

Keywords

Comments

The sequence is a permutation of the nonnegative integers.

Examples

			a(0)=0, a(1)=1, followed by triangle read by rows:
                   |2|
               |3| | | |5 |
          |7 | | | |4| |  | |11|
     |13| |  | |6| | | |10| |  | |17|
|19| |  | |14| | | |8| |  | |22| |  | |23|
Row 5, element 3 = 8, because 2*3=6 has already appeared, but 2*4=8 has not.
		

Crossrefs

Cf. A143182.

Programs

  • Python
    from sympy.ntheory.generate import prime
    from math import ceil
    def get_column_tops(n):
        return [1 + abs((n-1)-2*m) for m in range(1,n-1)]
    def get_indices(rowNum):
      left=(rowNum*(rowNum-1))//2
      right=left+rowNum-1
      return (left, right)
    def get_least(m,seq):
      mult=2
      d=m*mult
      while d in seq:
        mult+=1
        d=m*mult
      return d
    seq,rnum = ([],1)
    while len(seq)<56:
      seq.append(prime(rnum+max(0,rnum-2)))
      cols = get_column_tops(rnum)
      for k in range(len(cols)):
          ndcs=get_indices(cols[k])
          if k 1:
        seq.append(prime(2*rnum-1))
      rnum+=1
    seq=[0,1]+seq
    print(seq)

A368161 a(n) = least perfect power m that is the sum of n consecutive perfect powers, or -1 if m does not exist.

Original entry on oeis.org

1, 25, 441, 100, 169, 289, 121, 2395417249
Offset: 1

Author

J. Stauduhar and Tim Peters, Dec 14 2023

Keywords

Comments

It is conjectured that m always exists.
The present state of knowledge (with ? for unknown entries) is:
1, 25, 441, 100, 169, 289, 121, 2395417249, ?, 15386237159377984, 676, 232324, ?, ?, ?, 64866916, 3721, 3622354596, 279936, ?, ?, 41152225, 29929, 2137444, ?, 11526025, 97969, 9922500, ?, 978626089, ?, 347151424, ?
Known solutions < 10^12 from J. Stauduhar. All others from Tim Peters.

Examples

			128 + 144 + 169 = 441, and 441 is the first perfect power that is the sum of three consecutive perfect powers, so a(3) = 441.
		

Crossrefs

Cf. A001597.

A341092 Rows of Pascal's triangle which contain a 3-term arithmetic progression of a certain form: a(n) = (2n^2 + 22n + 37 + (2n + 3)*(-1)^n)/8.

Original entry on oeis.org

7, 12, 14, 21, 23, 32, 34, 45, 47, 60, 62, 77, 79, 96, 98, 117, 119, 140, 142, 165, 167, 192, 194, 221, 223, 252, 254, 285, 287, 320, 322, 357, 359, 396, 398, 437, 439, 480, 482, 525, 527, 572, 574, 621, 623, 672, 674, 725, 727, 780, 782, 837, 839, 896, 898, 957, 959
Offset: 1

Author

J. Stauduhar, Feb 13 2022

Keywords

Comments

Also, a(2k-1)=(k+2)^2-2; a(2k)=(k+3)^2-4, k>=1.
Conjecture (67) in Ralf Stephan's paper, "Prove or Disprove. 100 Conjectures from the OEIS" asks if it is true that: "The numbers n such that the n-th row of Pascal's triangle contains an arithmetic progresion are n = 19 ∨ n = (1/8)*[2*k^2 + 22k + 37 + (2k + 3)*(-1)^k], k > 0."
Proof: Let (n)_(k) denote the falling factorial. With any integer i>=3:
For a(n) = i^2-2, if we set x=binomial(i,2), and y=binomial(i-1,2), we can calculate three integers in arithmetic progression, {a,b,c}, such that a=[(x+y-2)(y-2)*(y*(y-1))]/y!, b=[(x+y-2)(y-2)*(x*y)]/y!, c =[(x+y-2)_(y-2)*(x*(x-1))]/y!; {a,b,c}={C(i^2-2,y-2), C(i^2-2,y-1), C(i^2-2, y)}.
For a(n) = (i+1)^2-4, if we set x=binomial(i+1,2), and y=binomial(i,2), we can calculate three integers in arithmetic progression, {a,b,c}, such that a=[(x+y-4)(y-4)*(y)(y-4)]/y!, b=[(x+y-4)(y-4)*(x)(2)*(y)(2)]/y!, c =[(x+y-4)(y-4)*(x)_(x-4)]/y!; {a,b,c}={C((i+1)^2-4,y-4), C((i+1)^2-4,y-2 ), C((i+1)^2-4,y)}.
Although row 19 contains a 3-term arithmetic progression it doesn't fit the pattern found here, so 19 is not in this sequence.
Conjecture 1: Row 19 is the only row that contains a 3-term AP that doesn't fit the pattern found here.
Conjecture 2: No row contains an AP of more than three coefficients.
A brute-force search of n<=1100 found no counterexample of either conjecture above.

Examples

			With n=2, k=binomial(n+2=4,2)=6. m=binomial(n+3=5,2)-4+k=12. [C(m,k-4), C(m,k-2), C(m,k)] = [66,495,924], and [C(m+2,k-2), C(m+2,k-1), C(m+2,k)] = [1001,2002,3003], so a(2)=m=12 and a(3)=m+2=14.
		

Crossrefs

Programs

  • PARI
    a(n) = (2*n^2 + 22*n + 37 + (2*n + 3)*(-1)^n)/8 \\ Charles R Greathouse IV, Apr 02 2022
  • Python
    seq=[]
    for n in range(2,101):
        k=int(((n)*(n+1))/2)
        m=int(((n+1)*(n+2))/2)-4+k
        if n==2:
            seq.append(m+2)
        else:
            seq.append(m)
            seq.append(m+2)
    print(seq)
    

A350851 Cumulative sums of the first ceiling(n/2)+1 elements of rows 0 to n in Pascal's triangle.

Original entry on oeis.org

1, 3, 6, 13, 24, 50, 92, 191, 354, 736, 1374, 2860, 5370, 11182, 21090, 43909, 83112, 172958, 328340, 682862, 1299528, 2700820, 5150688, 10697070, 20437756, 42415272, 81170004, 168337168, 322613196, 668607412, 1283037084, 2657319103, 5105342946, 10567113352, 20323851054
Offset: 0

Author

J. Stauduhar, Jan 18 2022

Keywords

Examples

			The first ceiling(n/2)+1 elements from the first four rows of Pascal's are:
     1
    1 1
   1 2
  1 3 3
So a(0)=1, a(1)=a(0)+1+1=3, a(2)=a(1)+1+2=6, a(3)=a(2)+1+3+3=13.
		

Crossrefs

Cf. A007318, A116496 (for n>=2, first differences).

Programs

  • Python
    seq=[];prev=[];total=0
    for n in range(30):
      row=[1]
      last=int(n/2)
      for k in range(last):
        row.append(prev[k]+prev[k+1])
      if n%2==1:
        row.append(row[-1])
      prev=row
      total+=sum(row)
      seq.append(total)
    print(seq)

A346523 Number of sum pyramids for n.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 9, 11, 11, 18, 17, 22, 23, 29, 31, 38, 37, 46, 49, 58, 59, 72, 76, 86, 90, 106, 115, 131, 140, 159, 177, 189, 204, 236, 254, 274, 292, 328, 355, 398, 404, 455, 485, 518, 555, 622, 647, 698, 727, 808, 837, 922, 939, 1032, 1100
Offset: 1

Author

J. Stauduhar, Jul 21 2021

Keywords

Comments

A sum pyramid for n is defined to be a pyramid with n at its apex, all pairs of adjacent members (x, y) of rows 2,3,4,... sum to the element immediately above, every element is positive and distinct, rows are complete (length of row m = length of row (m-1) + 1), reflections are not counted, and the pyramid is maximal (i.e., not part of a larger pyramid that qualifies). An example of the meaning of "maximal" can be seen in the Example section: the pyramids
.
9 9
6 3 and 5 4
.
are not counted because they consist of the top 2 rows of larger (3-row) pyramids that are counted. [Clarified by Peter Munn, Nov 20 2021]

Examples

			The five pyramids for a(9) are:
                9       9       9
   9     9     6 3     6 3     5 4
  8 1   7 2   5 1 2   4 2 1   2 3 1
		

Crossrefs

Cf. A028307 (record pyramid heights), A337766, A348850.

Programs

  • Python
    See Links section.

Extensions

Definition aligned with A028307 by Peter Munn, Nov 20 2021

A330430 Consider integers k=0,1,2,... as strings. Compare each digit in the string, in left-to-right order, with the contents of a bag (multiset) of digits, which is initially empty. If digit d is in the bag delete d from both the string and the bag. What remains of any nonempty string is appended to the sequence and its digits are added to the bag.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1, 1, 1, 20, 1, 22, 3, 4, 25, 6, 27, 8, 29, 3, 33, 3, 3, 40, 1, 42, 3, 44, 5, 6, 47, 8, 49, 5, 5, 55, 5, 60, 1, 62, 3, 64, 5, 66, 7, 8, 69, 7, 7, 7, 77, 80, 1, 82, 3, 84, 5, 86, 7, 88, 9, 9, 9, 9, 9, 99, 100, 1, 2, 103, 4, 105
Offset: 1

Author

J. Stauduhar, Dec 14 2019

Keywords

Examples

			Beginning with k=0, the bag is initially empty and 0 matches nothing in the bag, so the sequence is extended and 0 is added to the bag.  Likewise, for k=1-9, none of these digits match anything in the bag, resulting in the sequence [0,1,2,3,4,5,6,7,8,9] and a bag that contains {0,1,2,3,4,5,6,7,8,9}.
With k=10, Both the 1 and the 0 in k are matched with the 1 and the 0 in the bag and cancel out.  This leaves an empty string, so the sequence is not extended, and the bag now contains {2,3,4,5,6,7,8,9}.
With k=11, neither digit cancels out, since there are no ones in the bag, so the sequence is extended, [0,1,2,3,4,5,6,7,8,9,11], and the bag contains {1,1,2,3,4,5,6,7,8,9}.
		

Programs

  • PARI
    { my (b=vector(base=10), n=0); for (k=0, 105, d = if (k, digits(k,base), [0]); t = []; for (i=1, #d, if (b[1+d[i]], b[1+d[i]]--, t=concat(t, d[i]););); if (#t, print1 (fromdigits(t,base)", "); for (j=1, #t, b[1+t[j]]++))) } \\ Rémy Sigrist, Dec 15 2019
  • Python
    seq = []
    bag = ""
    for k in range(1000):
      m = str(k)
      for digit in m:
        if digit in bag:
          mndx = m.index(digit)
          m = m[:mndx] + m[mndx+1:]
          bndx = bag.index(digit)
          bag = bag[:bndx] + bag[bndx+1:]
      if m:
        seq.append(int(m))
        bag = bag + m
    print(seq)
    

A330520 Sum of even integers <= n times the sum of odd integers <= n.

Original entry on oeis.org

0, 0, 2, 8, 24, 54, 108, 192, 320, 500, 750, 1080, 1512, 2058, 2744, 3584, 4608, 5832, 7290, 9000, 11000, 13310, 15972, 19008, 22464, 26364, 30758, 35672, 41160, 47250, 54000, 61440, 69632, 78608, 88434, 99144, 110808, 123462, 137180, 152000, 168000, 185220, 203742, 223608, 244904, 267674
Offset: 0

Author

J. Stauduhar, Dec 17 2019

Keywords

Comments

Number of crossings in a grid formed by drawing n parallel infinite-length lines perpendicular to the previous number of lines.
The sum of odd integers <= n is m^2 where m = round(n/2) is their number. The sum of even integers <= n is k(k+1) where k = floor(n/2) is their number. So a(n) = m^2*k(k+1), where the factor m appears three times. - M. F. Hasler, Dec 19 2019

Crossrefs

Cf. A000290 (sum of odd integers), A002378 (sum of even integers).

Programs

  • Mathematica
    CoefficientList[Series[2 (x^2 + x + 1) x^2/((x + 1)^2*(1 - x)^5), {x, 0, 45}], x] (* Michael De Vlieger, Dec 22 2019 *)
    LinearRecurrence[{3,-1,-5,5,1,-3,1},{0,0,2,8,24,54,108},50] (* Harvey P. Dale, Dec 29 2021 *)
  • PARI
    apply( A330520(n)=n\2*(n\2+1)*(n\/2)^2, [0..99]) \\ M. F. Hasler, Dec 19 2019

Formula

G.f.: 2*(x^2+x+1)*x^2/((x+1)^2*(1-x)^5).
a(n) = 2 * A007009(n-1) for n>1.
a(2k+i) = (k+i)^3 (k+1-i), with i = 0 or 1. - M. F. Hasler, Dec 19 2019
a(n) = A002378(floor(n/2)) * A000290(ceiling(n/2)). - Bernard Schott, Dec 22 2019

A328638 a(n) is the sum of m such that 2 <= m <= n and gpf(m) = gpf(n), where gpf(i) is the greatest prime factor of i (A006530), with a(1) = 1.

Original entry on oeis.org

1, 2, 3, 6, 5, 9, 7, 14, 18, 15, 11, 30, 13, 21, 30, 30, 17, 48, 19, 50, 42, 33, 23, 72, 75, 39, 99, 70, 29, 105, 31, 62, 66, 51, 105, 135, 37, 57, 78, 145, 41, 147, 43, 110, 190, 69, 47, 183, 196, 240, 102, 130, 53, 237, 165, 252, 114, 87, 59, 300
Offset: 1

Author

J. Stauduhar, Oct 22 2019

Keywords

Comments

For n >= 2, a(n) is the sum of the terms that precede n on the row, of the A125624 array, that contains n.

Examples

			5, 10, 15 and 20 have same gpf as 20, so a(20) = 5 + 10 + 15 + 20 = 50.
		

Crossrefs

Programs

  • PARI
    gpf(n)={my(f=factor(n)[,1]); f[#f]}
    a(n)={if(n<=1, n==1, my(t=gpf(n)); sum(i=2, n, if(gpf(i)==t, i, 0)))} \\ Andrew Howroyd, Oct 28 2019

A328637 Change the array in A125624 by putting a 1 at the top of the first column and pushing that column down by one place; a(n) is the sum of the terms in the modified array down to and including n, in the column that contains n.

Original entry on oeis.org

1, 3, 6, 4, 11, 10, 18, 8, 17, 20, 29, 12, 42, 34, 32, 28, 59, 18, 78, 48, 53, 56, 101, 24, 43, 82, 27, 76, 130, 54, 161, 75, 86, 116, 110, 36, 198, 154, 125, 67, 239, 96, 282, 120, 81, 200, 329, 48, 116, 98, 176, 172, 382, 54, 165, 137, 233, 258, 441
Offset: 1

Author

J. Stauduhar, Oct 22 2019

Keywords

Examples

			The modified version of the array A125624 is:
1,  4,  8, 16, 32, 64, 128, 256, 512, ...
2,  6,  9, 12, 18, 24,  27,  36,  48, ...
3, 10, 15, 20, 25, 30,  40,  45,  50, ...
5, 14, 21, 28, 35, 42,  49,  56,  63, ...
7, 22, 33, 44, 55, 66,  77,  88,  99, ...
11, 26, 39, 52, 65, 78,  91, 104, 117, ...
...
Then:
a(1) = 1,
a(2) = 1+2,
a(3) = 1+2+3,
a(4) = 4,
a(5) = 1+2+3+5,
a(6) = 4+6,
...
		

Crossrefs

Extensions

Edited by N. J. A. Sloane, Dec 05 2019

A330071 a(n) is the smallest positive composite that cannot be expressed as the sum of any subset of earlier terms and is not a multiple of any earlier term.

Original entry on oeis.org

4, 6, 9, 14, 21, 22, 38, 106, 111, 118, 123, 465, 470, 1394, 1405, 4193, 4209, 9446, 13289, 22258, 26101, 70617, 79959, 221566, 225409, 234751, 902919, 977379, 2783217, 2857677, 8424111, 8498571, 25346793, 25421253, 76114839, 76189299, 228418977, 228493437, 685331391
Offset: 1

Author

J. Stauduhar, Dec 01 2019

Keywords

Crossrefs

Extensions

a(24)-a(39) from Giovanni Resta, Dec 02 2019