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 31-40 of 42 results. Next

A191751 Least k such that (2^n-1)*2^n - k is a prime number.

Original entry on oeis.org

0, 1, 3, 1, 1, 5, 3, 11, 1, 1, 25, 29, 3, 13, 3, 7, 39, 1, 13, 23, 3, 5, 69, 11, 39, 13, 15, 31, 99, 83, 117, 31, 9, 11, 25, 67, 45, 1, 39, 47, 45, 71, 69, 77, 1, 131, 67, 101, 55, 1, 9, 41, 13, 43, 33, 233, 1, 113, 7, 29, 45, 55, 99, 41, 261, 5, 15, 343, 9
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 14 2011, Jun 15 2011

Keywords

Examples

			a(1)=0 because (2^1-1)*2^1 - 0 =    2 is prime,
a(2)=1 because (2^2-1)*2^2 - 1 =   11 is prime,
a(3)=3 because (2^3-1)*2^3 - 3 =   53 is prime,
a(4)=1 because (2^4-1)*2^4 - 1 =  239 is prime,
a(5)=1 because (2^5-1)*2^5 - 1 =  991 is prime,
a(6)-5 because (2^6-1)*2^6 - 5 = 4027 is prime.
		

Crossrefs

Cf. A020522 ((2^n-1)*2^n).

Programs

  • Maple
    a := proc(n) local k: for k from 0 do if(isprime((2^n-1)*2^n-k))then return k: fi: od: end: seq(a(n), n=1..69); # Nathaniel Johnston, Jun 14 2011
  • Mathematica
    lk[n_]:=Module[{c=2^n,k=0},While[!PrimeQ[c(c-1)-k],k++];k]; Array[lk,70] (* Harvey P. Dale, Jul 02 2018 *)
  • PARI
    a(n) = my(x=(2^n-1)*2^n); x - precprime(x); \\ Michel Marcus, Feb 21 2019

A363402 a(n) = n * (4^n - 2^n) / Clausen(n, 0).

Original entry on oeis.org

0, 2, 12, 56, 480, 992, 4032, 16256, 261120, 784896, 1047552, 4192256, 33546240, 67100672, 268419072, 1073709056, 34359214080, 17179738112, 206157643776, 274877382656, 2199021158400, 4398044413952, 17592181850112, 70368735789056, 1125899839733760, 5629499366440960
Offset: 0

Views

Author

Peter Luschny, Jun 08 2023

Keywords

Crossrefs

Programs

  • Maple
    # Using function 'Clausen' from A160014.
    a := n -> n * (4^n - 2^n) / Clausen(n, 0):
    seq(a(n), n = 0..25);

Formula

a(n) = n * A020522(n) / A160014(n, 0).

A363403 a(n) = (4^n - 2^n) / Clausen(n, 1).

Original entry on oeis.org

0, 1, 2, 28, 8, 496, 96, 8128, 2176, 130816, 15872, 2096128, 6144, 33550336, 44736512, 536854528, 8421376, 8589869056, 86114304, 137438691328, 3331850240, 2199022206976, 127479578624, 35184367894528, 103104380928, 562949936644096, 750599926710272, 9007199187632128
Offset: 0

Views

Author

Peter Luschny, Jun 08 2023

Keywords

Crossrefs

Programs

  • Maple
    # Using function 'Clausen' from A160014.
    a := n -> (4^n - 2^n) / Clausen(n, 1):
    seq(a(n), n = 0..25);

Formula

a(n) = A020522(n) / A160014(n, 1).

A376585 a(n) = 2^(2*n - 1) - 2^(n - 1)*(n - 1).

Original entry on oeis.org

1, 2, 6, 24, 104, 448, 1888, 7808, 31872, 129024, 519680, 2086912, 8366080, 33505280, 134111232, 536641536, 2146992128, 8588886016, 34357510144, 137434234880, 549745852416, 2199002284032, 8796048982016, 35184279814144, 140737295417344, 562949550768128, 2251798974824448
Offset: 0

Views

Author

Peter Luschny, Sep 29 2024

Keywords

Crossrefs

Cf. A020522.

Programs

  • Maple
    A376585 := n -> 2^(2*n - 1) - 2^(n - 1)*(n - 1):
  • Mathematica
    LinearRecurrence[{8, -20, 16}, {1, 2, 6}, 27] (* Hugo Pfoertner, Sep 29 2024 *)

Formula

a(n) = [x^n] (-10*x^2 + 6*x - 1)/((2*x - 1)^2*(4*x - 1)).
a(n) = ((24 - 8*n)*a(n - 2) + (6*n - 22)*a(n - 1)) / (n - 4) for n >= 5.

A099478 Least k such that k*2^n*(2^n-1) - 1 is prime.

Original entry on oeis.org

2, 1, 3, 1, 1, 4, 3, 6, 1, 1, 4, 2, 9, 4, 9, 14, 4, 1, 3, 4, 36, 5, 25, 4, 10, 4, 18, 3, 21, 9, 9, 21, 16, 65, 12, 8, 51, 1, 22, 2, 30, 6, 10, 63, 1, 30, 15, 3, 10, 1, 22, 57, 202, 4, 3, 53, 1, 34, 12, 10, 22, 29, 28, 31, 7, 6, 70, 29, 16, 94, 37, 51, 30, 56, 19, 23, 70, 50, 99, 16, 34, 5
Offset: 1

Views

Author

Pierre CAMI, Nov 18 2004

Keywords

Comments

Least k such that k*A020522(n)-1 is prime. - Michel Marcus, Apr 13 2021

Examples

			1*2^6*(2^6-1) - 1 = 4031 = 29*139
2*2^6*(2^6-1) - 1 = 8063 = 11*733
3*2^6*(2^6-1) - 1 = 12095 = 5*2419
4*2^6*(2^6-1) - 1 = 16127, which is prime, so a(6)=4.
		

Crossrefs

Cf. A020522.

Programs

  • Maple
    f:= proc(n) local c,k;
      c:= 2^n*(2^n-1);
    for k from 1 do if isprime(c*k-1) then return k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Apr 12 2021
  • Mathematica
    a[n_]:=Module[{k=1},While[!PrimeQ[k*2^n*(2^n-1)-1], k++]; k]; Array[a,82] (* Stefano Spezia, Apr 18 2025 *)
  • PARI
    a(n) = my(k=1); while(!isprime(k*2^n*(2^n-1) - 1), k++); k; \\ Michel Marcus, Apr 13 2021

A113980 Number of compositions of n with an odd number of 1's.

Original entry on oeis.org

1, 0, 3, 2, 10, 12, 36, 56, 136, 240, 528, 992, 2080, 4032, 8256, 16256, 32896, 65280, 131328, 261632, 524800, 1047552, 2098176, 4192256, 8390656, 16773120, 33558528, 67100672, 134225920, 268419072, 536887296, 1073709056, 2147516416
Offset: 1

Views

Author

Vladeta Jovovic, Jan 31 2006

Keywords

Examples

			a(4)=2 because only the compositions 31 and 13 of 4 have an odd number of 1's (the other compositions are 4,22,211,121,112 and 1111).
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if n mod 2 = 0 then 2^(n-2)-2^((n-2)/2) else 2^(n-2)+2^((n-3)/2) fi end: seq(a(n),n=1..38); # Emeric Deutsch, Feb 01 2006
  • Mathematica
    f[n_] := If[EvenQ[n], 2^(n - 2) - 2^((n - 2)/2), 2^(n - 2) + 2^((n - 3)/2)]; Array[f, 34] (* Robert G. Wilson v, Feb 01 2006 *)

Formula

a(n) = 2^(n-2)-2^((n-2)/2) if n is even, else a(n) = 2^(n-2)+2^((n-3)/2).
G.f.: z(1-z)^2/[(1-2z)(1-2z^2)]. - Emeric Deutsch, Feb 03 2006
G.f.: 1 + x + Q(0), where Q(k)= 1 - 1/(2^k - 2*x*2^(2*k)/(2*x*2^k - 1/(1 + 1/(2*2^k - 8*x*2^(2*k)/(4*x*2^k + 1/Q(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, May 22 2013

Extensions

More terms from Robert G. Wilson v and Emeric Deutsch, Feb 01 2006

A352993 a(n) is the n-th positive integer that has no common 1-bit with n; a(0) = 0.

Original entry on oeis.org

0, 2, 4, 12, 8, 18, 24, 56, 16, 34, 36, 84, 48, 98, 112, 240, 32, 66, 68, 140, 72, 162, 168, 360, 96, 194, 196, 420, 224, 450, 480, 992, 64, 130, 132, 268, 136, 274, 280, 600, 144, 322, 324, 660, 336, 706, 720, 1488, 192, 386, 388, 780, 392, 834, 840, 1736
Offset: 0

Views

Author

Rémy Sigrist, Apr 14 2022

Keywords

Comments

This sequence corresponds to the main diagonal of A295653.
To compute a(n):
- consider the binary expansion of n: Sum_{k >= 0} b_k * 2^k,
- and the positions of zeros in this binary expansion: {z_k, k >= 0},
- then a(n) = Sum_{k >= 0} b_k * 2^z(k).

Examples

			For n = 43:
- the binary expansion of 43 is       "... 0 0 0 0 1 0 1 0 1 1"
- so the binary expansion of a(43) is "... 1 0 1 0(0)1(0)1(0 0)",
- and a(43) = 660.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (m=n, v=0); for (e=0, oo, if (n==0, return (v), !bittest(m, e), if (n%2, v+=2^e;); n\=2)) }
    
  • Python
    def a(n):
        b = bin(n)[2:][::-1]
        z = [k for k, bk in enumerate(b+'0'*(len(b)-b.count('0'))) if bk=='0']
        return sum(int(bk)*2**zk for bk, zk in zip(b, z))
    print([a(n) for n in range(56)]) # Michael S. Branicky, Apr 21 2022

Formula

a(n) = A295653(n, n).
a(2^k) = 2^(k+1) for any k >= 0.
a(2^k-1) = A020522(k) for any k >= 0.
A000120(a(n)) = A000120(n).
A070939(a(n)) = A070939(n) + A000120(n).

A355390 Number of ordered pairs of distinct integer partitions of n.

Original entry on oeis.org

0, 0, 2, 6, 20, 42, 110, 210, 462, 870, 1722, 3080, 5852, 10100, 18090, 30800, 53130, 87912, 147840, 239610, 392502, 626472, 1003002, 1573770, 2479050, 3831806, 5931660, 9057090, 13819806, 20834660, 31399212, 46806122, 69697452, 102870306, 151523790, 221488806
Offset: 0

Views

Author

Gus Wiseman, Jul 04 2022

Keywords

Examples

			The a(0) = 0 through a(3) = 6 pairs:
  .  .  (11)(2)  (21)(3)
        (2)(11)  (3)(21)
                 (111)(3)
                 (3)(111)
                 (111)(21)
                 (21)(111)
		

Crossrefs

Without distinctness we have A001255, unordered A086737.
The version for compositions is A020522, unordered A006516.
The unordered version is A355389.
A000041 counts partitions, strict A000009.
A001970 counts multiset partitions of partitions.
A063834 counts partitions of each part of a partition.

Programs

  • Mathematica
    Table[Length[Select[Tuples[IntegerPartitions[n],2],UnsameQ@@#&]],{n,0,15}]
  • PARI
    a(n) = 2*binomial(numbpart(n), 2); \\ Michel Marcus, Jul 05 2022

Formula

a(n) = 2*A355389(n) = 2*binomial(A000041(n), 2).

A375551 a(n) = Sum_{k=0..n} k XOR n-k, where XOR is the bitwise exclusive disjunction. Row sums of A003987.

Original entry on oeis.org

0, 2, 4, 12, 12, 22, 32, 56, 48, 58, 68, 100, 108, 142, 176, 240, 208, 210, 212, 252, 252, 294, 336, 424, 416, 458, 500, 596, 636, 734, 832, 992, 896, 866, 836, 876, 844, 886, 928, 1048, 1008, 1050, 1092, 1220, 1260, 1390, 1520, 1744, 1680, 1714, 1748, 1884, 1916
Offset: 0

Views

Author

Peter Luschny, Sep 27 2024

Keywords

Crossrefs

Programs

  • Maple
    XOR := (n, k) -> Bits:-Xor(n, k):
    a := n -> local k; add(XOR(k, n-k), k=0..n):
    seq(a(n), n = 0..52);
  • Mathematica
    (* Using definition *)
    Table[Sum[BitXor[n - k, k], {k, 0, n}], {n, 0, 100}]
    (* Using recurrence -- faster *)
    a[0] = 0; a[n_] := a[n] = If[OddQ[n], 4*a[(n-1)/2] + n + 1, 2*(a[n/2] + a[n/2-1])];
    Table[a[n], {n, 0, 100}] (* Paolo Xausa, Oct 01 2024 *)
  • PARI
    a(n) = sum(k=0, n, bitxor(k, n-k)); \\ Michel Marcus, Sep 28 2024

Formula

a(n) = 2*A099027(n).
a(n) = 2*n + A006582(n).
a(2^n - 1) = 4^n - 2^n = A020522(n).
a(2^n) = 4^n - 2^n*(n - 1) = 2*A376585(n).
Recurrence: a(0) = 0; a(2*n) = 2*(a(n) + a(n-1)); a(2*n+1) = 2*(2*a(n) + n + 1). - Paolo Xausa, Oct 01 2024, derived from recurrence in A099027.

A133789 Let P(A) denote the power set of an n-element set A. Then a(n) = the number of pairs of elements {x,y} of P(A) for which either 0) x and y are disjoint and for which x is not a subset of y and y is not a subset of x, 1) x and y are disjoint and for which either x is a subset of y or y is a subset of x, or 2) x and y intersect but for which x is not a subset of y and y is not a subset of x.

Original entry on oeis.org

0, 1, 4, 16, 70, 316, 1414, 6196, 26590, 112156, 466774, 1923076, 7863310, 31972396, 129459334, 522571156, 2104535230, 8460991036, 33972711094, 136277478436, 546270602350, 2188566048076, 8764718254054, 35090241492916, 140455083984670, 562102715143516
Offset: 0

Views

Author

Ross La Haye, Jan 03 2008, Jan 08 2008

Keywords

Comments

Also, number of even binomial coefficient in rows 0 to 2^n of Pascal's triangle. [Aaron Meyerowitz, Oct 29 2013]

Examples

			a(3) = 16 because for P(A) = {{},{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}} we see that
{1} and {2},
{1} and {3},
{2} and {3},
{1} and {2,3},
{2} and {1,3},
{3} and {1,2}
are disjoint, while
{} and {1},
{} and {2},
{} and {3},
{} and {1,2},
{} and {1,3},
{} and {2,3},
{} and {1,2,3}
are disjoint and one is a subset of the other and
{1,2} and {1,3},
{1,2} and {2,3},
{1,3} and {2,3}
are intersecting, but neither is a subset of the other.
Also, through row 8 of Pascal's triangle the a(3)=16 even entries are 2 (so a(0)=0 and a(1)=1) then 4,6,4 (so a(2)=4) then 10,10 then  6,20,6 then 8,28,56,70,56,28,8. [_Aaron Meyerowitz_, Oct 29 2013]
		

Crossrefs

Formula

a(n) = (1/2)(4^n - 2*3^n + 3*2^n - 2).
O.g.f.: x*(1-6*x+11*x^2)/[(-1+x)*(-1+2*x)*(-1+3*x)*(-1+4*x)]. - R. J. Mathar, Jan 11 2008
a(n) = A084869(n)-1 = A016269(n-2)+2^n-1. - Vladeta Jovovic, Jan 04 2008, corrected by Eric Rowland, May 15 2017
a(n) = 3*StirlingS2(n+1,4) + StirlingS2(n+1,3) + StirlingS2(n+1,2). - Ross La Haye, Jan 11 2008
a(n) = 3*StirlingS2(n+1,4) + StirlingS2(n+1,3) + StirlingS2(n+1,2). - Ross La Haye, Jan 11 2008
a(n) = 10*a(n-1)-35*a(n-2)+50*a(n-3)-24*a(n-4). [Aaron Meyerowitz, Oct 29 2013]

Extensions

Edited by N. J. A. Sloane, Jan 20 2008 to incorporate suggestions from several contributors.
Previous Showing 31-40 of 42 results. Next