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.

A075157 Run lengths in the binary expansion of n gives the vector of exponents in prime factorization of a(n)+1, with the least significant run corresponding to the exponent of the least prime, 2; with one subtracted from each run length, except for the most significant run of 1's.

Original entry on oeis.org

0, 1, 2, 3, 5, 4, 8, 7, 11, 14, 6, 9, 17, 24, 26, 15, 23, 44, 34, 29, 13, 10, 20, 19, 35, 74, 48, 49, 53, 124, 80, 31, 47, 134, 174, 89, 69, 76, 104, 59, 27, 32, 12, 21, 41, 54, 62, 39, 71, 224, 244, 149, 97, 120, 146, 99, 107, 374, 342, 249, 161, 624, 242, 63, 95, 404
Offset: 0

Views

Author

Antti Karttunen, Sep 13 2002

Keywords

Comments

To make this a permutation of nonnegative integers, we subtract one from each run count except for the most significant run, e.g. a(11) = 9, as 11 = 1011 and 9+1 = 10 = 5^1 * 3^(1-1) * 2^(2-1).

Crossrefs

Programs

  • Haskell
    import Data.List (group)
    a075157 0 = 0
    a075157 n = product (zipWith (^) a000040_list rs') - 1 where
       rs' = reverse $ r : map (subtract 1) rs
       (r:rs) = reverse $ map length $ group $ a030308_row n
    -- Reinhard Zumkeller, Aug 04 2014
    
  • PARI
    A005811(n) = hammingweight(bitxor(n, n>>1));  \\ This function from Gheorghe Coserea, Sep 03 2015
    A286468(n) = { my(p=((n+1)%2), i=0, m=1); while(n>0, if(((n%2)==p), m *= prime(i), p = (n%2); i = i+1); n = n\2); m };
    A075157(n) = if(!n,n,(prime(A005811(n))*A286468(n))-1);
    
  • Scheme
    (define (A075157 n) (if (zero? n) n (+ -1 (* (A000040 (A005811 n)) (fold-left (lambda (a r) (* (A003961 a) (A000079 (- r 1)))) 1 (binexp->runcount1list n))))))
    (define (binexp->runcount1list n) (if (zero? n) (list) (let loop ((n n) (rc (list)) (count 0) (prev-bit (modulo n 2))) (if (zero? n) (cons count rc) (if (eq? (modulo n 2) prev-bit) (loop (floor->exact (/ n 2)) rc (1+ count) (modulo n 2)) (loop (floor->exact (/ n 2)) (cons count rc) 1 (modulo n 2)))))))
    ;; Or, using the code of A286468:
    (define (A075157 n) (if (zero? n) n (- (* (A000040 (A005811 n)) (A286468 n)) 1)))

Formula

a(n) = A075159(n+1) - 1.
a(0) = 0; for n >= 1, a(n) = (A000040(A005811(n)) * A286468(n)) - 1.
Other identities. For all n >= 1:
a(A000975(n)) = A006093(n) = A000040(n)-1.

Extensions

Entry revised, PARI-program added and the old incorrect Scheme-program replaced with a new one by Antti Karttunen, May 17 2017

A059901 Partitions encoded by prime factorization. The partition [P1+P2+P3+...] with P1>=P2>=P3>=... is encoded as 2^P1 * 3^P2 * 5^P3 *...

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 30, 16, 24, 36, 60, 210, 32, 48, 72, 120, 180, 420, 2310, 64, 96, 144, 216, 240, 360, 900, 840, 1260, 4620, 30030, 128, 192, 288, 432, 480, 720, 1080, 1800, 1680, 2520, 6300, 9240, 13860, 60060, 510510, 256, 384, 576, 864, 1296, 960, 1440
Offset: 0

Views

Author

Marc LeBrun, Feb 07 2001

Keywords

Comments

Partitions are ordered canonically (as described in the OEIS Wiki link): [] [1] [2] [1+1] [3] [2+1] [1+1+1] [4]... Rearrangement of A025487, A036035 etc.

Examples

			Partition for n=17 is [2+2+1], so a(17)=2^2*3^2*5=180.
		

Crossrefs

Formula

a(n) = A059900(A059902(n)).

Extensions

Terms reordered by Sean A. Irvine, Oct 17 2022

A059884 Prime factorization of n encoded by recursively interleaving bits of successive prime exponents.

Original entry on oeis.org

0, 1, 2, 4, 8, 3, 128, 5, 32, 9, 32768, 6, 2147483648, 129, 10, 16, 9223372036854775808, 33, 170141183460469231731687303715884105728, 12, 130, 32769
Offset: 1

Views

Author

Marc LeBrun, Feb 06 2001

Keywords

Comments

For n=2^e0*3^e1*5^e2... the alternate (i.e. 2^0,2,4...) bit positions of a(n) give e0, the alternate *remaining* bit positions (i.e. 2^1,5,9...) give e1, the *remaining* alternates (i.e. 2^3,11,19...) give e2 and so on. (Any finite vector of nonnegative integers can be uniquely encoded this way.) Every nonnegative integer appears exactly once in this sequence-despite its outlandish behavior: the next term, a(29) is 2^511 (which has 153 digits), followed by a(30)=11...
Inverse of sequence A059900 considered as a permutation of the nonnegative integers. - Howard A. Landman, Sep 25 2001

Examples

			a(360)=a(2^3 * 3^2 * 5^1)=45 thus: ...0 0 0 0 0 0 1 1 -> 3 from 2^3 ...0 0 1 0 -> 2 from 3^2 ...0 1 -> 1 from 5^1 ...00000101101 == 45.
		

Crossrefs

A344534 For any number n with binary expansion Sum_{k = 1..m} 2^e_k (where 0 <= e_1 < ... < e_m), a(n) = Product_{k = 1..m} prime(1+A002262(e_k))^2^A025581(e_k) (where prime(k) denotes the k-th prime number).

Original entry on oeis.org

1, 2, 4, 8, 3, 6, 12, 24, 16, 32, 64, 128, 48, 96, 192, 384, 9, 18, 36, 72, 27, 54, 108, 216, 144, 288, 576, 1152, 432, 864, 1728, 3456, 5, 10, 20, 40, 15, 30, 60, 120, 80, 160, 320, 640, 240, 480, 960, 1920, 45, 90, 180, 360, 135, 270, 540, 1080, 720, 1440
Offset: 0

Views

Author

Rémy Sigrist, May 22 2021

Keywords

Comments

The ones in the binary expansion of n encode the Fermi-Dirac factors of a(n).
The following table gives the rank of the bit corresponding to the Fermi-Dirac factor p^2^k:
...
7| 9
5| 5 8
3| 2 4 7
2| 0 1 3 6
---+--------
p/k| 0 1 2 3 ...
This sequence is a bijection from the nonnegative integers to the positive integers with inverse A344536.
This sequence establishes a bijection from A261195 to A225547.
This sequence and A344535 each map between two useful choices for encoding sets of elements drawn from a 2-dimensional array. To give a very specific example, each mapping is an isomorphism between two alternative integer representations of the polynomial ring GF2[x,y]. The relevant set is {x^i*y^j : i, j >= 0}. The mappings between the two representations of the ring's addition operation are from XOR (A003987) to A059897(.,.) and for the multiplication operation, they are from A329331(.,.) to A329329(.,.). - Peter Munn, May 31 2021

Examples

			For n = 42:
- 42 = 2^5 + 2^3 + 2^1,
- so we have the following Fermi-Dirac factors p^2^k:
      5| X
      3|
      2|   X X
    ---+------
    p/k| 0 1 2
- a(42) = 2^2^1 * 2^2^2 * 5^2^0 = 320.
		

Crossrefs

Comparable mappings that also use Fermi-Dirac factors: A052330, A059900.
Maps binary operations A003987 to A059897, A329331 to A329329.

Programs

  • PARI
    A002262(n)=n-binomial(round(sqrt(2+2*n)), 2)
    A025581(n)=binomial(1+floor(1/2+sqrt(2+2*n)), 2)-(n+1)
    a(n) = { my (v=1, e); while (n, n-=2^e=valuation(n, 2); v* = prime(1 + A002262(e))^2^A025581(e)); v }

Formula

a(n) = A344535(A344531(n)).
a(n) = A344535(n) iff n belongs to A261195.
A064547(a(n)) = A000120(n).
a(A036442(n)) = prime(n).
a(A006125(n+1)) = 2^2^n for any n >= 0.
a(m + n) = a(m) * a(n) when m AND n = 0 (where AND denotes the bitwise AND operator).
From Peter Munn, Jun 06 2021: (Start)
a(n) = A225546(A344535(n)).
a(n XOR k) = A059897(a(n), a(k)), where XOR denotes bitwise exclusive-or, A003987.
a(A329331(n, k)) = A329329(a(n), a(k)).
(End)

A059903 Periodic part of continued fraction for sqrt(n), encoded by raising successive primes to the terms. If sqrt(n)=c0+[c1,c2,c3...] then a(n)=2^c1*3^c2*5^c3*...

Original entry on oeis.org

1, 4, 18, 1, 16, 324, 72030, 162, 1, 64, 5832, 2916, 372027810, 10588410, 1458, 1, 256, 104976, 1036385881030500, 26244, 9421689827550, 4946387159463750, 1556496270, 13122, 1, 1024, 1889568, 2542277241000, 76256028326940, 236196
Offset: 1

Views

Author

Marc LeBrun, Feb 07 2001

Keywords

Comments

Could be made less gigantic by omitting final terms in continued fraction, which are always 2*c0.

Examples

			sqrt(14) = 3+[1,2,1,6] so a(14) = 2^1*3^2*5^1*7^6 = 10588410.
		

Crossrefs

Formula

a(n) = A059900(A059904(n)).

Extensions

Offset corrected by Sean A. Irvine, Oct 14 2022
Showing 1-5 of 5 results.