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-70 of 96 results. Next

A075175 Prime factorization of n encoded by interleaving successive prime exponents in unary to bit-positions given by columns of A001477.

Original entry on oeis.org

0, 1, 2, 5, 8, 3, 64, 37, 18, 9, 1024, 7, 32768, 65, 10, 549, 2097152, 19, 268435456, 13, 66, 1025, 68719476736, 39, 136, 32769, 274, 69, 35184372088832, 11, 36028797018963968, 16933, 1026, 2097153, 72, 23, 73786976294838206464
Offset: 1

Views

Author

Antti Karttunen, Sep 13 2002

Keywords

Comments

Here we store the exponent e_i of p_i (p1=2, p2=3, p3=5, ...) in the factorization of n to the bit positions given by the column i-1 of A001477 viewed as a table (the exponent of 2 is thus stored to bit positions 0, 2, 5, 9, 14, 20, ..., exponent of 3 to 1, 4, 8, 13, 19, ..., exponent of 5 to 3, 7, 12, 18, 25, ...) using unary system, i.e. we actually store 2^(e_i) - 1 in binary.
This injective mapping from N to N offers an example of the proof given in Cameron's book that any distributive lattice can be represented as a sublattice of the power-set lattice P(X) of some set X. With this we can implement GCD (A003989) with bitwise AND (A004198) and LCM (A003990) with bitwise OR (A003986). Also, to test whether x divides y, it is enough to check that ((a(x) OR a(y)) XOR a(y)) = A003987(A003986(a(x),a(y)),a(y)) is zero.

Examples

			a(24) = 39 because 24 = 2^3 * 3^1 so we add the binary words 100101 and 10 to get 100111 in binary = 39 in decimal and a(25) = 136 because 25 = 5^2 so we form a binary word 10001000 = 136 in decimal.
		

References

  • P. J. Cameron, Combinatorics: Topics, Techniques, Algorithms, Cambridge University Press, 1998, page 191. (12.3. Distributive lattices)

Crossrefs

Variant: A075173. Inverse: A075176.
A003989(x, y) = A075176(A004198(a(x), a(y))), A003990(x, y) = A075176(A003986(a(x), a(y))).

A268728 Square array A(row,col) = B(row,(2*col)-1), where B(p,2q-1) = 0 if gcd(p,2q-1) > 1, and A269158(p,q) otherwise. Array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 0, 7, 0, 0, 0, 4, 3, 0, 1, 0, 13, 3, 0, 2, 0, 0, 14, 0, 0, 0, 0, 1, 0, 11, 1, 0, 2, 4, 0, 1, 0, 8, 1, 0, 1, 7, 7, 2, 1, 0, 25, 0, 0, 1, 0, 0, 7, 0, 0, 0, 26, 3, 0, 6, 15, 5, 4, 0, 0, 1, 0, 31, 3, 0, 0, 10, 3, 13, 4, 0, 2, 1, 0, 28, 0, 0, 6, 0, 2, 14, 0, 6, 0, 0, 1, 0, 21, 1, 0, 1, 26, 7, 11, 4, 12, 0, 3, 0, 0
Offset: 1

Views

Author

Antti Karttunen, Feb 19 2016

Keywords

Comments

The array gives the values of bivariate function B(p,q) which is well-defined only when q is odd, thus while here its argument p obtains all integer values from 1 onward, argument q gets only odd numbers 1, 3, 5, 7, 9, ... as its values.
Any row n occurs also as row (4^k * n), for all k >= 0.

Examples

			The top left [1 .. 16] x [1 .. 25] section of the array:
  0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  1, 2, 7, 4, 13, 14, 11,  8, 25, 26, 31, 28, 21, 22, 19, 16
  1, 0, 3, 3,  0,  1,  1,  0,  3,  3,  0,  1,  1,  0,  3,  3
  0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  1, 2, 0, 2,  1,  1,  6,  0,  6,  1,  5,  6,  0,  6,  5,  5
  0, 0, 4, 7,  0, 15, 10,  0, 26, 25,  0, 29, 20,  0, 16, 19
  1, 0, 7, 0,  5,  3,  2,  7,  2,  1,  0,  3,  1,  4,  5,  4
  1, 2, 7, 4, 13, 14, 11,  8, 25, 26, 31, 28, 21, 22, 19, 16
  1, 0, 0, 4,  0,  4,  9,  0, 12,  1,  0,  0, 12,  0,  4,  9
  0, 0, 0, 6, 12, 15, 13,  0, 31, 27, 26, 26,  0, 16, 22, 21
  1, 2, 0, 0, 13,  0,  7, 11, 14, 13, 14,  3,  8, 10, 10, 15
  1, 0, 3, 3,  0,  1,  1,  0,  3,  3,  0,  1,  1,  0,  3,  3
  1, 0, 3, 7,  0, 14,  0,  6,  1, 11, 14,  8,  8,  9, 12, 11
  0, 2, 0, 0,  8, 13,  9, 15, 27, 27,  0, 31, 20, 18, 22, 20
  1, 0, 0, 0,  0,  0, 11,  0,  9,  3,  0, 15,  0,  0,  2, 15
  0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  1, 2, 7, 3, 13, 15,  0,  8,  0,  8, 17, 11,  8, 14, 18, 10
  0, 0, 7, 0,  0, 10,  2,  0, 21, 27,  0, 28, 25,  0, 23, 25
  1, 0, 0, 2,  0, 14, 10,  0, 25,  0, 11, 19,  8,  9, 10, 16
  1, 2, 0, 2,  1,  1,  6,  0,  6,  1,  5,  6,  0,  6,  5,  5
  1, 0, 0, 0,  0, 15, 11,  0,  0, 26,  0, 10, 17,  0, 10, 15
  0, 0, 7, 4,  0,  0, 12,  3, 23, 23, 17, 31, 29, 28, 25, 31
  1, 2, 3, 4,  1,  0, 13,  8, 26,  0, 31,  0, 13, 19,  8, 11
  0, 0, 4, 7,  0, 15, 10,  0, 26, 25,  0, 29, 20,  0, 16, 19
  1, 0, 0, 0,  5,  1,  1,  0, 25, 25,  0, 28,  0, 12, 25, 13
		

Crossrefs

Transpose: A268729.
Column 1: Seems to be 0 followed by A039982.
Cf. A065621 (occurs as row 2, row 8, and in general, as any row 2^(2n+1) for n >= 0).
Cf. A268829, A269158 (variants).

Programs

  • Scheme
    (define (A268728 n) (A268728bi (A002260 n) (+ -1 (* 2 (A004736 n)))))
    (define (A268728bi p q) (if (not (odd? q)) (error "A268728bi: the second argument should be odd: " p q) (let loop ((p p) (q q) (s 0)) (cond ((zero? p) 0) ((= 1 p) s) ((odd? p) (loop (modulo q p) p (A003987bi s (A004198bi p q)))) (else (loop (/ p 2) q (A003987bi s (A003987bi q (/ (- q 1) 2)))))))))
    ;; Alternative implementation using the definition given in A269158:
    (define (A268728 n) (let ((p (A002260 n)) (q (+ -1 (* 2 (A004736 n))))) (if (< 1 (gcd p q)) 0 (A269158auxbi p q))))

Formula

A(row,col) = B(row,(2*col)-1), where function B(p,q) [only odd values allowed for q] is defined as: If gcd(p,q) > 1, B(p,q) = 0, otherwise B(p,q) = F(p,q) = A269158(p,(q+1)/2), function F defined as in A269158.

A276004 a(n) is the number of nonzero digits in the factorial-base representation of n that are matched by more significant digits from left; a(n) = A060502(n) - A060128(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 2, 3, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 0, 0, 1, 2, 1, 1, 0, 0, 1, 2, 1, 1, 0, 1, 1, 2, 1, 2, 0, 0, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 17 2016

Keywords

Comments

a(n) is the number of times a nonzero digit d_i appears in position i of the factorial-base representation of n (where the least significant digit is in position 1) such that there is another nonzero digit d_j in such position j > i that j - d_j = i.

Examples

			For n=15 ("211" in factorial base) the least significant 1 at position 1 is matched by its immediate left neighbor 1 and also by 2 at position 3, as (2-1) = (3-2) = 1, the position where the least significant 1 itself is. However, this is counted just as one match, because this sequence gives the number of digits that are matched, instead of the number of digits that match, thus a(15)=1.
		

Crossrefs

Cf. A276005 (indices of zeros), A276006 (of nonzeros).
Differs from A276007 for the first time at n=15, where a(15)=1, while A276004(15)=2.

Formula

a(n) = A060502(n) - A060128(n).
a(n) = A000120(2*A275727(n) AND A276010(n)), where AND is a bitwise-and given in A004198.

A283472 a(n) = A004001(A004001(n-1)) AND A004001(n-A004001(n-1)), a(1) = a(2) = 0.

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 2, 2, 2, 3, 0, 0, 4, 4, 4, 4, 4, 5, 4, 5, 5, 6, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 9, 8, 9, 8, 8, 8, 8, 10, 10, 10, 11, 11, 12, 12, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 17, 16, 17, 16, 17, 17, 16, 18, 18, 16, 16, 16, 17, 18, 18, 16, 16, 16, 17, 17, 17, 18, 20, 20, 20, 21, 22, 22, 24, 24, 24, 24
Offset: 1

Views

Author

Antti Karttunen, Mar 18 2017

Keywords

Crossrefs

Cf. A004001, A004198, A283469, A283470, A283473 (positions of zeros).

Programs

Formula

a(1) = a(2) = 0; for n > 2, a(n) = A004001(A004001(n-1)) AND A004001(A080677(n-1)), where AND is bitwise-and (A004198).
Other identities. For all n >= 1:
a(n) = A283469(n) - A283470(n).
A004001(n) = A283469(n) + a(n) = A283470(n) + 2*a(n).

A292246 Base-2 expansion of a(n) encodes the steps where numbers of the form 3k+2 are encountered when map x -> A253889(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 1, 0, 2, 3, 0, 4, 1, 2, 14, 5, 12, 6, 7, 8, 2, 1, 0, 0, 9, 26, 22, 3, 20, 6, 5, 16, 10, 29, 10, 4, 11, 30, 2, 25, 60, 56, 13, 28, 54, 15, 48, 24, 17, 44, 8, 5, 12, 38, 3, 30, 26, 1, 24, 20, 1, 18, 6, 19, 62, 14, 53, 4, 14, 45, 0, 42, 7, 124, 118, 41, 50, 58, 13, 116, 106, 11, 40, 104, 33, 32, 98, 21, 92, 6, 59, 88, 18, 21, 82, 76, 9, 34, 36, 23, 74
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			For n = 2, the starting value is of the form 3k+2, after which follows A253889(3) = 1, the end point of iteration, which is not, thus a(2) = 1*(2^0) = 1.
For n = 4, the starting value is not of the form 3k+2, while A253889(4) = 2 is, thus a(4) = 0*(2^0) + 1*(2^1) = 2.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; g[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; Map[FromDigits[#, 2] &[IntegerDigits[#, 3] /. d_ /; d > 0 :> d - 1] &, Array[a, 96]] (* Michael De Vlieger, Sep 16 2017 *)

Formula

a(1) = 0; for n > 1, a(n) = 2*a(A253889(n)) + floor((n mod 3)/2).
a(n) = A289814(A292243(n)).
A000120(a(n)) = A254045(n).
a(n) AND A292244(n) = a(n) AND A292245(n) = 0, where AND is a bitwise-AND (A004198).

A292372 A binary encoding of 2-digits in base-4 representation of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			   n      a(n)     base-4(n)  binary(a(n))
                  A007090(n)  A007088(a(n))
  --      ----    ----------  ------------
   1        0          1           0
   2        1          2           1
   3        0          3           0
   4        0         10           0
   5        0         11           0
   6        1         12           1
   7        0         13           0
   8        2         20          10
   9        2         21          10
  10        3         22          11
  11        2         23          10
  12        0         30           0
  13        0         31           0
  14        1         32           1
  15        0         33           0
  16        0        100           0
  17        0        101           0
  18        1        102           1
		

Crossrefs

Cf. A289814 (analogous sequence for base-3).

Programs

  • Mathematica
    Table[FromDigits[IntegerDigits[n, 4] /. k_ /; IntegerQ@ k :> If[k == 2, 1, 0], 2], {n, 0, 120}] (* Michael De Vlieger, Sep 21 2017 *)
  • Python
    from sympy.ntheory.factor_ import digits
    def a(n):
        k=digits(n, 4)[1:]
        return 0 if n==0 else int("".join('1' if i==2 else '0' for i in k), 2)
    print([a(n) for n in range(121)]) # Indranil Ghosh, Sep 21 2017
    
  • Python
    def A292372(n): return 0 if (m:=n&~(n<<1)) < 2 else int(bin(m)[-2:1:-2][::-1],2) # Chai Wah Wu, Jun 30 2022

Formula

a(n) = A059906(n AND A048724(n)), where AND is a bitwise-AND (A004198).
For all n >= 0, A000120(a(n)) = A160382(n).

A344834 Square array T(n, k), n, k >= 0, read by antidiagonals; T(n, k) = (n * 2^max(0, w(k)-w(n))) AND (k * 2^max(0, w(n)-w(k))) (where AND denotes the bitwise AND operator and w = A070939).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 29 2021

Keywords

Comments

In other words, we right pad the binary expansion of the lesser of n and k with zeros (provided it is positive) so that both numbers have the same number of binary digits, and then apply the bitwise AND operator.

Examples

			Array T(n, k) begins:
  n\k|  0  1  2   3  4   5   6   7  8  9  10  11  12  13  14  15
  ---+----------------------------------------------------------
    0|  0  0  0   0  0   0   0   0  0  0   0   0   0   0   0   0
    1|  0  1  2   2  4   4   4   4  8  8   8   8   8   8   8   8
    2|  0  2  2   2  4   4   4   4  8  8   8   8   8   8   8   8
    3|  0  2  2   3  4   4   6   6  8  8   8   8  12  12  12  12
    4|  0  4  4   4  4   4   4   4  8  8   8   8   8   8   8   8
    5|  0  4  4   4  4   5   4   5  8  8  10  10   8   8  10  10
    6|  0  4  4   6  4   4   6   6  8  8   8   8  12  12  12  12
    7|  0  4  4   6  4   5   6   7  8  8  10  10  12  12  14  14
    8|  0  8  8   8  8   8   8   8  8  8   8   8   8   8   8   8
    9|  0  8  8   8  8   8   8   8  8  9   8   9   8   9   8   9
   10|  0  8  8   8  8  10   8  10  8  8  10  10   8   8  10  10
   11|  0  8  8   8  8  10   8  10  8  9  10  11   8   9  10  11
   12|  0  8  8  12  8   8  12  12  8  8   8   8  12  12  12  12
   13|  0  8  8  12  8   8  12  12  8  9   8   9  12  13  12  13
   14|  0  8  8  12  8  10  12  14  8  8  10  10  12  12  14  14
   15|  0  8  8  12  8  10  12  14  8  9  10  11  12  13  14  15
		

Crossrefs

Cf. A344835 (OR), A344836 (XOR), A344837 (min), A344838 (max), A344839 (absolute difference).

Programs

  • PARI
    T(n,k,op=bitand,w=m->#binary(m)) = { op(n*2^max(0, w(k)-w(n)), k*2^max(0, w(n)-w(k))) }

Formula

T(n, k) = T(k, n).
T(m, T(n, k)) = T(T(m, n), k).
T(n, n) = n.
T(n, 0) = n.
T(n, 1) = A053644(n).

A082858 Array A(x,y): the greatest common subtree (intersect) of the binary trees x and y, (x,y) running as (0,0),(1,0),(0,1),(2,0),(1,1),(0,2) and each index referring to a binary tree encoded by A014486(j).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 06 2003

Keywords

Comments

Note that together with A082860 this forms a distributive lattice, thus it is possible to compute this function also with the binary AND-operation (A004198) with the help of appropriate mapping functions. I.e. we have A(x,y) = A082857(A004198(A082856(x), A082856(y))).

Crossrefs

Cf. A072764. The lower/upper triangular region: A082859. Cf. A080300, A025581, A002262.

A285099 a(n) is the zero-based index of the second least significant 1-bit in the base-2 representation of n, or 0 if there are fewer than two 1-bits in n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 19 2017

Keywords

Examples

			For n = 3, "11" in binary, the second least significant 1-bit (the second 1-bit from the right) is at position 1 (when the rightmost position is position 0), thus a(3) = 1.
For n = 4, "100" in binary, there is just one 1-bit present, thus a(4) = 0.
For n = 5, "101" in binary, the second 1-bit from the right is at position 2, thus a(5) = 2.
For n = 25, "11001" in binary, the second 1-bit from the right is at position 3, thus a(25) = 3.
		

Crossrefs

Programs

  • Mathematica
    a007814[n_]:=IntegerExponent[n, 2]; a[n_]:=If[DigitCount[n, 2, 1]<2, 0, a007814[BitAnd[n, n - 1]]]; Table[a[n], {n, 0, 150}] (* Indranil Ghosh, Apr 20 2017 *)
  • Python
    import math
    def a007814(n): return int(math.log(n - (n & n - 1), 2))
    def a(n): return 0 if bin(n)[2:].count("1") < 2 else a007814(n & (n - 1)) # Indranil Ghosh, Apr 20 2017
  • Scheme
    (define (A285099 n) (if (<= (A000120 n) 1) 0 (A007814 (A004198bi n (- n 1))))) ;; A004198bi implements bitwise-and.
    

Formula

If A000120(n) < 2, a(n) = 0, otherwise a(n) = A007814(A129760(n)) = A007814(n AND (n-1)). [Where AND is bitwise-and, A004198].
From Jeffrey Shallit, Apr 19 2020: (Start)
This is a 2-regular sequence, satisfying the identities
a(4n) = -a(n) + a(2n),
a(4n+2) = a(4n+1),
a(8n+1) = -a(2n+1) + 2a(4n+1),
a(8n+3) = a(4n+3),
a(8n+5) = 2a(4n+3),
a(8n+7) = a(4n+3). (End)

A285108 a(n) = A001222(A284578(n)).

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 3, 0, 0, 1, 3, 1, 1, 3, 4, 1, 1, 2, 3, 2, 0, 0, 4, 0, 0, 2, 3, 3, 1, 2, 3, 0, 0, 6, 6, 1, 3, 3, 6, 1, 1, 5, 4, 3, 3, 4, 4, 1, 2, 4, 5, 3, 0, 0, 5, 0, 0, 3, 3, 3, 4, 4, 1, 0, 1, 6, 5, 0, 2, 7, 3, 0, 0, 6, 5, 4, 4, 4, 11, 1, 2, 9, 5, 0, 3, 3, 8, 1, 1, 7, 4, 3, 4, 8, 10, 3, 3, 11, 6, 3, 4, 9, 4, 1, 1, 5, 5, 3, 3, 5, 4, 1
Offset: 0

Views

Author

Antti Karttunen, Apr 11 2017

Keywords

Crossrefs

Programs

  • Scheme
    (define (A285108 n) (A001222 (A284578 n)))
    ;; A more practical version, needing only an implementation of A004198bi (bitwise-and, A004198) and memoization-macro definec:
    (define (A285108 n) (apply + (bitwise_and_of_exp_lists (A260443as_coeff_list n) (A260443as_coeff_list (+ 1 n)))))
    (define (bitwise_and_of_exp_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (bitwise_and_of_exp_lists nums2 nums1)) (else (map A004198bi nums1 (append nums2 (make-list (- len1 len2) 0)))))))
    (definec (A260443as_coeff_list n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_coeff_list (/ n 2)))) (else (add_two_lists (A260443as_coeff_list (/ (- n 1) 2)) (A260443as_coeff_list (/ (+ n 1) 2))))))
    (define (add_two_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (add_two_lists nums2 nums1)) (else (map + nums1 (append nums2 (make-list (- len1 len2) 0)))))))

Formula

a(n) = A001222(A284578(n)).
a(n) = A285106(n) - A285107(n).
Other identities. For all n >= 0:
A007306(1+n) = A285106(n) + a(n) = A285107(n) + 2*a(n).
Previous Showing 61-70 of 96 results. Next