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.

Showing 1-5 of 5 results.

A064895 Binary concentration of n. Replace 2^e_k with 2^(e_k/g(n)) in binary expansion of n, where g(n) = GCD of exponents e_k = A064894(n).

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 10, 11, 12, 13, 14, 15, 2, 3, 18, 19, 6, 7, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 2, 3, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 2, 3, 66, 67, 10, 11, 70, 71, 6, 7, 74, 75
Offset: 0

Views

Author

Marc LeBrun, Oct 11 2001

Keywords

Examples

			577 = 2^0 + 2^6 + 2^9, GCD(0,6,9) = 3, a(577) = 2^(0/3)+2^(6/3)+2^(9/3) = 13.
		

Crossrefs

Programs

  • Mathematica
    A064895[n_] := With[{e = Flatten[Position[Reverse[IntegerDigits[n, 2]], 1]] - 1}, Total[2^(e/Max[Apply[GCD, e], 1])]];
    Array[A064895, 100, 0] (* Paolo Xausa, Feb 13 2024 *)
  • PARI
    a(n) = { my (b=vector(hammingweight(n))); for (i=1, #b, n-=2^b[i]=valuation(n,2);); b /= max(1, gcd(b)); sum(i=1, #b, 2^b[i]); } \\ Rémy Sigrist, Oct 16 2022

Formula

If n = 2^(g(n)e0) + 2^(g(n)e1) +... then a(n) = 2^e0 + 2^e1 +...

A056538 Irregular triangle read by rows: row n lists the divisors of n in decreasing order.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 20 2000

Keywords

Comments

Old name was "Replace n by its divisors in reverse order."
This gives the second elements of the ordered pairs (a,b), a >= 1, b >= 1, ordered by their product ab.
T(n,k) = n / A027750(n,k) = A027750(n,n-k+1), 1 <= k <= A000005(n). - Reinhard Zumkeller, Sep 28 2014
The 2nd column of the triangle is the largest proper divisor (A032742). - Charles Kusniec, Jan 30 2021

Examples

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

Crossrefs

Cf. A027750 for the first elements, A056534, A168017, A000005 (row lengths), A000203 (row sums), A032742 (largest proper divisor).

Programs

  • Haskell
    a056538 n k = a056538_tabf !! (n-1) !! (k-1)
    a056538_row n = a056538_tabf !! (n-1)
    a056538_tabf = map reverse a027750_tabf
    -- Reinhard Zumkeller, Sep 28 2014
    
  • Magma
    [Reverse(Divisors(n)) : n in [1..30]];
    
  • Maple
    map(op,[seq(reverse(sort(divisors(j))),j=1..30)]);
    cdr := proc(l) if 0 = nops(l) then ([]) else (l[2..nops(l)]): fi: end:
    reverse := proc(l) if 0 = nops(l) then ([]) else [op(reverse(cdr(l))), l[1]]; fi: end:
  • Mathematica
    Table[Reverse@ Divisors@ n, {n, 27}] // Flatten (* Michael De Vlieger, Jul 27 2016 *)
  • PARI
    row(n)=Vecrev(divisors(n)) \\ Charles R Greathouse IV, Sep 02 2015

Formula

a(n) = A064894(A064896(n)).

Extensions

Definition revised by N. J. A. Sloane, Jul 27 2016

A064896 Numbers of the form (2^(m*r)-1)/(2^r-1) for positive integers m, r.

Original entry on oeis.org

1, 3, 5, 7, 9, 15, 17, 21, 31, 33, 63, 65, 73, 85, 127, 129, 255, 257, 273, 341, 511, 513, 585, 1023, 1025, 1057, 1365, 2047, 2049, 4095, 4097, 4161, 4369, 4681, 5461, 8191, 8193, 16383, 16385, 16513, 21845, 32767, 32769, 33825, 37449, 65535, 65537
Offset: 1

Views

Author

Marc LeBrun, Oct 11 2001

Keywords

Comments

Binary expansion of n consists of single 1's diluted by (possibly empty) equal-sized blocks of 0's.
According to Stolarsky's Theorem 2.1, all numbers in this sequence are sturdy numbers; this sequence is a subsequence of A125121. - T. D. Noe, Jul 21 2008
These are the numbers k > 0 for which k + 2^m = k*2^n + 1 has a solution m,n > 0. For k > 1, these are numbers k such that (k - 2^x)*2^y + 1 = k has a solution in positive integers x,y. In other words, (k - 1)/(k - 2^x) = 2^y for some x,y > 0. If t = (2^m - 1)/(2^n - 1) is a term of this sequence (i.e. if and only if n|m), then t' = t + 2^m = t*2^n + 1 is also a term. Primes in this sequence (A245730) include: all Mersenne primes (A000668), all Fermat primes (A019434), and other primes (73, 262657, 4432676798593, ...). - Thomas Ordowski, Feb 14 2024

Examples

			73 is included because it is 1001001 in binary, whose 1's are diluted by blocks of two 0's.
		

Crossrefs

Cf. A076270 (k=3), A076275 (k=4), A076284 (k=5), A076285 (k=6), A076286 (k=7), A076287 (k=8), A076288 (k=9), A076289 (k=10).
Primes in this sequence: A245730.

Programs

  • Maple
    f := proc(p) local m,r,t1; t1 := {}; for m from 1 to 10 do for r from 1 to 10 do t1 := {op(t1), (p^(m*r)-1)/(p^r-1)}; od: od: sort(convert(t1,list)); end; f(2); # very crude!
    # Alternative:
    N:= 10^6: # to get all terms <= N
    A:= sort(convert({1,seq(seq((2^(m*r)-1)/(2^r-1),m=2..1/r*ilog2(N*(2^r-1)+1)),r=1..ilog2(N-1))},list)); # Robert Israel, Jun 12 2015
  • PARI
    lista(nn) = {v = [1]; x = (2^nn-1); for (m=2, nn, r = 1; while ((y = (2^(m*r)-1)/(2^r-1)) <=x, v = Set(concat(v, y)); r++);); v;} \\ Michel Marcus, Jun 12 2015

Formula

A064894(a(n)) = A056538(n).

A272011 Irregular triangle read by rows: strictly decreasing sequences of nonnegative numbers given in lexicographic order.

Original entry on oeis.org

0, 1, 1, 0, 2, 2, 0, 2, 1, 2, 1, 0, 3, 3, 0, 3, 1, 3, 1, 0, 3, 2, 3, 2, 0, 3, 2, 1, 3, 2, 1, 0, 4, 4, 0, 4, 1, 4, 1, 0, 4, 2, 4, 2, 0, 4, 2, 1, 4, 2, 1, 0, 4, 3, 4, 3, 0, 4, 3, 1, 4, 3, 1, 0, 4, 3, 2, 4, 3, 2, 0, 4, 3, 2, 1, 4, 3, 2, 1, 0, 5, 5, 0, 5, 1, 5, 1
Offset: 0

Views

Author

Peter Kagey, Apr 17 2016

Keywords

Comments

Length of n-th row given by A000120(n);
Maximum of n-th row given by A000523(n);
Minimum of n-th row given by A007814(n);
GCD of n-th row given by A064894(n);
Sum of n-th row given by A073642(n + 1).
n-th row begins at index A000788(n - 1) for n > 0.
The first appearance of n is at A001787(n).
a(A001787(n) + 1) = a(A001787(n)) for all n > 0.
a(A001787(n) + 2) = 0 for all n > 0.
a(A001787(n) + 3) = a(A001787(n)) for all n > 1.
a(A001787(n) + 4) = 1 for all n > 1.
a(A001787(n) + 5) = a(A001787(n)) for all n > 1.
Row n < 1024 lists the digits of A262557(n). - M. F. Hasler, Dec 11 2019

Examples

			Row n is given by the exponents in the binary expansion of n. For example, row 5 = [2, 0] because 5 = 2^2 + 2^0.
Row 0: []
Row 1: [0]
Row 2: [1]
Row 3: [1, 0]
Row 4: [2]
Row 5: [2, 0]
Row 6: [2, 1]
Row 7: [2, 1, 0]
		

Crossrefs

Cf. A133457 gives the rows in reverse order.

Programs

  • Mathematica
    Map[Length[#] - Flatten[Position[#, 1]] &, IntegerDigits[Range[50], 2]] (* Paolo Xausa, Feb 13 2024 *)
  • PARI
    apply( A272011_row(n)=Vecrev(vecextract([0..exponent(n+!n)],n)), [0..39]) \\ For n < 2^10: row(n)=digits(A262557[n]). There are 2^k rows starting with k, they start at row 2^k. - M. F. Hasler, Dec 11 2019

A271410 LCM of exponents in binary expansion of 2n.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 6, 6, 4, 4, 4, 4, 12, 12, 12, 12, 5, 5, 10, 10, 15, 15, 30, 30, 20, 20, 20, 20, 60, 60, 60, 60, 6, 6, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 12, 12, 12, 12, 30, 30, 30, 30, 30, 30, 30, 30, 60, 60, 60, 60, 60, 60, 60, 60, 7, 7, 14, 14, 21, 21, 42
Offset: 0

Views

Author

Peter Kagey, Apr 11 2016

Keywords

Examples

			a(2) = lcm(2) = 2 because 2*2 = 2^2;
a(3) = lcm(1, 2) = 2 because 2*3 = 2^1 + 2^2;
a(7) = lcm(1, 2, 3) = 6 because 2*7 = 2^3 + 2^2 + 2^1.
		

Crossrefs

Programs

  • Mathematica
    lcm[n_]:=Module[{idn2=IntegerDigits[n,2]},LCM@@Pick[Reverse[Range[ Length[ idn2]]], idn2,1]]; Join[{1},Array[lcm,100]] (* Harvey P. Dale, Jan 24 2019 *)
  • PARI
    a(n) = my(ve = select(x->x==1, Vecrev(binary(2*n)), 1)); lcm(vector(#ve, k, ve[k]-1)); \\ Michel Marcus, Apr 12 2016
    
  • PARI
    a(n)=lcm(Vec(select(x->x, Vecrev(binary(n)), 1))) \\ Charles R Greathouse IV, Apr 12 2016
    
  • Python
    from math import lcm
    def A271410(n): return lcm(*(i for i, b in enumerate(bin(n)[:1:-1],1) if b == '1')) # Chai Wah Wu, Dec 12 2022
Showing 1-5 of 5 results.