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 61-69 of 69 results.

A335003 Triangle read by rows where the n-th row is the cycle trajectory of 2^n+1 in the divide-or-choose 2 rule.

Original entry on oeis.org

3, 5, 10, 9, 36, 18, 17, 136, 68, 34, 33, 528, 264, 132, 66, 65, 2080, 1040, 520, 260, 130, 129, 8256, 4128, 2064, 1032, 516, 258, 257, 32896, 16448, 8224, 4112, 2056, 1028, 514, 513, 131328, 65664, 32832, 16416, 8208, 4104, 2052, 1026, 1025, 524800, 262400, 131200, 65600, 32800, 16400, 8200, 4100, 2050
Offset: 1

Views

Author

Michel Marcus, May 22 2020

Keywords

Comments

The divide-or-choose-2 rule is a quadratic Collatz-type recursion where the map is defined with f(n) = n/2 if n is even, and f(n) = binomial(n, 2) if n is odd.

Examples

			Triangle begins:
   3;
   5, 10;
   9, 36, 18;
  17, 136, 68, 34;
  33, 528, 264, 132, 66;
  ...
		

Crossrefs

Cf. A000051 (1st column), A052548 (right diagonal).

Programs

  • Mathematica
    f[n_] := If[EvenQ[n], n/2, Binomial[n, 2]]; row[n_] := NestWhileList[f, n, f[#] != n &]; Join @@ Table[row[2^n + 1], {n, 1, 10}] (* Amiram Eldar, May 22 2020 *)
  • PARI
    f(n) = if (n%2, binomial(n, 2), n/2);
    row(n) = my(m=2^n+1, v=vector(n)); v[1] = m; for (i=2, n, v[i] = f(v[i-1])); v;

A340161 a(n) is the smallest number k for which the set {k + 1, k + 2, ..., k + k} contains exactly n elements with exactly three 1-bits (A014311).

Original entry on oeis.org

1, 4, 6, 7, 10, 11, 13, 18, 19, 21, 25, 34, 35, 37, 41, 49, 66, 67, 69, 73, 81, 97, 130, 131, 133, 137, 145, 161, 193, 258, 259, 261, 265, 273, 289, 321, 385, 514, 515, 517, 521, 529, 545, 577, 641, 769, 1026, 1027, 1029, 1033, 1041, 1057, 1089, 1153, 1281, 1537
Offset: 0

Views

Author

Marius A. Burtea, Dec 30 2020

Keywords

Comments

When n = m*(m-1)/2 + 1, m >= 2 (A000124 \ {1}), then a(n) = k = 2^m+2, m >= 2 (A052548 \ {3, 4}), and only for these values of k, there exists only one set, {k+1, k+2, ..., 2k}, that contains exactly n elements whose binary representation has exactly three 1's (see A340068). - Bernard Schott, Jan 03 2021
From David A. Corneth, Jan 03 2021: (Start)
a(n) = A018900(n) + 1 for n >= 1.
Proof: Let T(k) be the number of values in {k+1, k+2, ..., k+k} that have exactly 3 ones in their binary expansion. Let h(k) be 1 if k has exactly 3 ones in its binary expansion and 0 otherwise and let w(k) be the binary weight of k (cf. A000120). Then T(k + 1) = T(k) + h(2*k + 1) + h(2*k + 2) - h(k + 1) = T(k) + h(2*k + 1) + h(2*(k + 1)) - h(k + 1) but as h(2^m * k) = h(k) two terms cancel and we have T(k + 1) = T(k) + h(2*k + 1). If w(2*k + 1) = w(k) + 1 = 3 then w(k) = 2 which holds for k in A018900. (End)

Examples

			For k in {1, 2, 3}, the sets are {1, 2}, {3, 4} and {4, 5, 6}, which do not contain numbers in A014311, so a(0) = 1.
For k = 4, the set is {5, 6, 7, 8} with 7 = A014311(1), so a(1) = 4.
For k = 6, the set {7, 8, 9, 10, 11, 12} contains the elements 7 = A014311(1) and 11 = A014311(2), so a(2) = 6.
		

Crossrefs

Essentially a duplicate of A018900 - N. J. A. Sloane, Jan 23 2021.
Cf. also A000124, A052548 \ {3} (is a subsequence).

Programs

  • Magma
    fb:=func; a:=[]; for n in [0..64] do k:=1; while #[s:s in [k+1..2*k]|fb(s)] ne n do k:=k+1; end while; Append(~a,k); end for; a;
    
  • PARI
    first(n) = {my(res = vector(n), t = 1); res[1] = 1; for(i = 2, oo, if(hammingweight(2*i-1) == 3, t++; if(t > n, return(res)); res[t] = i))} \\ David A. Corneth, Jan 03 2021
    
  • Python
    from math import isqrt, comb
    def A340161(n): return 1+(1<<(m:=isqrt(n<<3)+1>>1))+(1<<(n-1-comb(m,2))) if n else 1 # Chai Wah Wu, Mar 10 2025

Formula

From Bernard Schott, Jan 03 2021: (Start)
a(m*(m-1)/2 + 1) = 2^m + 2 for m >= 2.
a(m*(m-1)/2 + 2) = 2^m + 3 for m >= 2.
a(n) = A018900(n) + 1 for n >= 1 (see A340068). (End)

A363299 a(n) is the sum of the n-th powers of the terms of row 4 of Pascal's triangle.

Original entry on oeis.org

5, 16, 70, 346, 1810, 9826, 54850, 312706, 1810690, 10601986, 62563330, 371185666, 2210336770, 13194911746, 78901035010, 472332468226, 2829699842050, 16961019183106, 101697395621890, 609909495824386, 3658357463318530, 21945746733400066, 131656888214355970, 789870960541958146
Offset: 0

Views

Author

J. Lowell, May 26 2023

Keywords

Examples

			a(2) = 1^2 + 4^2 + 6^2 + 4^2 + 1^2 = 1 + 16 + 36 + 16 + 1 = 70.
		

Crossrefs

Cf. A007318.
Cf. A000012 (row 0), A007395 (row 1), A052548 (row 2), A115099 (row 3).

Programs

  • Mathematica
    Table[6^n + 2*(4^n + 1), {n, 0, 24}] (* Amiram Eldar, May 27 2023 *)
  • Python
    def A363299(n): return 2+(((1<Chai Wah Wu, Jun 27 2023

Formula

a(n) = 2 + 2*4^n + 6^n.
From Natalia L. Skirrow, Jun 25 2023: (Start)
G.f.: (5-39*x+64*x^2)/((1-x)*(1-4*x)*(1-6*x)).
E.g.f.: 2*e^x + 2*e^(4*x) + e^(6*x).
(End)

A384441 Binary XOR of n and the prime factors of n.

Original entry on oeis.org

1, 0, 0, 6, 0, 7, 0, 10, 10, 13, 0, 13, 0, 11, 9, 18, 0, 19, 0, 19, 17, 31, 0, 25, 28, 21, 24, 25, 0, 26, 0, 34, 41, 49, 33, 37, 0, 55, 41, 47, 0, 44, 0, 37, 43, 59, 0, 49, 54, 53, 33, 59, 0, 55, 57, 61, 41, 37, 0, 56, 0, 35, 59, 66, 73, 72, 0, 87, 81, 70, 0, 73, 0, 109
Offset: 1

Views

Author

Karl-Heinz Hofmann, May 30 2025

Keywords

Examples

			For n = 12 the prime factors are {2,3} -> a(12) = 12 XOR 2 XOR 3 = 13.
a(13) = 13 XOR 13 = 0.
		

Crossrefs

Programs

  • Maple
    f:= l-> `if`(l=[], 0, Bits[Xor](l[1], f(l[2..-1]))):
    a:= n-> f([n, map(i-> i[1], ifactors(n)[2])[]]):
    seq(a(n), n=1..74);  # Alois P. Heinz, May 30 2025
  • Mathematica
    a[n_] := BitXor @@ Join[{n}, FactorInteger[n][[;; , 1]]]; a[1] = 1; Array[a, 100] (* Amiram Eldar, May 30 2025 *)
  • PARI
    a(n) = my(f=factor(n)[,1]); my(b=n); for (k=1, #f, b=bitxor(b, f[k])); b; \\ Michel Marcus, May 30 2025
  • Python
    from sympy import primefactors
    def A384441(n):
        result = n
        for pf in primefactors(n): result ^= pf
        return result
    

Formula

a(n) = XOR(n,A293212(n)).
a(n) = 0 <=> n is prime.
a(2^n) = A052548(n) for n>=2.

A384853 Squared length of interior diagonal of n-th (U, V)-crossbox, where U = (1, 0, 1) and V = (0, 1, 0), as in Comments.

Original entry on oeis.org

1, 5, 9, 21, 57, 165, 489, 1461, 4377, 13125, 39369, 118101, 354297, 1062885, 3188649, 9565941, 28697817, 86093445, 258280329, 774840981, 2324522937, 6973568805, 20920706409, 62762119221, 188286357657, 564859072965, 1694577218889, 5083731656661
Offset: 1

Views

Author

Clark Kimberling, Jul 02 2025

Keywords

Comments

Suppose that U and V are 3-dimensional vectors over the field of real numbers. Define f(1) = U, f(2) = V, f(3) = UxV, where x = cross product, and for n>=2, define f(n) = h(n - 1), g(n) = f(n - 1) + g(n - 1) - h(n - 1), h(n) = f(n) x g(n).
The parallelopiped having edge vectors f(n), g(n), h(n) is the n-th (U,V)-crossbox, with volume |f(n).(g(n) x h(n))|, where . = dot product, and interior diagonal length ||g(n)||. These two sequences, after removal of their first 2 terms, are given for selected U and V by the following table, except for the 3 initial terms:
U V volume squared diagonal length, ||g(n)||^2
(1, 0, 0) (0, 1, 0) A000079 A052548
(1, 0, 0) (0, 1, 1) A008776 3*A052919
(1, 0, 0) (1, 0, 1) A000351 A178676
(1, 0, 0) (1, 1, 1) A167747 5*A204061
(1, 0, 0) (0, 2, 0) A005054 4*A199215
(1, 0, 0) (1, 2, 0) A013731 8*A199552
(1, 0, 0) (2, 1, 0) A011557 10*A000533
(1, 0, 0) (1, 1, 2) A067403 18*A135423
(1, 0, 0) (2, 1, 1) A334603 11*A199750
(1, 0, 1) (0, 1, 0) A008776 this sequence
(1, 1, 0) (0, 1, 1) A081341 6*A199318
(1, 1, 0) (1, 1, 1) A270369 9*A199559
(1, 2, 3) (3, 2, 1) 2*A009992 48 + 96*A009992

Examples

			Taking U = (1, 0, 1) and V = (0, 1, 0), successive edge vectors are given by
(f(n)) = ( (1, 0, 1), (-1,0,1), (-1,2,-1), (3,0,-3), (3,-6,3), ...)
(g(n)) = ( (0,1,0), (2,1,0), (2,-1,2), (-2,1,4), (-2,7,-2), (10,1,-8), ...)
(h(n)) = ( (-1.0,1), (-1,2,-1), (3,0,-3), (3,-6,3), (-9,0,9),...)
The successive volumes are (2, 6, 18, 54, 162, 486, 1458, 4374, 13122,...).
The lengths of diagonals of the first five crossboxes are 1, sqrt(5), 3, sqrt(21), sqrt(57), so the first five squared lengths are 1, 5, 9, 21, 57.
		

Crossrefs

Programs

  • Mathematica
    f[1] = {1, 0, 1}; g[1] = {0, 1, 0}; h[1] = Cross[f[1], g[1]];
    f[n_] := f[n] = h[n - 1];
    g[n_] := g[n] = f[n - 1] + g[n - 1] - h[n - 1];
    h[n_] := h[n] = Cross[f[n], g[n]];
    v[n_] := f[n] . Cross[g[n], h[n]] (* signed volume of nth parallelopiped P(n) *)
    d[n_] := Norm[g[n]] (* length of interior diagonal of P(n) *)
    Column[Table[{f[n], g[n], h[n]}, {n, 1, 16}]]  (* edge vectors of P(n) *)
    Table[v[n], {n, 1, 16}]  (* A008776 *)
    u = Table[d[n]^2, {n, 1, 30}] (* A384853 *)
    Join[{1},Table[1+2*(3^(n-1)+1),{n,40}]] (* or *) LinearRecurrence[{4,-3},{1,5,9},50] (* Harvey P. Dale, Jul 20 2025 *)

Formula

a(0) = 1, a(n) = 1 + 2 * (3^(n-1)+1) for n>=1.
a(n) = 4*a(n-1) - 3*a(n-2) for n>=4.
In general, suppose that U = (a,b,c) and V = (s,t,u), and let D = -(a^2 + b^2 + c^2 + s^2 + t^2 + u^2 + 2 (a s + b t + c u)). Then, linear recurrences are given for n>=3 by f(n) = D*f (n - 2), g(n) = g(n - 1) + D*g(n - 2) - D*g(n - 3), h(n) = D*h(n - 2). If w(n) denotes the volume of the n-th (U,V)-crossbox, then w(n) = D*w(n-1) for n>=2.

A091264 Matrix defined by a(n,k) = 2^n + (k-1), read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 3, 2, 2, 7, 4, 3, 3, 15, 8, 5, 4, 4, 31, 16, 9, 6, 5, 5, 63, 32, 17, 10, 7, 6, 6, 127, 64, 33, 18, 11, 8, 7, 7, 255, 128, 65, 34, 19, 12, 9, 8, 8, 511, 256, 129, 66, 35, 20, 13, 10, 9, 9, 1023, 512, 257, 130, 67, 36, 21, 14, 11, 10, 10, 2047, 1024, 513, 258, 131, 68, 37, 22
Offset: 0

Views

Author

Ross La Haye, Feb 23 2004

Keywords

Examples

			{0};
{1,1};
{3,2,2};
{7,4,3,3};
{15,8,5,4,4};
{31,16,9,6,5,5};
{63,32,17,10,7,6,6};
a(5,3) = 34 because 2^5 + (3-1) = 34.
		

Crossrefs

Rows: a(0, k) = A001477(k), a(1, k) = A000027(k+1) etc. etc. Columns: a(n, 0) = A000225(n). a(n, 1) = A000079(n). a(n, 2) = A000051(n). a(n, 3) = A052548(n). a(n, 4) = A062709(n). Diagonals: a(n, n+3) = A052968(n+1). a(n, n+2) = A005126(n). a(n, n+1) = A006127(n). a(n, n) = A052944(n). a(n, n-1) = A083706(n-1). Also note that the sums of the antidiagonals = the partial sums of the main diagonal, i.e., a(n, n).

Programs

  • Mathematica
    Flatten[ Table[ Table[ a[i, n - i], {i, n, 0, -1}], {n, 0, 11}]] (* both from Robert G. Wilson v, Feb 26 2004 *)
    Table[a[n, k], {n, 0, 10}, {k, 0, 10}] // TableForm (* to view the table *)

Formula

For k > 0, a(n, k)= a(n, k-1) + 1.
a(n, k) = 2^n + (k-1).

Extensions

More terms from Robert G. Wilson v, Feb 23 2004

A108155 Numbers of the forms 2^n-2, 2^n-1, 2^n, 2^n+1 and 2^n+2.

Original entry on oeis.org

-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 30, 31, 32, 33, 34, 62, 63, 64, 65, 66, 126, 127, 128, 129, 130, 254, 255, 256, 257, 258, 510, 511, 512, 513, 514, 1022, 1023, 1024, 1025, 1026, 2046, 2047, 2048, 2049, 2050, 4094, 4095, 4096, 4097, 4098, 8190, 8191, 8192, 8193, 8194, 16382, 16383, 16384
Offset: 1

Views

Author

Henrik Lundquist (sploinker(AT)sploink.dk), Jun 06 2005

Keywords

Comments

This number sequence is designed for a quick test of e.g. arithmetic in binary systems.

Crossrefs

Cf. A107684.

Formula

A267615 a(n) = 2^n + 11.

Original entry on oeis.org

12, 13, 15, 19, 27, 43, 75, 139, 267, 523, 1035, 2059, 4107, 8203, 16395, 32779, 65547, 131083, 262155, 524299, 1048587, 2097163, 4194315, 8388619, 16777227, 33554443, 67108875, 134217739, 268435467, 536870923, 1073741835, 2147483659, 4294967307, 8589934603, 17179869195, 34359738379
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 18 2016

Keywords

Comments

Recurrence relation b(n) = 3*b(n - 1) - 2*b(n - 2) for n>1, b(0) = k, b(1) = k + 1, gives the closed form b(n) = 2^n + k - 1.

Crossrefs

Cf. sequences with closed form 2^n + k - 1: A168616 (k=-4), A028399 (k=-3), A036563 (k=-2), A000918 (k=-1), A000225 (k=0), A000079 (k=1), A000051 (k=2), A052548 (k=3), A062709 (k=4), A140504 (k=5), A168614 (k=6), A153972 (k=7), A168415 (k=8), A242475 (k=9), A188165 (k=10), A246139 (k=11), this sequence (k=12).
Cf. A156940.

Programs

  • Magma
    [2^n+11: n in [0..30]]; // Vincenzo Librandi, Jan 19 2016
  • Mathematica
    Table[2^n + 11, {n, 0, 35}]
    LinearRecurrence[{3, -2}, {12, 13}, 40] (* Vincenzo Librandi, Jan 19 2016 *)
  • PARI
    a(n) = 2^n + 11; \\ Altug Alkan, Jan 18 2016
    

Formula

G.f.: (12 - 23*x)/(1 - 3*x + 2*x^2).
a(n) = 3*a(n - 1) - 2*a(n - 2) for n>1, a(0)=12, a(1)=13.
a(n) = A000079(n) + A010850(n).
Sum_{n>=0} 1/a(n) = 0.367971714327125...
Lim_{n->oo} a(n + 1)/a(n) = 2.
E.g.f.: exp(2*x) + 11*exp(x). - Elmo R. Oliveira, Nov 08 2023

A376323 (1/5) times obverse convolution (3)**(2^n + 1); see Comments.

Original entry on oeis.org

1, 6, 48, 576, 11520, 414720, 28200960, 3722526720, 967856947200, 499414184755200, 513397781928345600, 1053492248516965171200, 4319318218919557201920000, 35401132122264690826936320000, 580153753219673753271832412160000, 19012798800515148242224491811307520000
Offset: 0

Views

Author

Clark Kimberling, Sep 20 2024

Keywords

Comments

See A374848 for the definition of obverse convolution and a guide to related sequences.

Crossrefs

Programs

  • Mathematica
    s[n_] := 3; t[n_] := 2^n + 1;
    u[n_] := (1/5) Product[s[k] + t[n - k], {k, 0, n}];
    Table[u[n], {n, 0, 20}]
    (* or *)
    Table[2^(n*(n+1)/2) * QPochhammer[-4, 1/2, n+1]/5, {n, 0, 15}] (* Vaclav Kotesovec, Sep 20 2024 *)

Formula

a(n) = 2 a(n-1)*A052548(n-1) for n>=1.
Previous Showing 61-69 of 69 results.