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-10 of 228 results. Next

A059590 Numbers obtained by reinterpreting base-2 representation of n in the factorial base: a(n) = Sum_{k>=0} A030308(n,k)*A000142(k+1).

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 8, 9, 24, 25, 26, 27, 30, 31, 32, 33, 120, 121, 122, 123, 126, 127, 128, 129, 144, 145, 146, 147, 150, 151, 152, 153, 720, 721, 722, 723, 726, 727, 728, 729, 744, 745, 746, 747, 750, 751, 752, 753, 840, 841, 842, 843, 846, 847, 848, 849, 864, 865
Offset: 0

Views

Author

Henry Bottomley, Jan 24 2001

Keywords

Comments

Numbers that are sums of distinct factorials (0! and 1! not treated as distinct).
Complement of A115945; A115944(a(n)) > 0; A115647 is a subsequence. - Reinhard Zumkeller, Feb 02 2006
A115944(a(n)) = 1. - Reinhard Zumkeller, Dec 04 2011
From Tilman Piesk, Jun 04 2012: (Start)
The inversion vector (compare A007623) of finite permutation a(n) (compare A055089, A195663) has only zeros and ones. Interpreted as a binary number it is 2*n (or n when the inversion vector is defined without the leading 0).
The inversion set of finite permutation a(n) interpreted as a binary number (compare A211362) is A211364(n).
(End)

Examples

			128 is in the sequence since 5! + 3! + 2! = 128.
a(22) = 128. a(22) = a(6) + (1 + floor(log(16) / log(2)))! = 8 + 5! = 128. Also, 22 = 10110_2. Therefore, a(22) = 1 * 5! + 0 * 4! + 1 * 3! + 1 + 2! + 0 * 0! = 128. - _David A. Corneth_, Aug 21 2016
		

Crossrefs

Indices of zeros in A257684.
Cf. A275736 (left inverse).
Cf. A025494, A060112 (subsequences).
Subsequence of A060132, A256450 and A275804.
Other sequences that are built by replacing 2^k in the binary representation with other numbers: A029931 (naturals), A089625 (primes), A022290 (Fibonacci), A197433 (Catalans), A276091 (n*n!), A275959 ((2n)!/2). Cf. also A276082 & A276083.

Programs

  • Haskell
    import Data.List (elemIndices)
    a059590 n = a059590_list !! n
    a059590_list = elemIndices 1 $ map a115944 [0..]
    -- Reinhard Zumkeller, Dec 04 2011
    
  • Maple
    [seq(bin2facbase(j),j=0..64)]; bin2facbase := proc(n) local i; add((floor(n/(2^i)) mod 2)*((i+1)!),i=0..floor_log_2(n)); end;
    floor_log_2 := proc(n) local nn,i; nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi; nn := floor(nn/2); od; end;
    # next Maple program:
    a:= n-> (l-> add(l[j]*j!, j=1..nops(l)))(Bits[Split](n)):
    seq(a(n), n=0..57);  # Alois P. Heinz, Aug 12 2025
  • Mathematica
    a[n_] :=  Reverse[id = IntegerDigits[n, 2]].Range[Length[id]]!; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Jun 19 2012, after Philippe Deléham *)
  • PARI
    a(n) = if(n>0, a(n-msb(n)) + (1+logint(n,2))!, 0)
    msb(n) = 2^#binary(n)>>1
    {my(b = binary(n)); sum(i=1,#b,b[i]*(#b+1-i)!)} \\ David A. Corneth, Aug 21 2016
    
  • Python
    def facbase(k, f):
        return sum(f[i] for i, bi in enumerate(bin(k)[2:][::-1]) if bi == "1")
    def auptoN(N): # terms up to N factorial-base digits; 13 generates b-file
        f = [factorial(i) for i in range(1, N+1)]
        return list(facbase(k, f) for k in range(2**N))
    print(auptoN(5)) # Michael S. Branicky, Oct 15 2022

Formula

G.f. 1/(1-x) * Sum_{k>=0} (k+1)!*x^2^k/(1+x^2^k). - Ralf Stephan, Jun 24 2003
a(n) = Sum_{k>=0} A030308(n,k)*A000142(k+1). - Philippe Deléham, Oct 15 2011
From Antti Karttunen, Aug 19 2016: (Start)
a(0) = 0, a(2n) = A153880(a(n)), a(2n+1) = 1+A153880(a(n)).
a(n) = A225901(A276091(n)).
a(n) = A276075(A019565(n)).
a(A275727(n)) = A276008(n).
A275736(a(n)) = n.
A276076(a(n)) = A019565(n).
A007623(a(n)) = A007088(n).
(End)
a(n) = a(n - mbs(n)) + (1 + floor(log(n) / log(2)))!. - David A. Corneth, Aug 21 2016

Extensions

Name changed (to emphasize the functional nature of the sequence) with the old definition moved to the comments by Antti Karttunen, Aug 21 2016

A197433 Sum of distinct Catalan numbers: a(n) = Sum_{k>=0} A030308(n,k)*C(k+1) where C(n) is the n-th Catalan number (A000108). (C(0) and C(1) not treated as distinct.)

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 8, 14, 15, 16, 17, 19, 20, 21, 22, 42, 43, 44, 45, 47, 48, 49, 50, 56, 57, 58, 59, 61, 62, 63, 64, 132, 133, 134, 135, 137, 138, 139, 140, 146, 147, 148, 149, 151, 152, 153, 154, 174, 175, 176, 177, 179, 180, 181, 182, 188, 189, 190, 191, 193, 194, 195, 196
Offset: 0

Views

Author

Philippe Deléham, Oct 15 2011

Keywords

Comments

Replace 2^k with A000108(k+1) in binary expansion of n.
From Antti Karttunen, Jun 22 2014: (Start)
On the other hand, A244158 is similar, but replaces 10^k with A000108(k+1) in decimal expansion of n.
This sequence gives all k such that A014418(k) = A239903(k), which are precisely all nonnegative integers k whose representations in those two number systems contain no digits larger than 1. From this also follows that this is a subsequence of A244155.
(End)

Crossrefs

Characteristic function: A176137.
Subsequence of A244155.
Cf. also A060112.
Other sequences that are built by replacing 2^k in binary representation with other numbers: A022290 (Fibonacci), A029931 (natural numbers), A059590 (factorials), A089625 (primes), A197354 (odd numbers).

Programs

  • Mathematica
    nmax = 63;
    a[n_] := If[n == 0, 0, SeriesCoefficient[(1/(1-x))*Sum[CatalanNumber[k+1]* x^(2^k)/(1 + x^(2^k)), {k, 0, Log[2, n] // Ceiling}], {x, 0, n}]];
    Table[a[n], {n, 0, nmax}] (* Jean-François Alcover, Nov 18 2021, after Ilya Gutkovskiy *)

Formula

For all n, A244230(a(n)) = n. - Antti Karttunen, Jul 18 2014
G.f.: (1/(1 - x))*Sum_{k>=0} Catalan number(k+1)*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jul 23 2017

Extensions

Name clarified by Antti Karttunen, Jul 18 2014

A276091 Numbers obtained by reinterpreting base-2 representation of n in A001563-base (A276326): a(n) = Sum_{k>=0} A030308(n,k)*A001563(k+1).

Original entry on oeis.org

0, 1, 4, 5, 18, 19, 22, 23, 96, 97, 100, 101, 114, 115, 118, 119, 600, 601, 604, 605, 618, 619, 622, 623, 696, 697, 700, 701, 714, 715, 718, 719, 4320, 4321, 4324, 4325, 4338, 4339, 4342, 4343, 4416, 4417, 4420, 4421, 4434, 4435, 4438, 4439, 4920, 4921, 4924, 4925, 4938, 4939, 4942, 4943, 5016, 5017, 5020, 5021, 5034, 5035, 5038, 5039, 35280, 35281
Offset: 0

Views

Author

Antti Karttunen, Aug 19 2016

Keywords

Comments

Numbers that are sums of distinct terms of A001563.
A number is included if and only if all the nonzero digits in its factorial base representation (A007623) are maximal allowed in those digit positions, thus this sequence gives all numbers n for which A060130(n) = A260736(n).
Numbers n for which A276328(n) = A276337(n), thus from 1 onward the positions of ones in A276336.
Conjectured also to give all numbers n for which A255411(n) = A276340(n) (thus zeros of A276339).

Crossrefs

Programs

  • Mathematica
    Table[Total[Times @@@ Transpose@ {Map[# #! &, Range@ Length@ #], Reverse@ #}] &@ IntegerDigits[n, 2], {n, 64}] (* Michael De Vlieger, Aug 31 2016 *)
  • Python
    from sympy import factorial as f
    def a007623(n, p=2): return n if n

    0 else '0' for i in x)[::-1] return 0 if n==0 else sum(int(y[i])*f(i + 1) for i in range(len(y))) def a(n): return 0 if n==0 else a255411(a(n//2)) if n%2==0 else 1 + a255411(a((n - 1)//2)) print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 20 2017

  • Scheme
    ;; This is a standalone program:
    (define (A276091 n) (let loop ((n n) (s 0) (f 1) (i 2)) (cond ((zero? n) s) ((even? n) (loop (/ n 2) s (* i f) (+ 1 i))) (else (loop (/ (- n 1) 2) (+ s (* (- i 1) f)) (* i f) (+ 1 i))))))
    ;; This implements one of the given recurrences:
    (definec (A276091 n) (cond ((zero? n) n) ((even? n) (A255411 (A276091 (/ n 2)))) (else (+ 1 (A255411 (A276091 (/ (- n 1) 2)))))))
    ;; Alternatively, we can use A276340 in place of A255411:
    (definec (A276091 n) (cond ((zero? n) n) ((even? n) (A276340 (A276091 (/ n 2)))) (else (+ 1 (A276340 (A276091 (/ (- n 1) 2)))))))
    

Formula

a(0) = 0, a(2n) = A255411(a(n)), a(2n+1) = 1+A255411(a(n)).
a(0) = 0, a(2n) = A276340(a(n)), a(2n+1) = 1+A276340(a(n)).
Other identities. For all n >= 0:
a(n) = A225901(A059590(n)).
a(n) = A276090(A275959(n)).
A276328(a(n)) = A276337(a(n)) = A000120(n).

Extensions

Name changed (to emphasize the functional nature of the sequence) with the original definition moved to the comments by Antti Karttunen, Sep 01 2016

A283985 Sums of distinct terms of A143293: a(n) = Sum_{k>=0} A030308(n,k)*A143293(k).

Original entry on oeis.org

0, 1, 3, 4, 9, 10, 12, 13, 39, 40, 42, 43, 48, 49, 51, 52, 249, 250, 252, 253, 258, 259, 261, 262, 288, 289, 291, 292, 297, 298, 300, 301, 2559, 2560, 2562, 2563, 2568, 2569, 2571, 2572, 2598, 2599, 2601, 2602, 2607, 2608, 2610, 2611, 2808, 2809, 2811, 2812, 2817, 2818, 2820, 2821, 2847, 2848, 2850, 2851, 2856, 2857, 2859, 2860, 32589
Offset: 0

Views

Author

Antti Karttunen, Mar 19 2017

Keywords

Comments

Indexing starts from zero, with a(0) = 0.

Crossrefs

Programs

  • PARI
    A143293(n) = { if(n==0, return(1)); my(P=1, s=1); forprime(p=2, prime(n), s+=P*=p); s; }; \\ This function from Charles R Greathouse IV, Feb 05 2014
    A030308(n,k) = bittest(n,k);
    A283985(n) = sum(i=0,(#binary(n)-1),A030308(n,i)*A143293(i));
    
  • Python
    from sympy import primorial, primepi, prime, primerange, factorint
    from operator import mul
    from functools import reduce
    def a002110(n): return 1 if n<1 else primorial(n)
    def a276085(n):
        f=factorint(n)
        return sum([f[i]*a002110(primepi(i) - 1) for i in f])
    def P(n): return reduce(mul, [i for i in primerange(2, n + 1)])
    def a108951(n):
        f = factorint(n)
        return 1 if n==1 else reduce(mul, [P(i)**f[i] for i in f])
    def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1 # after Chai Wah Wu
    def a(n): return a276085(a108951(a019565(n)))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 22 2017
  • Scheme
    (define (A283985 n) (A276085 (A283477 n)))
    

Formula

a(n) = Sum_{k>=0} A030308(n,k)*A143293(k).
a(n) = A276085(A283477(n)).
Other identities. For all n >= 0:
a(2^n) = A143293(n).

A197354 a(n) = Sum_{k>=0} A030308(n,k)*(2k+1).

Original entry on oeis.org

0, 1, 3, 4, 5, 6, 8, 9, 7, 8, 10, 11, 12, 13, 15, 16, 9, 10, 12, 13, 14, 15, 17, 18, 16, 17, 19, 20, 21, 22, 24, 25, 11, 12, 14, 15, 16, 17, 19, 20, 18, 19, 21, 22, 23, 24, 26, 27, 20, 21, 23, 24, 25, 26, 28, 29, 27, 28, 30, 31, 32, 33, 35, 36, 13, 14, 16
Offset: 0

Views

Author

Philippe Deléham, Oct 14 2011

Keywords

Comments

For any k >= 0, A000700(k) equals the number of occurrences of k in the sequence. - Rémy Sigrist, Jan 19 2019

Crossrefs

Other sequences that are built by replacing 2^k in the binary representation with other numbers: A022290 (Fibonacci), A029931 (natural numbers), A059590 (factorials), A089625 (primes).

Programs

  • PARI
    a(n) = my (b=Vecrev(binary(n))); sum(i=1, #b, if (b[i], 2*i-1, 0)) \\ Rémy Sigrist, Jan 19 2019

Formula

a(2^n-1) = n^2.
a(n) mod 2 = A010060(n).
G.f.: (1/(1 - x))*Sum_{k>=0} (2*k + 1)*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jul 23 2017

A283984 Sums of distinct nonzero terms of A007489: a(n) = Sum_{k>=0} A030308(n,k)*A007489(1+k).

Original entry on oeis.org

0, 1, 3, 4, 9, 10, 12, 13, 33, 34, 36, 37, 42, 43, 45, 46, 153, 154, 156, 157, 162, 163, 165, 166, 186, 187, 189, 190, 195, 196, 198, 199, 873, 874, 876, 877, 882, 883, 885, 886, 906, 907, 909, 910, 915, 916, 918, 919, 1026, 1027, 1029, 1030, 1035, 1036, 1038, 1039, 1059, 1060, 1062, 1063, 1068, 1069, 1071, 1072, 5913
Offset: 0

Views

Author

Antti Karttunen, Mar 19 2017

Keywords

Comments

Indexing starts from zero, with a(0) = 0.

Crossrefs

Programs

Formula

a(n) = Sum_{i=0..A070939(n)} A030308(n,i)*A007489(1+i).
a(n) = A276075(A283477(n)).
Other identities. For all n >= 0:
a(2^n) = A007489(n+1).

A283483 Sums of distinct nonzero terms of A003462: a(n) = Sum_{k>=0} A030308(n,k)*A003462(1+k).

Original entry on oeis.org

0, 1, 4, 5, 13, 14, 17, 18, 40, 41, 44, 45, 53, 54, 57, 58, 121, 122, 125, 126, 134, 135, 138, 139, 161, 162, 165, 166, 174, 175, 178, 179, 364, 365, 368, 369, 377, 378, 381, 382, 404, 405, 408, 409, 417, 418, 421, 422, 485, 486, 489, 490, 498, 499, 502, 503, 525, 526, 529, 530, 538, 539, 542, 543, 1093, 1094, 1097, 1098, 1106, 1107, 1110, 1111
Offset: 0

Views

Author

Antti Karttunen, Mar 19 2017

Keywords

Comments

Indexing starts from zero, with a(0) = 0.

Crossrefs

Programs

Formula

a(n) = Sum_{i=0..A070939(n)} A030308(n,i)*A003462(1+i).
a(n) = A090880(A283477(n)).
Other identities. For all n >= 0:
a(2^n) = A003462(n+1).

A030311 Least k such that the base-2 representation of n begins at s(k), where s=A030308.

Original entry on oeis.org

1, 1, 3, 5, 1, 4, 3, 17, 5, 9, 1, 4, 8, 3, 13, 49, 17, 22, 5, 31, 9, 38, 1, 16, 4, 8, 37, 3, 29, 14, 13, 129, 49, 55, 17, 66, 22, 5, 33, 87, 31, 75, 9, 106, 38, 1, 11, 48, 16, 21, 4, 30, 8, 37, 40, 15, 3, 29, 36, 14, 84, 13, 43, 321, 129, 136, 49
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A030308.

A030312 Length of n-th run of 0's in A030308.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A030305.

Extensions

First 1 added by Philippe Deléham, Oct 20 2011

A197432 a(n) = Sum_{k>=0} A030308(n,k)*C(k) where C(k) is the k-th Catalan number (A000108).

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 14, 15, 15, 16, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 42, 43, 43, 44, 44, 45, 45, 46, 47, 48, 48, 49, 49, 50, 50, 51, 56, 57, 57, 58, 58, 59, 59, 60, 61, 62, 62, 63, 63, 64, 64, 65
Offset: 0

Views

Author

Philippe Deléham, Oct 15 2011

Keywords

Comments

Replace 2^k with A000108(k) in binary expansion of n.

Examples

			11 = 1011_2, so a(11) = 1*1 + 1*1 + 0*2 + 1*5 = 7.
		

Crossrefs

Other sequences that are built by replacing 2^k in binary representation with other numbers: A022290 (Fibonacci), A029931 (natural numbers), A059590 (factorials), A089625 (primes), A197354 (odd numbers).

Formula

G.f.: (1/(1 - x))*Sum_{k>=0} Catalan number(k)*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jul 23 2017
Showing 1-10 of 228 results. Next