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.

Previous Showing 11-17 of 17 results.

A171746 Let f(n) = n + floor(sqrt(n)). Then a(n) is the smallest number of iterations of f on n such that a perfect square is obtained.

Original entry on oeis.org

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

Views

Author

Neven Juric (neven.juric(AT)apis-it.hr), Oct 07 2010

Keywords

Comments

Iterate A028392, starting with n: a(n) is the number of steps until a square will be reached. - Reinhard Zumkeller, Feb 23 2012

Examples

			f(9)=12, f(12)=15, f(15)=18, f(18)=22, f(22)=26, f(26)=31, f(31)=36. The first square number in this sequence 12,15,18,22,26,31,36 is on the seventh place and therefore a(9)=7.
		

References

  • Matematicko-fizicki list 1/144, problem 2-2, page 29, (1985-1986).

Crossrefs

Programs

  • Haskell
    a171746 = (+ 1) . length . takeWhile (== 0) .
                               map a010052 . tail . iterate a028392
    -- Reinhard Zumkeller, Feb 23 2012, Oct 14 2010
    
  • Mathematica
    f[n_] := Length@ NestWhileList[ # + Floor@Sqrt@# &, n, ! IntegerQ@Sqrt@# || # == n &] - 1; Array[f, 93] (* Robert G. Wilson v, Oct 08 2010 *)
  • PARI
    f(n) = n + sqrtint(n); \\ A028392
    a(n) = my(k=1); while (!issquare(n=f(n)), k++); k; \\ Michel Marcus, Nov 06 2022

Formula

From Robert G. Wilson v, Oct 08 2010: (Start)
a(k)=1 for A002061(n): n^2 - n + 1 for n>1;
a(k)=2 for A002522(n): n^2 + 1 for n>1;
a(k)=3 for A014206(n): n^2 + n + 2 for n>1;
a(k)=4 for A059100(n): n^2 + 2 for n>1;
a(k)=5 for A027688(n): n^2 + n + 3 for n>2;
a(k)=6 for A117950(n): n^2 + 3 for n>2;
a(k)=7 for A027689(n): n^2 + n + 4 for n>4;
a(k)=8 for A087475(n): n^2 + 4 for n>3;
a(k)=9 for A027690(n): n^2 + n + 5 for n>4; ... (End)
a(n^2) = 2*n + 1: a(A000290(n)) = A005408(n). - Reinhard Zumkeller, Oct 14 2010

A354902 a(n) = 2*n^2 - 6*n + 11 for n > 1 with a(0)=1 and a(1)=3.

Original entry on oeis.org

1, 3, 7, 11, 19, 31, 47, 67, 91, 119, 151, 187, 227, 271, 319, 371, 427, 487, 551, 619, 691, 767, 847, 931, 1019, 1111, 1207, 1307, 1411, 1519, 1631, 1747, 1867, 1991, 2119, 2251, 2387, 2527, 2671, 2819, 2971, 3127, 3287, 3451, 3619, 3791, 3967, 4147, 4331, 4519, 4711, 4907
Offset: 0

Views

Author

Sumukh Patel, Jun 11 2022

Keywords

Comments

a(n) is the minimum number of nodes required for a full binary tree where each node in all longest paths from the root node down to any leaf node is height-balanced and the root node has a height balance factor of 0.
Full binary tree: A binary tree is called a full binary tree if each node has exactly two children or no children.

Examples

			The diagrams below illustrate the terms a(3)=11 and a(4)=19.
           R                         R
          / \                       / \
         /   \                     /   \
        /     \                   /     \
       o       o                 /       \
      / \     / \               /         \
     o   N   N   o             /           \
    / \         / \           /             \
   N   N       N   N         o               o
                            / \             / \
                           /   \           /   \
                          /     \         /     \
                         o       o       o       o
                        / \     / \     / \     / \
                       o   N   N   N   N   N   o   N
                      / \                     / \
                     N   N                   N   N
		

Crossrefs

Programs

  • C
    int a(int n){ return n>1 ? 2*(n*n) - 6*n + 11 : 2*n + 1; }
  • Mathematica
    CoefficientList[Series[(1 + x^2 - 2 x^3 + 4 x^4)/(1 - x)^3, {x, 0, 51}], x] (* Michael De Vlieger, Jun 19 2022 *)

Formula

a(n) = 2*A027688(n-2) + 1, for n >= 2.
a(n) = 4*A022856(n+2) - 1, for n >= 1.
a(n) = a(n-1) + 4*(n-2) for n >= 3.
G.f.: (1 + x^2 - 2*x^3 + 4*x^4)/(1 - x)^3. - Stefano Spezia, Jun 12 2022
Sum_{n>=2} 1/a(n) = Pi*tanh(sqrt(13)*Pi/2)/(2*sqrt(13)). - Amiram Eldar, Jul 10 2022

A214870 Natural numbers placed in table T(n,k) layer by layer. The order of placement: at the beginning filled odd places of layer clockwise, next - even places counterclockwise. T(n,k) read by antidiagonals.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 10, 9, 8, 13, 17, 16, 6, 14, 21, 26, 25, 11, 12, 22, 31, 37, 36, 18, 15, 20, 32, 43, 50, 49, 27, 24, 23, 30, 44, 57, 65, 64, 38, 35, 19, 33, 42, 58, 73, 82, 81, 51, 48, 28, 29, 45, 56, 74, 91, 101, 100, 66, 63, 39, 34, 41, 59, 72, 92, 111
Offset: 1

Views

Author

Boris Putievskiy, Mar 11 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1).
Enumeration table T(n,k) layer by layer. The order of the list:
T(1,1)=1;
T(1,2), T(2,1), T(2,2);
. . .
T(1,n), T(3,n), ... T(n,3), T(n,1); T(n,2), T(n,4), ... T(4,n), T(2,n);
. . .

Examples

			The start of the sequence as table:
   1   2   5  10  17  26 ...
   3   4   9  16  25  36 ...
   7   8   6  11  18  27 ...
  13  14  12  15  24  35 ...
  21  22  20  23  19  28 ...
  31  32  30  33  29  34 ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   5,  4,  7;
  10,  9,  8, 13;
  17, 16,  6, 14, 21;
  26, 25, 11, 12, 22, 31;
  ...
		

Crossrefs

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    if i > j:
       result=i*i-i+(j%2)*(2-(j+1)/2)+((j+1)%2)*(j/2+1)
    else:
       result=j*j-2*(i%2)*j + (i%2)*((i+1)/2+1) + ((i+1)%2)*(-i/2+1)

Formula

As table
T(n,k) = k*k-2*(n mod 2)*k+(n mod 2)*((n+1)/2+1)+((n+1) mod 2)*(-n/2+1), if n<=k;
T(n,k) = n*n-n+(k mod 2)*(2-(k+1)/2)+((k+1) mod 2)*(k/2+1), if n>k.
As linear sequence
a(n) = j*j-2*(i mod 2)*j+(i mod 2)*((i+1)/2+1)+((i+1) mod 2)*(-i/2+1), if i<=j;
a(n) = i*i-i+(j mod 2)*(2-(j+1)/2)+((j+1) mod 2)*(j/2+1), if i>j; where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A268101 Smallest prime p such that some polynomial of the form a*x^2 - b*x + p generates distinct primes in absolute value for x = 1 to n, where 0 < a < p and 0 <= b < p.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 31, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 647, 1277, 1979, 2753
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jan 26 2016

Keywords

Examples

			a(1) = 2 (a prime), x^2 + 2 gives a prime for x = 1.
a(2) = 3 (a prime), 2*x^2 + 3 gives distinct primes for x = 1 to 2.
a(4) = 5 (a prime), 2*x^2 + 5 gives distinct primes for x = 1 to 4.
a(6) = 7 (a prime), 4*x^2 + 7 gives distinct primes for x = 1 to 6.
a(10) = 11 (a prime), 2*x^2 + 11 gives distinct primes for x = 1 to 10.
a(12) = 13 (a prime), 6*x^2 + 13 gives distinct primes for x = 1 to 12.
a(16) = 17 (a prime), 6*x^2 + 17 gives distinct primes for x = 1 to 16.
a(18) = 19 (a prime), 10*x^2 + 19 gives distinct primes for x = 1 to 18.
a(22) = 23 (a prime), 3*x^2 - 3*x + 23 gives distinct primes for x = 1 to 22.
a(28) = 29 (a prime), 2*x^2 + 29 gives distinct primes for x = 1 to 28.
a(29) = 31 (a prime), 2*x^2 - 4*x + 31 gives distinct primes for x = 1 to 29.
a(40) = 41 (a prime), x^2 - x + 41 gives distinct primes for x = 1 to 40.
a(41) = 647 (a prime), abs(36*x^2 - 594*x + 647) gives distinct primes for x = 1 to 41.
a(42) = 1277 (a prime), abs(36*x^2 - 666*x + 1277) gives distinct primes for x = 1 to 42.
a(43) = 1979 (a prime), abs(36*x^2 - 738*x + 1979) gives distinct primes for x = 1 to 43.
a(44) = 2753 (a prime), abs(36*x^2 - 810*x + 2753) gives distinct primes for x = 1 to 44.
		

Crossrefs

A055630 Table T(k,m) = k^2 + m read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 4, 2, 2, 9, 5, 3, 3, 16, 10, 6, 4, 4, 25, 17, 11, 7, 5, 5, 36, 26, 18, 12, 8, 6, 6, 49, 37, 27, 19, 13, 9, 7, 7, 64, 50, 38, 28, 20, 14, 10, 8, 8, 81, 65, 51, 39, 29, 21, 15, 11, 9, 9, 100, 82, 66, 52, 40, 30, 22, 16, 12, 10, 10, 121, 101, 83, 67, 53, 41, 31, 23, 17, 13
Offset: 0

Views

Author

Henry Bottomley, Jun 05 2000

Keywords

Examples

			Table begins:
..0...1...4...9..16..25..36..49..64..81.100.121.144...
..1...2...5..10..17..26..37..50..65..82.101.122.145...
..2...3...6..11..18..27..38..51..66..83.102.123.146...
..3...4...7..12..19..28..39..52..67..84.103.124.147...
..4...5...8..13..20..29..40..53..68..85.104.125.148...
..5...6...9..14..21..30..41..54..69..86.105.126.149...
..6...7..10..15..22..31..42..55..70..87.106.127.150...
..7...8..11..16..23..32..43..56..71..88.107.128.151...
..8...9..12..17..24..33..44..57..72..89.108.129.152...
..9..10..13..18..25..34..45..58..73..90.109.130.153...
.10..11..14..19..26..35..46..59..74..91.110.131.154...
... - _Philippe Deléham_, Mar 31 2013
		

Crossrefs

First column is A001477, second column is A000027, first row is A000290, second row is A002522, third row (apart from first term) is A010000, main diagonal is A002378, other diagonals include A028387, A028552, A014209, A002061, A014206, A027688-A027694, each row of A055096 (as upper right triangle) is right hand part of some row of this table

A081114 Triangle read by rows: T(n,k) = n*T(n-1,k) + n - k starting at T(n,n)=0.

Original entry on oeis.org

0, 1, 0, 4, 1, 0, 15, 5, 1, 0, 64, 23, 6, 1, 0, 325, 119, 33, 7, 1, 0, 1956, 719, 202, 45, 8, 1, 0, 13699, 5039, 1419, 319, 59, 9, 1, 0, 109600, 40319, 11358, 2557, 476, 75, 10, 1, 0, 986409, 362879, 102229, 23019, 4289, 679, 93, 11, 1, 0, 9864100, 3628799, 1022298, 230197, 42896, 6795, 934, 113, 12, 1, 0
Offset: 0

Views

Author

Henry Bottomley, Apr 16 2003

Keywords

Comments

Taking the triangle into negative values of n and k would produce results close to (k+1)*e*n! - 1, i.e., one less than multiples of A000522 for nonnegative n.

Examples

			Triangle begins
    0;
    1,   0;
    4,   1,  0;
   15,   5,  1, 0;
   64,  23,  6, 1, 0;
  325, 119, 33, 7, 1, 0;
		

Crossrefs

Columns include A007526 and A033312.

Programs

  • PARI
    T(n,k) = if (k==n, 0, n*T(n-1,k) + n - k);
    tabl(nn) = {for (n=0, nn, for (k=0, n, print1(T(n, k), ", ");); print(););} \\ Michel Marcus, Jun 16 2019

Formula

For k > 0, T(n, k) = ceiling((A001339(k-1)/(k-1)! - (k-1)*e) *n! - 1) where A001339(k-1) = ceiling((k-1)!*(k-1)*e) for k > 1.
T(n, 0) = floor(e*n! - 1) for n > 0; T(n, 1) = n! - 1. T(n, n)=0; T(n, n-1) = n+2; T(n, n-2) = n^2 + 3*n + 5 = A027688(n+1).

Extensions

More terms from Michel Marcus, Jun 16 2019

A339236 Irregular triangle of incomplete Leonardo numbers read by rows. T(n, k) = 2*(Sum_{j=0..k} binomial(n-j, j)) - 1, for n>=0 and 0<=k<=floor(n/2).

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 1, 7, 9, 1, 9, 15, 1, 11, 23, 25, 1, 13, 33, 41, 1, 15, 45, 65, 67, 1, 17, 59, 99, 109, 1, 19, 75, 145, 175, 177, 1, 21, 93, 205, 275, 287, 1, 23, 113, 281, 421, 463, 465, 1, 25, 135, 375, 627, 739, 753, 1, 27, 159, 489, 909, 1161, 1217, 1219
Offset: 0

Views

Author

Michel Marcus, Nov 28 2020

Keywords

Examples

			Triangle begins:
  1;
  1;
  1, 3;
  1, 5;
  1, 7, 9;
  1, 9, 15;
  1, 11, 23, 25;
  1, 13, 33, 41;
  1, 15, 45, 65, 67;
  1, 17, 59, 99, 109;
  ...
		

Crossrefs

Cf. A001595 (Leonardo numbers: right diagonal).
Cf. A000012 (column 0), A005408 (column 1), A027688 (column 2).

Programs

  • Mathematica
    T[n_, k_] := 2 * Sum[Binomial[n - j, j], {j, 0, k}] - 1; Table[T[n, k], {n, 0, 14}, {k, 0, Floor[n/2]}] // Flatten (* Amiram Eldar, Nov 28 2020 *)
  • PARI
    T(n, k) = 2*sum(j=0, k, binomial(n-j, j)) -1;
    row(n) = vector(n\2+1, k, k--; T(n,k));

Formula

T(n, floor(n/2)) = A001595(n).
Previous Showing 11-17 of 17 results.