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-9 of 9 results.

A269401 Permutation of natural numbers: a(1) = 1, a(A179016(1+n)) = 2*a(n), a(A213713(n)) = 1 + 2*a(n), where A179016 is the infinite trunk of binary beanstalk and A213713 is its complement.

Original entry on oeis.org

1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 11, 9, 25, 10, 8, 27, 31, 24, 29, 23, 19, 26, 51, 21, 30, 17, 55, 63, 49, 28, 22, 59, 47, 18, 39, 53, 103, 50, 43, 61, 20, 35, 111, 127, 16, 99, 57, 54, 45, 119, 95, 62, 37, 79, 107, 48, 207, 101, 87, 123, 41, 58, 46, 71, 223, 38, 255, 33, 199, 52, 115, 109, 102, 91, 239, 191, 42, 125, 75, 60
Offset: 1

Views

Author

Antti Karttunen, Mar 05 2016

Keywords

Crossrefs

Inverse: A269402.
Related or similar permutations: A269391, A269398.

Formula

a(1) = 1, for n > 1, if A213719(n) = 1 [when n is in A179016] a(n) = 2*a(A269371(n)-1), otherwise a(n) = 1 + 2*a(n-A269371(n)).
As a composition of other permutations:
a(n) = A269391(A269398(n)).

A269402 Permutation of natural numbers: a(1) = 1, a(2n) = A179016(1+a(n)), a(2n+1) = A213713(a(n)).

Original entry on oeis.org

1, 3, 2, 7, 6, 4, 5, 16, 13, 15, 12, 8, 9, 11, 10, 46, 27, 35, 22, 42, 25, 32, 21, 19, 14, 23, 17, 31, 20, 26, 18, 158, 69, 85, 43, 116, 54, 67, 36, 142, 62, 78, 40, 104, 50, 64, 34, 57, 30, 39, 24, 71, 37, 49, 28, 101, 48, 63, 33, 81, 41, 53, 29, 669, 219, 259, 100, 321, 122, 145, 65, 476, 164, 190, 80, 255, 98, 120, 55
Offset: 1

Views

Author

Antti Karttunen, Mar 05 2016

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A179016(1+n), and each right hand child as A213713(n), when the parent contains n:
|
...................1...................
3 2
7......../ \........6 4......../ \........5
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
16 13 15 12 8 9 11 10
46 27 35 22 42 25 32 21 19 14 23 17 31 20 26 18
etc.

Crossrefs

Inverse: A269401.
Related or similar permutations: A269392, A269397.

Formula

a(1) = 1, a(2n) = A179016(1+a(n)), a(2n+1) = A213713(a(n)).
As a composition of other permutations:
a(n) = A269397(A269392(n)).

A269397 Permutation of natural numbers: a(1) = 1, a(A233271(1+n)) = A179016(1+a(n)), a(A269390(n)) = A213713(a(n)), where A179016, A233271 are the infinite trunks of binary beanstalk and inverted binary beanstalk and A213713, A269390 their complements.

Original entry on oeis.org

1, 3, 2, 7, 6, 5, 4, 16, 13, 12, 10, 15, 9, 27, 11, 8, 22, 21, 18, 25, 46, 17, 43, 35, 20, 14, 36, 32, 34, 29, 26, 42, 40, 69, 28, 65, 54, 23, 33, 24, 55, 85, 50, 52, 45, 31, 41, 62, 19, 60, 100, 44, 67, 95, 80, 64, 37, 51, 38, 53, 82, 122, 78, 158, 75, 77, 68, 48, 61, 91, 49, 30, 88, 143, 145, 66, 98, 136, 116, 115, 93, 63, 56, 76, 58, 79, 39
Offset: 1

Views

Author

Antti Karttunen, Mar 05 2016

Keywords

Crossrefs

Inverse: A269398.
Related or similar permutations: A269391, A269401, A269402.
Cf. also A233270.

Formula

a(1) = 1, for n > 1, if A269381(n) - A269381(n-1) > 0 [when n is in A233271] a(n) = A179016(1+a(A269381(n)-1)), otherwise a(n) = A213713(a(n-A269381(n))).
As a composition of related permutations:
a(n) = A269402(A269391(n)).

A269398 Permutation of natural numbers: a(1) = 1, a(A179016(1+n)) = A233271(1+a(n)), a(A213713(n)) = A269390(a(n)), where A179016, A233271 are the infinite trunks of binary beanstalk and inverted binary beanstalk and A213713, A269390 are their complements.

Original entry on oeis.org

1, 3, 2, 7, 6, 5, 4, 16, 13, 11, 15, 10, 9, 26, 12, 8, 22, 19, 49, 25, 18, 17, 38, 40, 20, 31, 14, 35, 30, 72, 46, 28, 39, 29, 24, 27, 57, 59, 87, 33, 47, 32, 23, 52, 45, 21, 103, 68, 71, 43, 58, 44, 60, 37, 41, 83, 186, 85, 123, 50, 69, 48, 82, 56, 36, 76, 53, 67, 34, 144, 128, 98, 101, 143, 65, 84, 66, 63, 86, 55, 106, 61, 118, 253, 42, 121, 169
Offset: 1

Views

Author

Antti Karttunen, Mar 05 2016

Keywords

Crossrefs

Inverse: A269397
Related or similar permutations: A269392, A269401, A269402.
Cf. also A233270.

Formula

a(1) = 1, for n > 1, if A213719(n) = 1 [when n is in A179016] a(n) = A233271(1+a(A269371(n)-1)), otherwise a(n) = 1 + A269390(a(n-A269371(n))).
As a composition of related permutations:
a(n) = A269392(A269401(n)).

A179016 The infinite trunk of binary beanstalk: The only infinite sequence such that a(n-1) = a(n) - number of 1's in binary representation of a(n).

Original entry on oeis.org

0, 1, 3, 4, 7, 8, 11, 15, 16, 19, 23, 26, 31, 32, 35, 39, 42, 46, 49, 53, 57, 63, 64, 67, 71, 74, 78, 81, 85, 89, 94, 97, 101, 104, 109, 112, 116, 120, 127, 128, 131, 135, 138, 142, 145, 149, 153, 158, 161, 165, 168, 173, 176, 180, 184, 190, 193, 197, 200, 205, 209
Offset: 0

Views

Author

Carl R. White, Jun 24 2010

Keywords

Comments

a(n) tells in what number we end in n steps, when we start climbing up the infinite trunk of the "binary beanstalk" from its root (zero). The name "beanstalk" is due to Antti Karttunen.
There are many finite sequences such as 0,1,2; 0,1,3,4,7,9; etc. obeying the same condition (see A218254) and as the length increases, so (necessarily) does the similarity to this infinite sequence.

Crossrefs

A subsequence of A005187, i.e., a(n) = A005187(A213715(n)). For all n,
A071542(a(n)) = n, and furthermore A213708(n) <= a(n) <= A173601(n). (Cf. A218603, A218604).
Rows of A218254, when reversed, converge towards this sequence.
Cf. A276623, A219648, A219666, A255056, A276573, A276583, A276613 for analogous constructions, and also A259934.

Programs

  • Mathematica
    TakeWhile[Reverse@ NestWhileList[# - DigitCount[#, 2, 1] &, 10^3, # > 0 &], # <= 209 &] (* Michael De Vlieger, Sep 12 2016 *)

Formula

a(0)=0, a(1)=1, and for n > 1, if n = A218600(A213711(n)) then a(n) = (2^A213711(n)) - 1, and in other cases, a(n) = a(n+1) - A213712(n+1). (This formula is based on Carl White's observation that this iterated/converging path must pass through each (2^n)-1. However, it would be very interesting to know whether the sequence admits more traditional recurrence(s), referring to previous, not to further terms in the sequence in their definition!) - Antti Karttunen, Oct 26 2012
a(n) = A218616(A218602(n)). - Antti Karttunen, Mar 04 2013
a(n) = A054429(A233271(A218602(n))). - Antti Karttunen, Dec 12 2013

Extensions

Starting offset changed from 1 to 0 by Antti Karttunen, Nov 05 2012

A055938 Integers not generated by b(n) = b(floor(n/2)) + n (complement of A005187).

Original entry on oeis.org

2, 5, 6, 9, 12, 13, 14, 17, 20, 21, 24, 27, 28, 29, 30, 33, 36, 37, 40, 43, 44, 45, 48, 51, 52, 55, 58, 59, 60, 61, 62, 65, 68, 69, 72, 75, 76, 77, 80, 83, 84, 87, 90, 91, 92, 93, 96, 99, 100, 103, 106, 107, 108, 111, 114, 115, 118, 121, 122, 123, 124, 125, 126, 129
Offset: 1

Views

Author

Alford Arnold, Jul 21 2000

Keywords

Comments

Note that the lengths of the consecutive runs in a(n) form sequence A001511.
Integers that are not a sum of distinct integers of the form 2^k-1. - Vladeta Jovovic, Jan 24 2003
Also n! never ends in this many 0's in base 2 - Carl R. White, Jan 21 2008
A079559(a(n)) = 0. - Reinhard Zumkeller, Mar 18 2009
These numbers are dead-end points when trying to apply the iterated process depicted in A071542 in reverse, i.e. these are positive integers i such that there does not exist k with A000120(i+k)=k. See also comments at A179016. - Antti Karttunen, Oct 26 2012
Conjecture: a(n)=b(n) defined as b(1)=2, for n>1, b(n+1)=b(n)+1 if n is already in the sequence, b(n+1)=b(n)+3 otherwise. If so, then see Cloitre comment in A080578. - Ralf Stephan, Dec 27 2013
Numbers n for which A257265(m) = 0. - Reinhard Zumkeller, May 06 2015. Typo corrected by Antti Karttunen, Aug 08 2015
Numbers which have a 2 in their skew-binary representation (cf. A169683). - Allan C. Wechsler, Feb 28 2025

Examples

			Since A005187 begins 0 1 3 4 7 8 10 11 15 16 18 19 22 23 25 26 31... this sequence begins 2 5 6 9 12 13 14 17 20 21
		

Crossrefs

Complement of A005187. Setwise difference of A213713 and A213717.
Row 1 of arrays A257264, A256997 and also of A255557 (when prepended with 1). Equally: column 1 of A256995 and A255555.
Cf. also arrays A254105, A254107 and permutations A233276, A233278.
Left inverses: A234017, A256992.
Gives positions of zeros in A213714, A213723, A213724, A213731, A257265, positions of ones in A213725-A213727 and A256989, positions of nonzeros in A254110.
Cf. also A010061 (integers that are not a sum of distinct integers of the form 2^k+1).
Analogous sequence for factorial base number system: A219658, for Fibonacci number system: A219638, for base-3: A096346. Cf. also A136767-A136774.

Programs

  • Haskell
    a055938 n = a055938_list !! (n-1)
    a055938_list = concat $
       zipWith (\u v -> [u+1..v-1]) a005187_list $ tail a005187_list
    -- Reinhard Zumkeller, Nov 07 2011
    
  • Mathematica
    a[0] = 0; a[1] = 1; a[n_Integer] := a[Floor[n/2]] + n; b = {}; Do[ b = Append[b, a[n]], {n, 0, 105}]; c =Table[n, {n, 0, 200}]; Complement[c, b]
    (* Second program: *)
    t = Table[IntegerExponent[(2n)!, 2], {n, 0, 100}]; Complement[Range[t // Last], t] (* Jean-François Alcover, Nov 15 2016 *)
  • PARI
    L=listcreate();for(n=1,1000,for(k=2*n-hammingweight(n)+1,2*n+1-hammingweight(n+1),listput(L,k)));Vec(L) \\ Ralf Stephan, Dec 27 2013
    
  • Python
    def a053644(n): return 0 if n==0 else 2**(len(bin(n)[2:]) - 1)
    def a043545(n):
        x=bin(n)[2:]
        return int(max(x)) - int(min(x))
    def a079559(n): return 1 if n==0 else a043545(n + 1)*a079559(n + 1 - a053644(n + 1))
    print([n for n in range(1, 201) if a079559(n)==0]) # Indranil Ghosh, Jun 11 2017, after the comment by Reinhard Zumkeller
  • Scheme
    ;; utilizing COMPLEMENT-macro from Antti Karttunen's IntSeq-library)
    (define A055938 (COMPLEMENT 1 A005187))
    ;; Antti Karttunen, Aug 08 2015
    

Formula

a(n) = A080578(n+1) - 2 = A080468(n+1) + 2*n (conjectured). - Ralf Stephan, Dec 27 2013
From Antti Karttunen, Aug 08 2015: (Start)
Other identities. For all n >= 1:
A234017(a(n)) = n.
A256992(a(n)) = n.
A257126(n) = a(n) - A005187(n).
(End)

Extensions

More terms from Robert G. Wilson v, Jul 24 2000

A213717 Terms of A005187 not found in A179016.

Original entry on oeis.org

10, 18, 22, 25, 34, 38, 41, 47, 50, 54, 56, 66, 70, 73, 79, 82, 86, 88, 95, 98, 102, 105, 110, 113, 117, 119, 130, 134, 137, 143, 146, 150, 152, 159, 162, 166, 169, 174, 177, 181, 183, 191, 194, 198, 201, 206, 208, 212, 213, 216, 222, 224, 228, 229, 232, 237, 239, 243, 244, 246, 258, 262, 265, 271, 274, 278, 280, 287, 290, 294, 297, 302, 305, 309, 311, 319, 322, 326, 329, 334, 336, 340, 341, 344, 350, 352, 356, 357, 360, 365
Offset: 1

Views

Author

Antti Karttunen, Oct 26 2012

Keywords

Comments

These are numbers i which do not occur on the unique infinite path of A179016, although there exist such k for which A000120(i+k)=k. For example, with the first term 10, we have cases k=2 and 3, as A000120(10+2)=2 and A000120(10+3)=3. Still, it's not possible to proceed further up from either 12 or 13, as they both are members of A055938.

Crossrefs

Setwise difference of A005187 and A179016 and also setwise difference of A213713 and A055938.

Formula

a(n) = A005187(A213716(n)).

A269390 Complement of A233271.

Original entry on oeis.org

3, 5, 6, 9, 10, 11, 13, 14, 17, 18, 19, 20, 22, 23, 25, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 40, 41, 43, 44, 45, 47, 48, 50, 51, 52, 54, 55, 57, 58, 59, 61, 62, 65, 66, 67, 68, 69, 70, 72, 73, 74, 76, 77, 78, 80, 81, 83, 84, 85, 86, 88, 89, 91, 92, 93, 95, 96, 98, 99, 100, 101, 103, 104, 105, 107, 108, 109, 111
Offset: 1

Views

Author

Antti Karttunen, Mar 05 2016

Keywords

Crossrefs

Cf. A233271 (complement).
Cf. A269381.
Cf. also A213713, A269391, A269392.

A238389 Expansion of (1+x)/(1-x^2-3*x^3).

Original entry on oeis.org

1, 1, 1, 4, 4, 7, 16, 19, 37, 67, 94, 178, 295, 460, 829, 1345, 2209, 3832, 6244, 10459, 17740, 29191, 49117, 82411, 136690, 229762, 383923, 639832, 1073209, 1791601, 2992705, 5011228, 8367508, 13989343, 23401192, 39091867, 65369221, 109295443
Offset: 0

Views

Author

Sergio Falcon, Feb 26 2014

Keywords

Examples

			a(3) = 3*a(0)+a(1) = 4; a(4) = 3*a(1)+a(2) = 4; a(5) = 3*a(2)+a(3) = 7.
		

Crossrefs

Programs

  • Magma
    [n le 3 select 1 else Self(n-2) +3*Self(n-3): n in [1..41]]; // G. C. Greubel, May 09 2021
    
  • Maple
    a:= n-> (<<0|1|0>, <0|0|1>, <3|1|0>>^n.<<(1$3)>>)[(1$2)]:
    seq(a(n), n=0..44);  # Alois P. Heinz, May 09 2021
  • Mathematica
    (* First program *)
    For[j=0, j<3, j++, a[j] = 1]
    For[j=3, j<51, j++, a[j] = 3a[j-3] + a[j-2]]
    Table[a[j], {j, 0, 50}]
    (* Second program *)
    CoefficientList[Series[(1+x)/(1-x^2-3x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 16 2014 *)
    LinearRecurrence[{0,1,3},{1,1,1},40] (* Harvey P. Dale, Feb 28 2023 *)
  • PARI
    Vec((1+x)/(1-x^2-3*x^3)+O(x^99)) \\ Charles R Greathouse IV, Mar 06 2014
    
  • Sage
    def A238389_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( (1+x)/(1-x^2-3*x^3) ).list()
    A238389_list(40) # G. C. Greubel, May 09 2021

Formula

a(0)=1, a(1)=1, a(2)=1; for n>2, a(n) = a(n-2) + 3*a(n-3).
a(2n) = Sum_{j=0}^{n/3} binomial(n-j,2j)*3^(2j) + Sum_{j=0}^{(n-2)/3} binomial(n-1-j,2j+1)*3^(2j+1).
a(2n+1) = Sum_{j=0}^{n/3} binomial(n-j,2j)*3^(2j) + Sum_{j=0}^{(n-1)/3} binomial(n-j,2j+1)*3^(2j+1).
a(n) = |A106855(n)| + |A106855(n-1)| . - R. J. Mathar, Mar 13 2014

Extensions

Terms corrected by Charles R Greathouse IV, Mar 06 2014
Showing 1-9 of 9 results.