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: Andrew S. Plewe

Andrew S. Plewe's wiki page.

Andrew S. Plewe has authored 15 sequences. Here are the ten most recent ones:

A132435 Composite integers n with two prime factors nearly equidistant from the integer part of the square root of n.

Original entry on oeis.org

4, 6, 9, 10, 14, 22, 25, 35, 49, 55, 65, 77, 85, 91, 119, 121, 143, 169, 187, 209, 221, 247, 253, 289, 299, 319, 323, 361, 377, 391, 407, 437, 493, 527, 529, 551, 589, 629, 667, 697, 703, 713, 841, 851, 899, 943, 961, 989, 1073, 1081, 1147, 1189
Offset: 1

Author

Andrew S. Plewe, Nov 13 2007

Keywords

Comments

An integer n is included if, for some value y >= 0: n = A007918(A000196(n) + y) * A007918(A000196(n) - y) Or: n = nextprime(sqrtint(n) + y) * nextprime(sqrtint(n) - y) Where "nextprime(x)" is the smallest prime number >= to x and "sqrtint(z)" is the integer part of the square root of z.
Has many terms in common with A078972. - Bill McEachen, Dec 24 2020

Examples

			25 = nextprime(5 + 0) * nextprime(5 - 0) = 5 * 5 = 25
35 = nextprime(5 + 1) * nextprime(5 - 1) = 7 * 5 = 35
119 = nextprime(10 + 4) * nextprime(10 - 4) = 17 * 7 = 119
		

Crossrefs

Programs

  • PARI
    bal(x,y) = nextprime(sqrtint(x)+y) * nextprime(sqrtint(x)-y);
    findbal(x) = local(z,y); z=sqrtint(x); while( 0<=z, y=bal(x,z); if(y==x, print1(x", ");break;); z--;);
    for (n=1,1200, findbal(n));

A129861 Smallest square s such that A024352(n) + s is square.

Original entry on oeis.org

1, 4, 9, 1, 16, 25, 4, 36, 1, 9, 64, 81, 16, 4, 121, 1, 144, 9, 36, 196, 225, 4, 16, 1, 64, 324, 25, 9, 400, 441, 100, 4, 529, 1, 576, 49, 144, 676, 9, 25, 64, 841, 4, 900, 1, 36, 16, 1089, 256, 100, 1225, 49, 1296, 25, 324, 4, 1521, 81, 144, 1681, 16, 36, 169, 81, 1936, 9, 484
Offset: 1

Author

Andrew S. Plewe, May 23 2007

Keywords

Examples

			5(5+6) = 55, smallest square = (6/2)^2 = 9
4(4+10) = 56, smallest square = (10/2)^2 = 25
3(3+16) = 57, smallest square = (16/2)^2 = 64
1(1+58) = 59, smallest square = (58/2)^2 = 841
6(6+4) = 60, smallest square = (4/2)^2 = 4
1(1+60) = 61, smallest square = (60/2)^2 = 900
7(7+2) = 63, smallest square = (2/2)^2 = 1
etc.
		

Crossrefs

Cf. A024352.

Formula

y(y+e) = A024352(n), where e is the smallest even number that satisfies this equation, A(n) = (e/2)^2.

A125585 Array of constant-spaced integers read by antidiagonals.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 1, 4, 5, 4, 2, 4, 6, 7, 5, 3, 5, 7, 8, 9, 6, 1, 6, 8, 10, 10, 11, 7, 2, 5, 9, 11, 13, 12, 13, 8, 3, 6, 9, 12, 14, 16, 14, 15, 9, 4, 7, 10, 13, 15, 17, 19, 16, 17, 10, 1, 8, 11, 14, 17, 18, 20, 22, 18, 19, 11, 2, 6, 12, 15, 18, 21, 21, 23, 25, 20, 21, 12
Offset: 1

Author

Andrew S. Plewe, Jan 04 2007

Keywords

Comments

Iteratively taking sums of the values in each row starting with 1 produces the "figurate" numbers. For instance: 1, 1 + 2 = 3, 1 + 2 + 3 = 6 (the triangular numbers -- A000217) 1, 1 + 3 = 4, 1 + 3 + 5 = 9 (the square numbers -- A000290) 1, 1 + 4 = 5, 1 + 4 + 7 = 10 (the pentagonal numbers -- A000326) etc.
Iterative sums of the rows in between produce sequences related to the figurate numbers: 2, 2+4=6, 2+4+6=10 (oblong, or pronic, or heteromecic numbers -- A002378) 2, 2+5=7, 2+5+8=15 (second pentagonal numbers -- A005449) 3, 3+6=9, 3+6+9=18 (triangular matchstick numbers -- A045943) etc.
Iterative products produce the n-factorial numbers: 1, 1*3=3, 1*3*5=15 (double factorial numbers: (2*n-1)!! -- A001147) 2, 2*4=8, 2*4*6=48 (double factorial numbers: (2*n)!! -- A000165) 1, 1*4=4, 1*4*7=28, (triple factorial numbers (3*n-2)!!! -- A007559) etc.

Examples

			The array begins:
  1, 2, 3,  4,  5,  6, ...
  1, 3, 5,  7,  9, 11, ...
  2, 4, 6,  8, 10, 12, ...
  1, 4, 7, 10, 13, 16, ...
  2, 5, 8, 11, 14, 17, ...
  3, 6, 9, 12, 15, 18, ...
		

Crossrefs

Columns k=1-2 give A002260, A108872.
Main diagonal gives A380548.

Programs

  • Maple
    A:= proc(n, k) local m;
          m:= floor((sqrt(8*n-7)-1)/2);
          n + (m+1)*(k-1-m/2)
        end:
    seq(seq(A(1+d-k, k), k=1..d), d=1..12); # Alois P. Heinz, Jul 16 2012
  • Mathematica
    imax = 5;
    A = Table[k, {i, 1, imax}, {j, 1, i}, {k, j, j + i*imax*(imax+1)/2 - 1, i} ] // Flatten[#, 1]&;
    Table[A[[n-k+1, k]], {n, 1, Length[A]}, {k, 1, n}] // Flatten (* Jean-François Alcover, May 23 2016 *)

A117048 Prime numbers that are expressible as the sum of two positive triangular numbers.

Original entry on oeis.org

2, 7, 11, 13, 29, 31, 37, 43, 61, 67, 73, 79, 83, 97, 101, 127, 137, 139, 151, 157, 163, 181, 191, 193, 199, 211, 227, 241, 263, 277, 281, 307, 331, 353, 367, 373, 379, 389, 409, 421, 433, 443, 461, 463, 487, 499, 541, 571, 577, 587, 601, 619, 631, 659, 661
Offset: 1

Author

Andrew S. Plewe, Apr 15 2006

Keywords

Comments

If the triangular number 0 is allowed, only one additional prime occurs: 3. In that case, the sequence becomes A117112.
A subsequence of A051533. - Wolfdieter Lang, Jan 11 2017

Examples

			2 = 1 + 1
7 = 1 + 6
11 = 1 + 10
13 = 10 + 3, etc.
		

Programs

  • Mathematica
    tri = Table[n (n + 1)/2, {n, 40}]; Select[Union[Flatten[Outer[Plus, tri, tri]]], # <= tri[[-1]]+1 && PrimeQ[#] &] (* T. D. Noe, Apr 07 2011 *)
  • PARI
    is(n)=for(k=sqrtint(4*n+1)\2+1,(sqrtint(8*n+1)-1)\2, if(ispolygonal(n-k*(k+1)/2,3), return(n>3 && isprime(n)))); n==2 \\ Charles R Greathouse IV, Nov 07 2014

A110301 Integers written in base "triangle".

Original entry on oeis.org

0, 1, 2, 21, 22, 32, 321, 322, 332, 432, 4321, 4322, 4332, 4432, 5432, 54321, 54322, 54332, 54432, 55432, 65432, 654321, 654322, 654332, 654432, 655432, 665432, 765432, 7654321, 7654322, 7654332, 7654432, 7655432, 7665432, 7765432, 8765432
Offset: 0

Author

Andrew S. Plewe, Sep 07 2005

Keywords

Comments

To convert an integer to base triangle:
Write the integer as a group of ones (6 is shown below).
1 1 1 1 1 1
Iteratively redistribute the leftmost value, adding 1 to each value to its right.
2 1 1 1 1
2 2 1 1
3 2 1
Stop when the leftmost value is greater than the number of values to its right.

A108872 Sums of ordinal references for a triangular table read by columns, top to bottom.

Original entry on oeis.org

2, 3, 4, 4, 5, 6, 5, 6, 7, 8, 6, 7, 8, 9, 10, 7, 8, 9, 10, 11, 12, 8, 9, 10, 11, 12, 13, 14, 9, 10, 11, 12, 13, 14, 15, 16, 10, 11, 12, 13, 14, 15, 16, 17, 18, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
Offset: 1

Author

Andrew S. Plewe, Jul 13 2005

Keywords

Comments

The ordinal references (i,j) for a triangular table are arranged as follows:
(1,1) (2,1) (3,1)
..... (2,2) (3,2)
........... (3,3)
The sequence comprises the sum of each reference in each column, read top to bottom. A similar sequence is A003057, which consists of the sums of the ordinal references for an array read by antidiagonals.
Subtriangle of triangle in A051162. - Philippe Deléham, Mar 26 2013
First 9 rows coincide with triangle A248110; T(n,k) = A002260(n,k) + n; T(2*n-1,n) = A016789(n-1). - Reinhard Zumkeller, Oct 01 2014

Examples

			a(1) = (1,1) = 1 + 1 = 2
a(2) = (2,1) = 2 + 1 = 3
a(3) = (2,2) = 2 + 2 = 4
a(4) = (3,1) = 3 + 1 = 4, etc.
Triangle begins:
  2
  3, 4
  4, 5, 6
  5, 6, 7, 8
  6, 7, 8, 9, 10
  7, 8, 9, 10, 11, 12
  8, 9, 10, 11, 12, 13, 14
  9, 10, 11, 12, 13, 14, 15, 16
  ... - _Philippe Deléham_, Mar 26 2013
		

Crossrefs

Cf. A003057.
Cf. A016789 (central terms), A248110.

Programs

  • Haskell
    a108872 n k = a108872_tabl !! (n-1) !! (k-1)
    a108872_row n = a108872_tabl !! (n-1)
    a108872_tabl = map (\x -> [x + 1 .. 2 * x]) [1..]
    -- Reinhard Zumkeller, Oct 01 2014
    
  • Mathematica
    Flatten[ Table[i + j, {j, 1, 12}, {i, 1, j}]] (* Jean-François Alcover, Oct 07 2011 *)
  • Python
    from math import isqrt
    def A108872(n): return n+((r:=(m:=isqrt(k:=n<<1))+(k>m*(m+1)))*(3-r)>>1) # Chai Wah Wu, Nov 08 2024

Formula

a(n) = a(i, j) = i + j
a(n) = A002024(n) + A002260(n) = floor(1/2 + sqrt(2n)) + n - (m(m+1)/2) + 1, where m = floor((sqrt(8n+1) - 1) / 2 ). The floor function may be computed directly by using the expression floor(x) = x + (arctan(cot(Pi*x)) / Pi) - 1/2 (equation from nrich.maths.org, see links).
Sum_{k=0..n} T(n,k) = A005449(n+1). - Philippe Deléham, Mar 26 2013

Extensions

Offset changed by Reinhard Zumkeller, Oct 01 2014

A105020 Array read by antidiagonals: row n (n >= 0) contains the numbers m^2 - n^2, m >= n+1.

Original entry on oeis.org

1, 3, 4, 5, 8, 9, 7, 12, 15, 16, 9, 16, 21, 24, 25, 11, 20, 27, 32, 35, 36, 13, 24, 33, 40, 45, 48, 49, 15, 28, 39, 48, 55, 60, 63, 64, 17, 32, 45, 56, 65, 72, 77, 80, 81, 19, 36, 51, 64, 75, 84, 91, 96, 99, 100, 21, 40, 57, 72, 85, 96, 105, 112, 117, 120, 121
Offset: 0

Author

Keywords

Comments

A "Goldbach Conjecture" for this sequence: when there are n terms between consecutive odd integers (2n+1) and (2n+3) for n > 0, at least one will be the product of 2 primes (not necessarily distinct). Example: n=3 for consecutive odd integers a(7)=7 and a(11)=9 and of the 3 sequence entries a(8)=12, a(9)=15 and a(10)=16 between them, one is the product of 2 primes a(9)=15=3*5. - Michael Hiebl, Jul 15 2007
A024352 gives distinct values in the array, minus the first row (1, 4, 9, 16, etc.). a(n) gives all solutions to the equation x^2 + xy = n, with y mod 2 = 0, x > 0, y >= 0. - Andrew S. Plewe, Oct 19 2007
Alternatively, triangular sequence of coefficients of Dynkin diagram weights for the Cartan groups C_n: t(n,m) = m*(2*n - m). Row sums are A002412. - Roger L. Bagula, Aug 05 2008

Examples

			Array begins:
  1  4  9 16 25 36  49  64  81 100 ...
  3  8 15 24 35 48  63  80  99 120 ...
  5 12 21 32 45 60  77  96 117 140 ...
  7 16 27 40 55 72  91 112 135 160 ...
  9 20 33 48 65 84 105 128 153 180 ...
  ...
Triangle begins:
   1;
   3,  4;
   5,  8,  9;
   7, 12, 15, 16;
   9, 16, 21, 24, 25;
  11, 20, 27, 32, 35, 36;
  13, 24, 33, 40, 45, 48, 49;
  15, 28, 39, 48, 55, 60, 63, 64;
  17, 32, 45, 56, 65, 72, 77, 80, 81;
  19, 36, 51, 64, 75, 84, 91, 96, 99, 100;
		

References

  • R. N. Cahn, Semi-Simple Lie Algebras and Their Representations, Dover, NY, 2006, ISBN 0-486-44999-8, p. 139.

Programs

  • Magma
    [(k+1)*(2*n-k+1): k in [0..n], n in [0..15]]; // G. C. Greubel, Mar 15 2023
    
  • Mathematica
    t[n_, m_]:= (n^2 - m^2); Flatten[Table[t[i, j], {i,12}, {j,i-1,0,-1}]]
    (* to view table *) Table[t[i, j], {j,0,6}, {i,j+1,10}]//TableForm (* Robert G. Wilson v, Jul 11 2005 *)
    Table[(k+1)*(2*n-k+1), {n,0,15}, {k,0,n}]//Flatten (* Roger L. Bagula, Aug 05 2008 *)
  • SageMath
    def A105020(n,k): return (k+1)*(2*n-k+1)
    flatten([[A105020(n,k) for k in range(n+1)] for n in range(16)]) # G. C. Greubel, Mar 15 2023

Formula

a(n) = r^2 - (r^2 + r - m)^2/4, where r = round(sqrt(m)) and m = 2*n+2. - Wesley Ivan Hurt, Sep 04 2021
a(n) = A128076(n+1) * A105020(n+1). - Wesley Ivan Hurt, Jan 07 2022
From G. C. Greubel, Mar 15 2023: (Start)
Sum_{k=0..n} T(n, k) = A002412(n+1).
Sum_{k=0..n} (-1)^k*T(n, k) = (1/2)*((1+(-1)^n)*A000384((n+2)/2) - (1- (-1)^n)*A000384((n+1)/2)). (End)

Extensions

More terms from Robert G. Wilson v, Jul 11 2005

A105047 Form an addition table of the primes; a(n) is the number of even numbers that appear for the first time in column n.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 5, 4, 5, 3, 4, 3, 3, 7, 4, 5, 4, 3, 5, 5, 6, 5, 5, 4, 4, 3, 7, 5, 5, 7, 5, 5, 6, 4, 6, 5, 5, 7, 4, 6, 5, 4, 6, 5, 8, 5, 7, 4, 5, 6, 5, 3, 3, 8, 8, 5, 4, 5, 8, 8, 5, 5, 9, 4, 8, 7, 7, 6, 6, 5, 5, 7, 5, 7, 7, 6, 6, 6, 6, 5, 7, 7, 6, 6, 5, 6, 5, 5, 7, 4, 8, 4, 8, 5, 8, 7, 8, 9, 7, 5, 9
Offset: 1

Author

Andrew S. Plewe, Apr 06 2005

Keywords

Comments

For n > 2: a(n) = A102696(n-1) - A102696(n-2); a(n+1) = length of n-th row in the triangle A260580. - Reinhard Zumkeller, Aug 11 2015

Examples

			The addition table is as follows:
   + | 2  3  5  7 11
   --+--------------
   2 | 4  5  7  9 13
   3 |    6  8 10 14
   5 |      10 12 16
   7 |         14 18
  11 |            22
		

Crossrefs

Programs

  • Haskell
    a105047 1 = 1
    a105047 n = length $ a260580_row (n - 1)
    -- Reinhard Zumkeller, Aug 11 2015
  • PARI
    lista(n) = {maxp = prime(n); v = vector(maxp); forprime (p=1, maxp, nb = 0; forprime (q=1, p, s = p+q; if (! (s % 2), if (!v[s/2], nb++); v[s/2] = 1;);); print1(nb, ", "););}  \\ Michel Marcus, Apr 18 2013
    

Extensions

More terms from Reinhard Zumkeller, Apr 19 2005

A098383 Define a function f on the positive integers by: if n is 1 or composite, stop; but if n = prime(k) then f(n) = k; a(n) = sum of terms in trajectory of n under repeated application of f.

Original entry on oeis.org

1, 3, 6, 4, 11, 6, 11, 8, 9, 10, 22, 12, 19, 14, 15, 16, 28, 18, 27, 20, 21, 22, 32, 24, 25, 26, 27, 28, 39, 30, 53, 32, 33, 34, 35, 36, 49, 38, 39, 40, 60, 42, 57, 44, 45, 46, 62, 48, 49, 50, 51, 52, 69, 54, 55, 56, 57, 58, 87, 60, 79, 62, 63, 64, 65, 66, 94, 68, 69, 70, 91, 72
Offset: 1

Author

Andrew S. Plewe, Oct 26 2004

Keywords

Comments

Sum of the terms in the prime index chain for n (cf. A049076).

Examples

			a(2) = 3 because 2 is the first prime, therefore 2 + 1 = 3. a(3) = 6 because 3 is the second prime and two is the first prime, therefore 3 + 2 + 1 = 6. a(4) = 4 because 4 is composite. a(5) = 11 because five is the third prime, three is the second prime and two is the first prime, which gives us 5 + 3 + 2 + 1 = 11 and so on.
		

Crossrefs

Programs

  • Maple
    a:= n-> n + `if`(isprime(n), a(numtheory[pi](n)), 0):
    seq (a(n), n=1..80);  # Alois P. Heinz, Jul 16 2012
  • Mathematica
    Table[s=n; p=n; While[PrimeQ[p], p=PrimePi[p]; s=s+p]; s, {n, 1000}] (T. D. Noe)

Extensions

More terms from Ray Chandler, Nov 04 2004

A094812 Number of odd composites between 2^n and 2^(n + 1).

Original entry on oeis.org

0, 0, 0, 2, 3, 9, 19, 41, 85, 181, 375, 769, 1584, 3224, 6580, 13354, 27059, 54521, 110682, 223509, 450702, 908240, 1828936, 3680596, 7402790, 14883096, 29908688, 60081574, 120655821, 242228178, 486173375, 975559168, 1957148063, 3925643991
Offset: 0

Author

Andrew S. Plewe, Jun 11 2004

Keywords

Comments

This sequence may be related to n-ary rooted trees of a fixed height. For instance, the first few terms of A036616 are:
1, 1, 1, 2, 4, 9, 19, 41, 86, 182, 376, 776, 1579, ...
and in A036622:
1, 1, 1, 2, 4, 9, 19, 42, 88, 188, 393, 821, 1692, ...
whereas in the present sequence we have:
0, 0, 0, 2, 3, 9, 19, 41, 85, 181, 375, 769, 1584, ...

Examples

			a(3) = 2 because in the interval 2^3..2^4 = [8..16] there are two odd composites: 9 = 3^2, 15 = 3 * 5.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := (2^(n - 1) - PrimePi[2^(n + 1)] + PrimePi[2^n]); Table[ f[n], {n, 32}] (* Robert G. Wilson v, Jun 15 2004 *)

Formula

Members of A071904 that lie between 2^n and 2^(n + 1).

Extensions

More terms from Robert G. Wilson v, Jun 15 2004